/* استایل مدرن و حرفه‌ای برای صفحه مقایسه محصولات */
@font-face {
    font-family: 'Samim';
    src: url('../fonts/Samim.eot');
    src: url('../fonts/Samim.eot?#iefix') format('embedded-opentype'),
         url('../fonts/Samim.woff2') format('woff2'),
         url('../fonts/Samim.woff') format('woff'),
         url('../fonts/Samim.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* تنظیمات کلی */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: #ffffff !important;
}

/* اطمینان از سفید بودن کل صفحه */
html, body {
    background: #ffffff !important;
    background-color: #ffffff !important;
}

body {
    font-family: 'Samim', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff !important;
    color: #1f2937;
    line-height: 1.6;
    min-height: 100vh;
    direction: rtl;
    font-size: 16px;
    margin: 0;
    padding: 0;
}

/* کانتینر اصلی */
.compare-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 10px 10px;
    background: #ffffff !important;
    position: relative;
    min-height: 100vh;
}

/* هدر صفحه */
.compare-header {
    background: #ffffff !important;
    color: #1f2937;
    padding: 20px 0;
    text-align: center;
    margin-bottom: 15px;
    position: relative;
}

.compare-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #2563eb;
    letter-spacing: -0.025em;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% {
        text-shadow: 0 0 5px rgba(37, 99, 235, 0.3);
    }
    100% {
        text-shadow: 0 0 20px rgba(37, 99, 235, 0.6), 0 0 30px rgba(37, 99, 235, 0.4);
    }
}

.compare-header p {
    font-size: 1.1rem;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* نکته راهنما */
.compare-header .tip-box {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #93c5fd;
    padding: 12px 16px;
    border-radius: 12px;
    margin-top: 10px;
    font-size: 0.95rem;
    color: #1e40af;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    position: relative;
    overflow: hidden;
}

.compare-header .tip-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* جدول مقایسه */
.compare-table-container {
    background: #ffffff !important;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e5e7eb;
    margin: 0 5px;
}

.compare-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff !important;
}

/* هدر جدول */
.compare-table th {
    background: #ffffff !important;
    padding: 20px 16px;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
    text-align: center;
    font-size: 0.9rem;
}

.compare-table th:first-child {
    background: #ffffff !important;
    color: #111827;
    text-align: right;
    padding-right: 24px;
    font-weight: 700;
    border-right: 1px solid #e5e7eb;
}

/* سلول‌های جدول */
.compare-table td {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
    background: #ffffff !important;
    transition: background-color 0.2s ease;
}

.compare-table td:first-child {
    background: #ffffff !important;
    font-weight: 600;
    color: #374151;
    text-align: right;
    padding-right: 24px;
    border-right: 1px solid #e5e7eb;
}

.compare-table tr:hover td {
    background: #ffffff !important;
}

/* کارت محصول */
.product-card {
    text-align: center;
    padding: 24px 16px;
    background: #ffffff !important;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    position: relative;
}

.product-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* تصویر محصول */
.product-image {
    width: 140px;
    height: 140px;
    object-fit: contain;
    border-radius: 6px;
    margin: 0 auto 16px;
    display: block;
    transition: transform 0.2s ease;
    background: #ffffff !important;
    padding: 8px;
}

.product-image:hover {
    transform: scale(1.02);
}

/* نام محصول */
.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 16px;
    line-height: 1.4;
}

/* قیمت محصول */
.product-price {
    margin: 16px 0;
    padding: 12px;
    background: #ffffff !important;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.current-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #059669;
    display: block;
    margin-bottom: 4px;
}

.old-price {
    font-size: 1rem;
    color: #9ca3af;
    text-decoration: line-through;
    display: block;
    margin-bottom: 6px;
}

.discount-badge {
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* دکمه‌های عملیات */
.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

.btn-compare, .btn-remove, .btn-reset {
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: none;
}

.btn-compare {
    background: #10b981;
    color: white;
}

.btn-compare:hover {
    background: #059669;
}

.btn-remove {
    background: #ef4444;
    color: white;
}

.btn-remove:hover {
    background: #dc2626;
}

.btn-reset {
    background: #6b7280;
    color: white;
}

.btn-reset:hover {
    background: #4b5563;
}

/* متغیرهای محصول */
.variant-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 6px 0;
    padding: 8px 12px;
    background: #ffffff !important;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    font-size: 0.9rem;
}

.variant-item:hover {
    background: #ffffff !important;
    border-color: #d1d5db;
}

.clickable-variant.selected {
    background: #dcfce7;
    border-color: #10b981;
    color: #059669;
    font-weight: 600;
}

.clickable-variant.selected::after {
    content: '✓';
    position: absolute;
    top: 6px;
    left: 6px;
    background: #10b981;
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

/* دایره رنگ */
.color-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.color-circle:hover {
    transform: scale(1.05);
}

/* وضعیت موجودی */
.stock-status {
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.8rem;
    text-align: center;
    display: inline-block;
    transition: all 0.2s ease;
}

.in-stock {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.out-of-stock {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* جعبه‌های اسکرول */
.description-scroll-box, .features-scroll-box {
    height: 150px;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    padding: 12px;
    background: #ffffff !important;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: right;
    direction: rtl;
    border-radius: 6px;
    transition: border-color 0.2s ease;
}

.features-scroll-box {
    background: #ffffff !important;
}

.description-scroll-box:hover, .features-scroll-box:hover {
    border-color: #d1d5db;
}

/* اسکرول بار سفارشی */
.description-scroll-box::-webkit-scrollbar,
.features-scroll-box::-webkit-scrollbar {
    width: 6px;
}

.description-scroll-box::-webkit-scrollbar-track,
.features-scroll-box::-webkit-scrollbar-track {
    background: #ffffff !important;
    border-radius: 3px;
}

.description-scroll-box::-webkit-scrollbar-thumb,
.features-scroll-box::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.description-scroll-box::-webkit-scrollbar-thumb:hover,
.features-scroll-box::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* دکمه بازگشت به بالا */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.scroll-to-top:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-5px) scale(1.05);
}

.scroll-to-top svg {
    margin: 0 auto;
    width: 24px;
    height: 24px;
    stroke-width: 3;
}

/* حالت خالی */
.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: #6b7280;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: #374151;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 24px;
}

.btn-back {
    background: #6b7280;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-block;
}

.btn-back:hover {
    background: #4b5563;
}

/* ریسپانسیو */
@media (max-width: 1200px) {
    .compare-container {
        padding: 8px 5px;
    }
    
    .compare-header {
        padding: 15px 0;
    }
    
    .compare-header h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .compare-container {
        padding: 5px 2px;
    }
    
    .compare-header {
        padding: 10px 0;
    }
    
    .compare-header h1 {
        font-size: 1.8rem;
    }
    
    .compare-header p {
        font-size: 1rem;
    }
    
    .compare-table th,
    .compare-table td {
        padding: 8px 4px;
    }
    
    .product-image {
        width: 80px;
        height: 80px;
    }
    
    .product-card {
        padding: 12px 8px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }
    
    .btn-compare, .btn-remove, .btn-reset {
        width: 100%;
        justify-content: center;
        font-size: 0.7rem;
        padding: 6px 8px;
    }
    
    .scroll-to-top {
        bottom: 80px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    .scroll-to-top svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .compare-container {
        padding: 3px 1px;
    }
    
    .compare-header {
        padding: 8px 0;
    }
    
    .compare-header h1 {
        font-size: 1.6rem;
    }
    
    .product-image {
        width: 60px;
        height: 60px;
    }
    
    .current-price {
        font-size: 1rem;
    }
    
    .variant-item {
        padding: 4px 6px;
        font-size: 0.7rem;
    }
    
    .compare-table th,
    .compare-table td {
        padding: 6px 2px;
    }
}

/* انیمیشن‌های ساده */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.product-card {
    animation: fadeIn 0.3s ease-out;
}
