/* ==========================================
   VS BATTLE - CLEAN VERSION (NO BUGS)
   ========================================== */

/* === SECTION === */
.comparatif-section {
    background: linear-gradient(180deg, #ffffff 0%, #f8f7ff 50%, #ffffff 100%);
    position: relative;
    overflow: hidden;
    padding: 120px 0;
}

.comparatif-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(139, 92, 246, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* === HEADER === */
.comparatif-section .section-header {
    margin-bottom: 80px;
    text-align: center;
}

.comparatif-section .section-badge {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* === GRID === */
.comparisons-grid {
    display: flex;
    flex-direction: column;
    gap: 50px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === CARD === */
.comparison-card {
    background: linear-gradient(145deg, rgba(30, 27, 75, 0.95), rgba(49, 46, 129, 0.9)); box-shadow: 0 10px 40px rgba(139, 92, 246, 0.15);
    border-radius: 24px;
    padding: 50px;
    position: relative;
    border: 1px solid rgba(139, 92, 246, 0.15);
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.comparison-card:hover {
    transform: translateY(-8px);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 20px 60px rgba(139, 92, 246, 0.15);
}

/* Logo in card */
.comparison-number {
    position: absolute;
    top: -30px;
    right: 30px;
    font-size: 0;
    width: 70px;
    height: 70px;
    background: url('../images/logo/logo-full.png') center/contain no-repeat;
    background-color: white;
    border-radius: 50%;
    border: 3px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
    z-index: 100;
}

/* Title */
.comparison-title {
    font-size: 26px;
    font-weight: 700;
    color: white;
    margin-bottom: 35px;
    text-align: center;
}

/* === CONTENT GRID === */
.comparison-content {
    display: grid;
    grid-template-columns: 1fr 100px 1fr;
    gap: 30px;
    align-items: stretch;
}

/* === SIDES === */
.comparison-side {
    padding: 30px;
    border-radius: 16px;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.comparison-side.bad {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.03));
    border: 2px solid rgba(239, 68, 68, 0.2);
}

.comparison-side.good {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.03));
    border: 2px solid rgba(16, 185, 129, 0.2);
}

/* Hover - sides clash together */
.comparison-card:hover .comparison-side.bad {
    transform: translateX(10px);
    box-shadow: -5px 0 30px rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.comparison-card:hover .comparison-side.good {
    transform: translateX(-10px);
    box-shadow: 5px 0 30px rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
}

/* Side headers */
.comparison-side h4 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(139, 92, 246, 0.1);
}

.comparison-side.bad h4 { color: #f87171; }
.comparison-side.good h4 { color: #34d399; }

/* === VS BADGE === */
.comparison-vs {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 900;
    color: white;
    align-self: center;
    justify-self: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
    animation: vsPulse 2s ease-in-out infinite;
}

@keyframes vsPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* Rotating border */
.comparison-vs::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1, #8b5cf6);
    border-radius: 50%;
    z-index: -1;
    animation: none;
}

@keyframes rotateBorder {
    to { transform: rotate(360deg); }
}

/* Glow */
.comparison-vs::after {
    content: '';
    position: absolute;
    inset: -15px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent 70%);
    border-radius: 50%;
    z-index: -2;
    animation: vsGlow 2s ease-in-out infinite;
}

@keyframes vsGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* VS hover shake */
.comparison-card:hover .comparison-vs {
    animation: vsShake 0.5s ease infinite;
}

@keyframes vsShake {
    0%, 100% { transform: scale(1.1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-8deg); }
    75% { transform: scale(1.1) rotate(8deg); }
}

/* === LIGHTNING === */
.comparison-content::before,
.comparison-content::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #fbbf24, transparent);
    transform: translateY(-50%);
    opacity: 0;
    z-index: 5;
}

.comparison-content::before { left: calc(50% - 110px); }
.comparison-content::after { right: calc(50% - 110px); }

.comparison-card:hover .comparison-content::before,
.comparison-card:hover .comparison-content::after {
    animation: lightning 0.8s ease-in-out infinite;
}

@keyframes lightning {
    0%, 40%, 60%, 100% { opacity: 0; }
    45%, 55% { opacity: 1; filter: drop-shadow(0 0 8px #fbbf24); }
}

/* === LISTS === */
.comparison-side ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.comparison-side ul li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(139, 92, 246, 0.05);
    font-size: 15px;
    line-height: 1.5;
    color: rgba(255,255,255,0.85);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.comparison-side ul li:hover {
    transform: translateX(5px);
    background: rgba(139, 92, 246, 0.03);
}

.comparison-side ul li:last-child { border-bottom: none; }

.comparison-side.bad ul li::before {
    content: '✗';
    color: #ef4444;
    font-weight: bold;
    font-size: 16px;
}

.comparison-side.good ul li::before {
    content: '✓';
    color: #10b981;
    font-weight: bold;
    font-size: 16px;
}

/* === COST === */
.comparison-cost {
    padding: 18px;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s ease;
}

.comparison-cost:hover { transform: scale(1.03); }

.comparison-cost.bad {
    background: rgba(239, 68, 68, 0.08);
    border: 2px solid rgba(239, 68, 68, 0.25);
}

.comparison-cost.good {
    background: rgba(16, 185, 129, 0.08);
    border: 2px solid rgba(16, 185, 129, 0.25);
}

.comparison-cost span {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.comparison-cost strong {
    font-size: 26px;
    font-weight: 800;
}

.comparison-cost.bad strong {
    color: #f87171;
    text-decoration: line-through;
}

.comparison-cost.good strong {
    color: #34d399;
    text-shadow: 0 0 20px rgba(52, 211, 153, 0.5);
}

/* === SAVINGS === */
.savings-summary {
    background: linear-gradient(145deg, rgba(30, 27, 75, 0.95), rgba(49, 46, 129, 0.9)); border: 2px solid rgba(139, 92, 246, 0.3);
    border: 2px solid rgba(139, 92, 246, 0.2);
    border-radius: 20px;
    padding: 45px;
    margin-top: 60px;
}

.savings-summary h3 {
    color: white;
    text-align: center;
    margin-bottom: 35px;
    font-size: 26px;
}

.saving-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 10px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.08);
    font-size: 16px;
    color: rgba(255,255,255,0.85);
    transition: all 0.3s ease;
    border-radius: 8px;
}

.saving-item:hover {
    background: rgba(139, 92, 246, 0.1);
    padding-left: 20px;
}

.saving-item strong { color: #34d399; font-size: 18px; }

.total-savings {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid rgba(139, 92, 246, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-savings strong {
    font-size: 38px;
    color: #34d399;
    animation: totalGlow 2s ease-in-out infinite;
}

@keyframes totalGlow {
    0%, 100% { text-shadow: 0 0 20px rgba(52, 211, 153, 0.4); }
    50% { text-shadow: 0 0 40px rgba(52, 211, 153, 0.8); }
}

/* === SCROLL ANIMATION === */
.comparison-card {
    opacity: 0;
    transform: translateY(30px);
}

.comparison-card.visible {
    animation: cardEnter 0.6s ease forwards;
}

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

.comparison-card.visible .comparison-side.bad {
    animation: sideEnterLeft 0.5s ease 0.2s forwards;
    opacity: 0;
    transform: translateX(-40px);
}

.comparison-card.visible .comparison-side.good {
    animation: sideEnterRight 0.5s ease 0.2s forwards;
    opacity: 0;
    transform: translateX(40px);
}

@keyframes sideEnterLeft {
    to { opacity: 1; transform: translateX(0); }
}

@keyframes sideEnterRight {
    to { opacity: 1; transform: translateX(0); }
}

.comparison-card.visible .comparison-vs {
    animation: vsEnter 0.4s ease 0.4s forwards;
    opacity: 0;
    transform: scale(0);
}

@keyframes vsEnter {
    0% { opacity: 0; transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .comparison-content {
        grid-template-columns: 1fr 60px 1fr;
        gap: 15px;
    }

    .comparison-vs {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    .comparison-side {
        padding: 15px;
    }

    .comparison-side h4 {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .comparison-side ul li {
        font-size: 12px;
        padding: 8px 0;
    }

    .comparison-cost strong {
        font-size: 18px;
    }

    .comparison-cost span {
        font-size: 10px;
    }

    .comparison-card:hover .comparison-side.bad,
    .comparison-card:hover .comparison-side.good {
        transform: translateX(5px);
    }

    .comparison-card:hover .comparison-side.good {
        transform: translateX(-5px);
    }

    .comparison-card { padding: 20px 15px; }

    .comparison-title {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .comparison-number {
        font-size: 50px;
        top: 10px;
        right: 15px;
    }
}

/* === CLASH EFFECTS === */
.comparison-card.visible .comparison-side.bad {
    animation: clashLeft 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
}

.comparison-card.visible .comparison-side.good {
    animation: clashRight 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
}

@keyframes clashLeft {
    0% { opacity: 0; transform: translateX(-80px); }
    60% { opacity: 1; transform: translateX(12px); }
    80% { transform: translateX(-5px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes clashRight {
    0% { opacity: 0; transform: translateX(80px); }
    60% { opacity: 1; transform: translateX(-12px); }
    80% { transform: translateX(5px); }
    100% { opacity: 1; transform: translateX(0); }
}

.comparison-card.visible .comparison-vs {
    animation: vsImpact 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s forwards;
    opacity: 0;
}

@keyframes vsImpact {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 1; transform: scale(1.3); }
    70% { transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

/* Shake after impact */
.comparison-card.visible {
    animation: cardEnter 0.6s ease forwards, cardShake 0.4s ease 0.5s;
}

@keyframes cardShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* === IMPROVED LIGHTNING === */
.comparison-content::before,
.comparison-content::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 80px;
    height: 6px;
    background: linear-gradient(90deg, transparent, #fbbf24, #fff, #fbbf24, transparent);
    transform: translateY(-50%);
    opacity: 0;
    z-index: 20;
    border-radius: 3px;
    filter: drop-shadow(0 0 15px #fbbf24) drop-shadow(0 0 30px #fbbf24);
}

.comparison-content::before { left: calc(50% - 130px); }
.comparison-content::after { right: calc(50% - 130px); }

.comparison-card:hover .comparison-content::before {
    animation: none 0.15s ease-in-out infinite;
}

.comparison-card:hover .comparison-content::after {
    animation: none 0.15s ease-in-out 0.08s infinite;
}

@keyframes lightningStrike {
    0%, 100% { opacity: 0; transform: translateY(-50%) scaleX(0.3); }
    50% { opacity: 1; transform: translateY(-50%) scaleX(1); }
}

/* Lightning bolts */
.comparison-card:hover .comparison-content::before,
.comparison-card:hover .comparison-content::after {
    box-shadow: 
        0 0 10px #fbbf24,
        0 0 20px #fbbf24,
        0 0 40px #f59e0b,
        0 -3px 8px rgba(255,255,255,0.8),
        0 3px 8px rgba(255,255,255,0.8);
}

/* Electric sparks around VS on hover */
.comparison-card:hover .comparison-vs::before {
    box-shadow: 
        0 0 20px rgba(139, 92, 246, 0.8),
        0 0 40px rgba(139, 92, 246, 0.4),
        inset 0 0 20px rgba(139, 92, 246, 0.1);
}

/* CRITICAL FIX: All feature titles and list items must be dark */
.feature-title,
.feature-title span,
.feature-title span:not(.highlight) {
    color: #0f172a !important;
}

.feature-list li strong {
    color: #0f172a !important;
}

/* Keep highlights colored */
.feature-title .highlight.orange { color: var(--orange) !important; }
.feature-title .highlight.green { color: var(--secondary) !important; }
.feature-title .highlight.purple { color: var(--purple) !important; }
.feature-title .highlight { color: var(--primary) !important; }

/* AGGRESSIVE FIX for all spans in feature titles */
.feature-title > span,
.feature-title span[data-i18n],
.feature-section .feature-title span:first-child {
    color: #0f172a !important;
}

/* Feature list strong items */
.feature-list li > strong,
.feature-list strong[data-i18n] {
    color: #0f172a !important;
}

/* ==========================================
   VS CAROUSEL - SHOW 1 CARD AT A TIME
   ========================================== */

.vs-carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 60px;
}

.vs-carousel {
    flex: 1;
    overflow: hidden !important;
    position: relative;
    width: 100%;
}

.vs-carousel .comparisons-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 30px;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 10px 0;
    width: max-content;
}

.vs-carousel .comparison-card {
    flex: 0 0 1050px !important;
    min-width: 1050px !important;
    max-width: 1050px !important;
    width: 1050px !important;
    box-sizing: border-box;
    padding: 18px 22px !important;
}

/* Hide the number */
.vs-carousel .comparison-card .comparison-number {
    display: none !important;
}

/* Reduce card internal spacing */
.vs-carousel .comparison-card .comparison-content {
    gap: 12px;
}

.vs-carousel .comparison-card .comparison-side {
    padding: 12px;
}

.vs-carousel .comparison-card .comparison-side ul {
    margin-bottom: 8px;
}

.vs-carousel .comparison-card .comparison-side ul li {
    padding: 5px 0;
    font-size: 13px;
}

.vs-carousel .comparison-card .comparison-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.vs-carousel .comparison-card .comparison-cost {
    padding: 10px;
}

.vs-carousel .comparison-card .comparison-cost strong {
    font-size: 1.2rem;
}

.vs-carousel .comparison-card .comparison-vs {
    width: 45px;
    height: 45px;
    font-size: 0.9rem;
}

/* Navigation Arrows */
.vs-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.vs-nav:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.vs-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.vs-nav-prev {
    left: 0;
}

.vs-nav-next {
    right: 0;
}

.vs-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: translateY(-50%) scale(1);
}

/* Carousel Dots */
.vs-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 40px;
}

.vs-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(102, 126, 234, 0.5);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.vs-dot:hover {
    border-color: #667eea;
    transform: scale(1.2);
}

.vs-dot.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
    transform: scale(1.3);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
}

/* Large screens */
@media (max-width: 1400px) {
    .vs-carousel .comparison-card {
        flex: 0 0 calc(100vw - 180px) !important;
        min-width: calc(100vw - 180px) !important;
        max-width: calc(100vw - 180px) !important;
        width: calc(100vw - 180px) !important;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .vs-carousel-container {
        padding: 0 50px;
    }

    .vs-carousel .comparison-card {
        flex: 0 0 calc(100vw - 130px) !important;
        min-width: calc(100vw - 130px) !important;
        width: calc(100vw - 130px) !important;
        max-width: calc(100vw - 130px) !important;
        padding: 20px !important;
    }

    .vs-carousel .comparison-card .comparison-content {
        flex-direction: column;
    }

    .vs-carousel .comparison-card .comparison-vs {
        margin: 15px 0;
    }

    .vs-nav {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .vs-carousel-container {
        padding: 0 40px;
    }

    .vs-carousel .comparison-card {
        flex: 0 0 calc(100vw - 100px) !important;
        min-width: calc(100vw - 100px) !important;
        width: calc(100vw - 100px) !important;
        max-width: calc(100vw - 100px) !important;
        padding: 15px !important;
    }

    .vs-carousel .comparison-card .comparison-title {
        font-size: 1.1rem;
    }

    .vs-carousel .comparison-card .comparison-number {
        font-size: 2rem;
    }

    .vs-nav {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .vs-carousel-dots {
        margin-top: 20px;
        gap: 6px;
    }

    .vs-dot {
        width: 8px;
        height: 8px;
    }
}
