* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #333;
    font-size: 24px;
}

.stats {
    display: flex;
    gap: 15px;
    align-items: center;
}

.stats span {
    background: #f0f0f0;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.btn-logout {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.filter-panel {
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.filter-panel h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 18px;
}

.filter-row {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    color: #555;
    font-size: 14px;
    font-weight: 600;
}

.filter-input {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.filter-input:focus {
    outline: none;
    border-color: #667eea;
}

.filter-group input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.loading {
    background: white;
    padding: 60px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-products {
    background: white;
    padding: 60px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-size: 18px;
    color: #28a745;
}

.product-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.product-header > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-header h2 {
    color: #333;
    font-size: 22px;
    margin-bottom: 5px;
}

.categories {
    background: #e3f2fd;
    color: #1976d2;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 14px;
    display: inline-block;
}

.status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.status-badge.status-raw {
    background: #e3f2fd;
    color: #1976d2;
}

.status-badge.status-pending {
    background: #fff3e0;
    color: #f57c00;
}

.content-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 30px;
}

.content-block h3 {
    color: #555;
    margin-bottom: 15px;
    font-size: 18px;
}

.comparison {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    gap: 20px;
    align-items: start;
}

.comparison h4 {
    color: #777;
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.arrow {
    text-align: center;
    font-size: 24px;
    color: #667eea;
    align-self: center;
}

.text-content {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    min-height: 60px;
}

.text-content.editable {
    background: #fff;
    border: 2px solid #667eea;
    font-family: inherit;
    width: 100%;
    resize: vertical;
}

.text-content.editable:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #777;
    margin-top: 5px;
}

.char-count.warning {
    color: #ff9800;
    font-weight: 600;
}

.char-count.error {
    color: #dc3545;
    font-weight: 600;
}

.info-box {
    background: #f0f7ff;
    border-left: 4px solid #667eea;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.info-box p {
    color: #555;
    margin-bottom: 10px;
    font-weight: 600;
}

.info-box ol {
    margin-left: 20px;
    color: #666;
}

.info-box ol li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-process {
    background: #667eea;
    color: white;
}

.btn-process:hover {
    background: #5568d3;
}

.btn-approve {
    background: #28a745;
    color: white;
}

.btn-approve:hover {
    background: #218838;
}

.btn-reject {
    background: #dc3545;
    color: white;
}

.btn-reject:hover {
    background: #c82333;
}

.btn-next {
    background: #6c757d;
    color: white;
}

.btn-next:hover {
    background: #5a6268;
}

.btn-edit {
    padding: 6px 16px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-edit:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.text-content.preview {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    min-height: 150px;
    border: 1px solid #e0e0e0;
    line-height: 1.6;
}

.text-content.preview p {
    margin-bottom: 10px;
}

.text-content.preview strong,
.text-content.preview b {
    font-weight: 600;
    color: #333;
}

.text-content.preview ul,
.text-content.preview ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.text-content.preview li {
    margin-bottom: 5px;
}

.progress {
    text-align: center;
    margin-top: 20px;
    font-size: 16px;
    color: #777;
    font-weight: 600;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #28a745;
    color: white;
}

.notification.error {
    background: #dc3545;
    color: white;
}

@media (max-width: 768px) {
    .comparison {
        grid-template-columns: 1fr;
    }

    .arrow {
        display: none;
    }

    .actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .stats {
        flex-direction: column;
        gap: 8px;
    }
}
/* ==================== TAB NAVIGATION ==================== */
.tab-navigation {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    background: white;
    border: none;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #666;
}

.tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ==================== TAB CONTENT ==================== */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==================== HISTORY SECTION ==================== */
.history-filter {
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 20px;
    align-items: flex-end;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.history-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s;
    border-left: 4px solid #667eea;
}

.history-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.history-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.history-card-category {
    font-size: 13px;
    color: #667eea;
    background: #f0f4ff;
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
}

.history-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.history-card-date {
    font-size: 12px;
    color: #999;
}

.status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
}

.status-badge.saved {
    background: #fff3cd;
    color: #856404;
}

.status-badge.reviewed {
    background: #cfe2ff;
    color: #084298;
}

.status-badge.approved {
    background: #d1e7dd;
    color: #0f5132;
}

/* ==================== PAGINATION ==================== */
.pagination {
    background: white;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#historyPageInfo {
    font-weight: 600;
    color: #667eea;
    min-width: 100px;
    text-align: center;
}

/* ==================== MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    overflow-y: auto;
    padding: 20px;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
}

.modal-header h2 {
    color: white;
    margin: 0;
    font-size: 22px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.modal-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
}

.btn-nav {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-nav:hover:not(:disabled) {
    background: #5568d3;
    transform: translateX(-2px);
}

.btn-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.modal-footer {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: flex-end;
}

/* ==================== RESPONSIVE UPDATES ==================== */
@media (max-width: 768px) {
    .tab-navigation {
        flex-direction: column;
    }

    .history-grid {
        grid-template-columns: 1fr;
    }

    .history-filter {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-nav {
        flex-direction: column;
        gap: 10px;
    }

    .btn-nav {
        width: 100%;
    }
}


/* ==================== USAGE GUIDE STYLES ==================== */
.usage-guide {
    margin-bottom: 25px;
}

.usage-guide-toggle {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.usage-guide-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.usage-guide-content {
    background: #f8f9ff;
    border: 2px solid #e0e5ff;
    border-radius: 12px;
    padding: 25px;
    margin-top: 15px;
    line-height: 1.7;
}

.usage-guide-content h4 {
    color: #667eea;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.usage-guide-content h4:first-child {
    margin-top: 0;
}

.usage-guide-content p {
    color: #555;
    margin-bottom: 15px;
}

.usage-guide-content ul, .usage-guide-content ol {
    color: #555;
    padding-left: 25px;
    margin-bottom: 15px;
}

.usage-guide-content li {
    margin-bottom: 12px;
}

.usage-guide-content li strong {
    color: #667eea;
}

.usage-guide-content em {
    color: #888;
    font-size: 14px;
    display: block;
    margin-top: 5px;
}

.filter-combinations {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.combination-item {
    padding: 12px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
    background: #f8f9ff;
    border-radius: 4px;
}

.combination-item:last-child {
    margin-bottom: 0;
}

.combination-item strong {
    display: block;
    margin-bottom: 5px;
    font-size: 15px;
}

.combination-item em {
    color: #888;
    font-size: 13px;
}

@media (max-width: 768px) {
    .usage-guide-content {
        padding: 20px;
    }

    .usage-guide-toggle {
        font-size: 14px;
        padding: 12px 16px;
    }
}
