/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Header Styles */
.header {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-container>* {
    flex: 1;
}

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

.center-logo-img {
    height: 50px;
    max-width: 200px;
    object-fit: contain;
}

.logo h1 {
    color: #EC1600;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.logo p {
    color: #033c59;
    font-size: 0.9rem;
    font-weight: 500;
}

.user-info {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.user-info i {
    color: #033c59;
}

.user-info .fas.fa-user-circle {
    font-size: 1.5rem;
}

.user-info .fas.fa-chevron-down {
    font-size: 0.8rem;
    margin-left: 0.25rem;
}

/* Page Container */
.page {
    display: none;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.page.active {
    display: block;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.page-header h2 {
    color: #033c59;
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-buttons {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    padding: 0.5rem 1rem;
    background: white;
    color: #033c59;
    border: 1px solid #033c59;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: #033c59;
    color: white;
}

/* Home Page Styles */
.welcome-section {
    text-align: center;
    background: white;
    padding: 3rem 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
}

.welcome-section h2 {
    color: #033c59;
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.welcome-section p {
    color: #666;
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
}

.home-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.action-card {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border-color: #EC1600;
}

.action-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #EC1600, #ff4d2e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
}

.action-icon i {
    color: white;
    font-size: 1.5rem;
}

.action-card h3 {
    color: #033c59;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.action-card p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.action-btn {
    background: #EC1600;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #d41400;
}

/* Search Section */
.search-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1.5rem;
    align-items: end;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    color: #033c59;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.input-group input,
.input-group select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #EC1600;
    box-shadow: 0 0 0 2px rgba(236, 22, 0, 0.1);
}

.search-btn {
    background: #EC1600;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    height: fit-content;
}

.search-btn:hover {
    background: #d41400;
}

/* Results Layout */
.results-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    margin-top: 2rem;
}

.table-section {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #033c59;
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    font-size: 0.9rem;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table tbody tr.loading {
    background: #fff3cd;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.system-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.data-path {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #666;
    background: #f5f5f5;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
}

.download-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

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

.preview-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

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

.variant-link {
    color: #EC1600;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.variant-link:hover {
    background: rgba(236, 22, 0, 0.1);
    text-decoration: underline;
}

/* Preview Section */
.preview-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    max-height: 600px;
}

.preview-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.preview-header h3 {
    color: #033c59;
    font-size: 1rem;
    font-weight: 600;
}

.preview-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #999;
    text-align: center;
}

.preview-placeholder i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #ccc;
}

.document-preview {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 1rem;
    border: 1px solid #e9ecef;
}

.document-info {
    margin-bottom: 1rem;
}

.document-info h4 {
    color: #033c59;
    margin-bottom: 0.5rem;
}

.document-info span {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.25rem;
}

/* Bulk Input Section */
.bulk-input-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.input-method-section,
.attribute-selection-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.input-method-section h3,
.attribute-selection-section h3 {
    color: #033c59;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.input-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.option-group {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem;
}

.option-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #033c59;
    font-weight: 500;
    margin-bottom: 1rem;
    cursor: pointer;
}

.file-upload-area {
    margin-top: 0.5rem;
}

.upload-zone {
    border: 2px dashed #ddd;
    border-radius: 6px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-zone:hover {
    border-color: #EC1600;
    background: rgba(236, 22, 0, 0.05);
}

.upload-zone i {
    font-size: 2rem;
    color: #EC1600;
    margin-bottom: 1rem;
}

.upload-zone p {
    color: #033c59;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.upload-zone span {
    color: #666;
    font-size: 0.9rem;
}

#bulk-sku-textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
}

.custom-attributes {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.attributes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.attributes-grid label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
}

.selection-count {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
    margin-top: 1rem;
}

.process-btn {
    background: #EC1600;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
    width: 100%;
}

.process-btn:hover {
    background: #d41400;
}

/* Progress Section */
.progress-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.progress-section h3 {
    color: #033c59;
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #EC1600, #ff4d2e);
    width: 0%;
    transition: width 0.3s ease;
}

#bulk-progress-status {
    color: #666;
    font-size: 0.95rem;
}

/* Results Section */
.results-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.results-section h3 {
    color: #28a745;
    margin-bottom: 1.5rem;
}

.download-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-summary p {
    margin-bottom: 0.5rem;
    color: #666;
}

.download-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

/* Attribute Sets Layout */
.attribute-sets-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.existing-sets-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.existing-sets-section h3 {
    color: #033c59;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.sets-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.set-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.set-item:hover {
    border-color: #EC1600;
    box-shadow: 0 2px 8px rgba(236, 22, 0, 0.1);
}

.set-info h4 {
    color: #033c59;
    margin-bottom: 0.5rem;
}

.set-info p {
    color: #666;
    font-size: 0.9rem;
}

.set-actions {
    display: flex;
    gap: 0.5rem;
}

.edit-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

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

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

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

.new-set-btn {
    background: #EC1600;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.new-set-btn:hover {
    background: #d41400;
}

/* Attribute Creation Section */
.attribute-creation-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-height: 800px;
    overflow-y: auto;
}

#creation-title {
    color: #033c59;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.set-name-input {
    margin-bottom: 2rem;
}

.set-name-input label {
    color: #033c59;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

.set-name-input input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}

.attributes-by-system {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.system-group {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem;
}

.system-group h4 {
    color: #033c59;
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.system-group h4 i {
    color: #EC1600;
}

.attributes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.5rem;
}

.attributes-list label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.attributes-list label:hover {
    background: rgba(236, 22, 0, 0.05);
}

.creation-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selected-count {
    color: #033c59;
    font-weight: 500;
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

.cancel-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.save-btn {
    background: #EC1600;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-btn:hover {
    background: #d41400;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .results-layout {
        grid-template-columns: 1fr;
    }

    .attribute-sets-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .search-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .bulk-input-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .home-actions {
        grid-template-columns: 1fr;
    }

    .page {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .download-area {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Animation for smooth transitions */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}