/* Product Import Styles - Complete Redesign */
/* Modern glassmorphism design with purple/dark navy color scheme */
/* Eliminated all duplicate styles in preview cards */

/* Import Form Section */
#import-form-section {
    padding: 2rem;
    background: rgba(10, 25, 47, 0.4);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(197, 165, 114, 0.2);
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#import-form {
    background: rgba(123, 30, 58, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(197, 165, 114, 0.3);
    box-shadow: 0 4px 20px rgba(123, 30, 58, 0.2);
}

#import-form .form-group {
    margin-bottom: 1.5rem;
}

#import-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #F9FAFB;
    font-size: 0.95rem;
}

#import-form input[type="file"] {
    width: 100%;
    padding: 1rem;
    border: 2px dashed rgba(197, 165, 114, 0.5);
    border-radius: 8px;
    background: rgba(10, 25, 47, 0.3);
    color: #F9FAFB;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

#import-form input[type="file"]:hover {
    border-color: #C5A572;
    background: rgba(197, 165, 114, 0.1);
    transform: translateY(-1px);
}

#import-form button[type="submit"] {
    background: linear-gradient(135deg, #7B1E3A, #C5A572);
    color: #F9FAFB;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(123, 30, 58, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

#import-form button[type="submit"]:hover {
    background: linear-gradient(135deg, #C5A572, #7B1E3A);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(123, 30, 58, 0.4);
}

/* Column Info Box */
#import-form .column-info {
    background: rgba(30, 144, 255, 0.1);
    border: 1px solid rgba(30, 144, 255, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

#import-form .column-info h4 {
    color: #1E90FF;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

#import-form .column-info .column-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #E5E7EB;
}

#import-form .column-info .column-item {
    padding: 0.25rem 0;
}

#import-form .column-info .column-item strong {
    color: #F9FAFB;
}

#import-form .column-info .note {
    font-size: 0.8rem;
    color: rgba(229, 231, 235, 0.7);
    margin-top: 0.75rem;
    font-style: italic;
}

/* Preview Section */
#preview-section {
    padding: 2rem;
    background: rgba(10, 25, 47, 0.4);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(197, 165, 114, 0.2);
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#preview-section h4 {
    color: #C5A572;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Statistics Cards */
#import-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(10, 25, 47, 0.6);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(197, 165, 114, 0.3);
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #C5A572;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    color: #F9FAFB;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Products Preview Container */
#products-preview {
    background: rgba(10, 25, 47, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(197, 165, 114, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-height: 600px;
    overflow-y: auto;
    padding: 1rem;
}

/* Modern Preview Cards - Enhanced Design with Purple Theme */
.import-preview-card.modern-card {
    background: linear-gradient(135deg, rgba(10, 25, 47, 0.9), rgba(10, 25, 47, 0.7));
    backdrop-filter: blur(16px);
    border-radius: 20px;
    margin-bottom: 2rem;
    border: 2px solid rgba(139, 92, 246, 0.2);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), 0 4px 16px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: relative;
}

.import-preview-card.modern-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #8B5CF6, #7C3AED, #6366F1);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.import-preview-card.modern-card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.25);
    border-color: rgba(139, 92, 246, 0.5);
}

.import-preview-card.modern-card:hover::before {
    opacity: 1;
}

/* Disable pop-out hover effect for preview cards when `.no-popout` is present */
.import-preview-card.modern-card.no-popout:hover {
    transform: none !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25) !important;
    border-color: rgba(139, 92, 246, 0.2) !important;
}


.import-preview-card.modern-card.valid {
    border-left: 6px solid #8B5CF6;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(10, 25, 47, 0.8));
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.15), 0 4px 16px rgba(0, 0, 0, 0.15);
}

.import-preview-card.modern-card.invalid {
    border-left: 6px solid #7B1E3A;
    background: linear-gradient(135deg, rgba(123, 30, 58, 0.08), rgba(10, 25, 47, 0.8));
    box-shadow: 0 12px 40px rgba(123, 30, 58, 0.15), 0 4px 16px rgba(0, 0, 0, 0.15);
}

.card-header.modern-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem 1.5rem 0.75rem;
    border-bottom: 1px solid rgba(197, 165, 114, 0.2);
    background: rgba(255, 255, 255, 0.02);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: rgba(249, 250, 251, 0.7);
}

.product-code,
.brand-id {
    background: rgba(197, 165, 114, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(197, 165, 114, 0.2);
    font-weight: 500;
}

.card-index {
    font-weight: bold;
    color: #8B5CF6;
    font-size: 1rem;
    background: rgba(139, 92, 246, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.card-status {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-content.modern-content {
    padding: 1rem 1.5rem 1.5rem;
}

.editable-fields.modern-fields {
    margin-bottom: 1.25rem;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.field-group.modern-field {
    display: flex;
    flex-direction: column;
}

.field-group.modern-field label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #8B5CF6;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.9;
}

.edit-brand.modern-input,
.edit-name.modern-input,
.edit-price.modern-input,
.edit-category.modern-select {
    padding: 0.75rem;
    border: 2px solid rgba(197, 165, 114, 0.2);
    border-radius: 8px;
    background: rgba(10, 25, 47, 0.4);
    color: #F9FAFB;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
}

.edit-brand.modern-input:focus,
.edit-name.modern-input:focus,
.edit-price.modern-input:focus,
.edit-category.modern-select:focus {
    outline: none;
    border-color: #C5A572;
    box-shadow: 0 0 0 3px rgba(197, 165, 114, 0.15), 0 4px 12px rgba(197, 165, 114, 0.1);
    background: rgba(10, 25, 47, 0.6);
    transform: translateY(-1px);
}

.edit-price.modern-input {
    max-width: none;
}

.edit-category.modern-select {
    background: rgba(10, 25, 47, 0.4);
    color: #F9FAFB;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23C5A572' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1rem;
    padding-right: 2.5rem;
}

.edit-category.modern-select option {
    background: #0A192F;
    color: #F9FAFB;
    padding: 0.5rem;
}

.error-list.modern-error {
    background: linear-gradient(135deg, rgba(123, 30, 58, 0.3), rgba(178, 34, 34, 0.2));
    border: 1px solid rgba(123, 30, 58, 0.4);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.8rem;
    color: #F87171;
    font-weight: 600;
    margin-bottom: 1rem;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(123, 30, 58, 0.1);
}

.card-actions.modern-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(197, 165, 114, 0.1);
}

.delete-btn.modern-btn,
.apply-btn.modern-btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.delete-btn.modern-btn::before,
.apply-btn.modern-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.delete-btn.modern-btn:hover::before,
.apply-btn.modern-btn:hover::before {
    left: 100%;
}

.delete-btn.modern-btn {
    background: linear-gradient(135deg, #7B1E3A, #B22222);
    color: #F9FAFB;
    box-shadow: 0 4px 16px rgba(123, 30, 58, 0.4);
}

.delete-btn.modern-btn:hover {
    background: linear-gradient(135deg, #B22222, #7B1E3A);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(123, 30, 58, 0.5);
}

.apply-btn.modern-btn {
    background: linear-gradient(135deg, #C5A572, #D4AF37);
    color: #0A192F;
    box-shadow: 0 4px 16px rgba(197, 165, 114, 0.4);
}

.apply-btn.modern-btn:hover {
    background: linear-gradient(135deg, #D4AF37, #C5A572);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(197, 165, 114, 0.5);
}



/* Results Section */
#results-section {
    padding: 2rem;
    background: rgba(10, 25, 47, 0.4);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(197, 165, 114, 0.2);
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#results-section h4 {
    color: #C5A572;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#results-container {
    background: rgba(10, 25, 47, 0.6);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(197, 165, 114, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.results-summary h3 {
    color: #C5A572;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.results-summary p {
    margin: 0.5rem 0;
    font-size: 1rem;
    color: #F9FAFB;
}

/* Loader */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loader-content {
    background: rgba(10, 25, 47, 0.9);
    backdrop-filter: blur(15px);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(197, 165, 114, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.loader-spinner {
    border: 4px solid rgba(197, 165, 114, 0.3);
    border-top: 4px solid #C5A572;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loader-text {
    color: #F9FAFB;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    #import-form-section,
    #preview-section,
    #results-section {
        padding: 1rem;
    }

    #import-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.8rem;
    }

    .product-details {
        flex-direction: column;
        gap: 0.5rem;
    }

    #pagination-controls {
        flex-direction: column;
        gap: 1rem;
    }

    #import-actions {
        flex-direction: column;
    }

    #import-actions button,
    #import-actions a {
        width: 100%;
        justify-content: center;
    }



    .card-content .product-name {
        font-size: 0.9rem;
    }
}

/* Animations */
.fade-out {
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus States for Accessibility */
#import-form input[type="file"]:focus,
#import-form button[type="submit"]:focus,
#pagination-prev:focus,
#pagination-next:focus,
#cancel-import:focus,
#confirm-import:focus,
#back-to-import:focus {
    outline: 2px solid #C5A572;
    outline-offset: 2px;
}

/* Progress Bar Styles */
#import-progress-container {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(10, 25, 47, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(197, 165, 114, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: none;
}

.progress-bar-wrapper {
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(10, 25, 47, 0.4);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(197, 165, 114, 0.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #C5A572, #D4AF37);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 6px;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.progress-step {
    color: #C5A572;
    font-weight: 600;
    font-size: 0.9rem;
}

.progress-percentage {
    color: #F9FAFB;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Print Styles */
@media print {
    #import-form-section,
    #preview-section,
    #results-section {
        background: white;
        border: 1px solid #ccc;
        box-shadow: none;
        backdrop-filter: none;
    }

    .import-preview-card {
        border: 1px solid #ccc;
        background: white;
        color: black;
    }

    .card-status {
        color: black !important;
    }
}
