/**
 * DealFrance Comparison Table Styles
 * Inspired by AzonPress comparison features
 */

/* ==========================================================================
   Comparison Table Wrapper
   ========================================================================== */

.dealfrance-comparison-table {
    margin: 30px 0;
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background: #fff;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #fff;
    min-width: 600px;
}

/* ==========================================================================
   Table Headers
   ========================================================================== */

.comparison-table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px 15px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    border: none;
    position: relative;
}

.comparison-table thead th:first-child {
    background: #2c3e50;
    text-align: left;
    border-top-left-radius: 12px;
}

.comparison-table thead th:last-child {
    border-top-right-radius: 12px;
}

.comparison-table thead th h4 {
    margin: 10px 0 0 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    max-height: 3.9em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* ==========================================================================
   Table Body
   ========================================================================== */

.comparison-table tbody td {
    padding: 18px 15px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
}

.comparison-table tbody td:first-child {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    text-align: left;
    border-right: 2px solid #e9ecef;
    font-size: 15px;
}

.comparison-table tbody tr:nth-child(even) td:not(:first-child) {
    background: #fafbfc;
}

.comparison-table tbody tr:hover td:not(:first-child) {
    background: #f1f3f4;
    transition: background 0.2s ease;
}

/* ==========================================================================
   Product Images
   ========================================================================== */

.comparison-table img {
    max-width: 100px;
    height: auto;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.comparison-table img:hover {
    transform: scale(1.05);
}

/* ==========================================================================
   Price Styling
   ========================================================================== */

.comparison-table .old-price {
    display: block;
    text-decoration: line-through;
    color: #6c757d;
    font-size: 13px;
    margin-bottom: 5px;
    font-weight: 400;
}

.comparison-table .current-price {
    color: #e47911;
    font-weight: 700;
    font-size: 18px;
    display: block;
}

.comparison-table .price-badge {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 5px;
    display: inline-block;
}

/* ==========================================================================
   Rating Stars
   ========================================================================== */

.comparison-table .rating {
    color: #ffa500;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
    display: block;
}

.comparison-table .rating-count {
    color: #6c757d;
    font-size: 12px;
    font-weight: 400;
}

.comparison-table .stars {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.comparison-table .star {
    color: #ffa500;
    margin-right: 2px;
}

.comparison-table .star.empty {
    color: #dee2e6;
}

/* ==========================================================================
   Features List
   ========================================================================== */

.comparison-table ul {
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.comparison-table li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    font-size: 13px;
    line-height: 1.4;
    color: #495057;
}

.comparison-table li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
    font-size: 14px;
}

.comparison-table li:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Buy Buttons
   ========================================================================== */

.comparison-table .buy-button {
    display: inline-block;
    background: linear-gradient(45deg, #ff9900, #ff7700);
    color: #fff;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comparison-table .buy-button:hover {
    background: linear-gradient(45deg, #e88a00, #cc6600);
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 153, 0, 0.4);
}

.comparison-table .buy-button:active {
    transform: translateY(0);
}

/* ==========================================================================
   Badges and Labels
   ========================================================================== */

.comparison-table .best-value {
    position: relative;
}

.comparison-table .best-value:before {
    content: "En İyi Değer";
    position: absolute;
    top: -10px;
    right: 10px;
    background: #28a745;
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    z-index: 1;
}

.comparison-table .popular {
    border: 2px solid #007bff;
}

.comparison-table .popular:before {
    content: "Popüler";
    position: absolute;
    top: -10px;
    right: 10px;
    background: #007bff;
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    z-index: 1;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1024px) {
    .comparison-table {
        min-width: 500px;
        font-size: 13px;
    }
    
    .comparison-table thead th,
    .comparison-table tbody td {
        padding: 12px 10px;
    }
    
    .comparison-table img {
        max-width: 80px;
    }
    
    .comparison-table .current-price {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .dealfrance-comparison-table {
        margin: 20px -15px;
        border-radius: 0;
    }
    
    .comparison-table {
        min-width: 450px;
        font-size: 12px;
    }
    
    .comparison-table thead th,
    .comparison-table tbody td {
        padding: 10px 8px;
    }
    
    .comparison-table thead th h4 {
        font-size: 12px;
    }
    
    .comparison-table img {
        max-width: 60px;
        margin-bottom: 10px;
    }
    
    .comparison-table .buy-button {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .comparison-table li {
        font-size: 11px;
        margin-bottom: 6px;
    }
}

@media (max-width: 480px) {
    .comparison-table {
        min-width: 400px;
    }
    
    .comparison-table thead th,
    .comparison-table tbody td {
        padding: 8px 6px;
    }
    
    .comparison-table img {
        max-width: 50px;
    }
    
    .comparison-table .current-price {
        font-size: 14px;
    }
    
    .comparison-table .buy-button {
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* ==========================================================================
   Animation and Effects
   ========================================================================== */

.comparison-table {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comparison-table tbody tr {
    transition: all 0.2s ease;
}

.comparison-table .buy-button {
    position: relative;
    overflow: hidden;
}

.comparison-table .buy-button: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;
}

.comparison-table .buy-button:hover:before {
    left: 100%;
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .comparison-table {
        background: #1a1a1a;
        color: #fff;
    }
    
    .comparison-table tbody td:first-child {
        background: #2d2d2d;
        color: #fff;
    }
    
    .comparison-table tbody tr:nth-child(even) td:not(:first-child) {
        background: #262626;
    }
    
    .comparison-table tbody tr:hover td:not(:first-child) {
        background: #333333;
    }
    
    .comparison-table li {
        color: #cccccc;
    }
}
