/* ═══════════════════════════════════════════════════════
   AI Dealer Wizard – Component Stylesheet
   ai-dealer-wizard.css
   ═══════════════════════════════════════════════════════ */

/* ── Section wrapper ───────────────────────────────────── */
.aidw-section {
    position: relative;
    background: #0f172a;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(37, 99, 235, 0.15);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.aidw-section::before {
    content: '';
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 300px;
    background: radial-gradient(ellipse, rgba(37, 99, 235, 0.18) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ── Header bar ────────────────────────────────────────── */
.aidw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(135deg, #111827, #1e293b);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 2;
}

.aidw-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.35);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 10px;
    font-weight: 700;
    color: #60a5fa;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.aidw-badge-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: aidwPulse 2s ease-in-out infinite;
}

@keyframes aidwPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    50%       { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
}

.aidw-header-stats {
    display: flex;
    gap: 16px;
}

.aidw-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.aidw-stat-value {
    font-size: 13px;
    font-weight: 800;
    color: #60a5fa;
    line-height: 1;
}

.aidw-stat-label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}

/* ── Main body grid ────────────────────────────────────── */
.aidw-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    position: relative;
    z-index: 1;
}

/* ── LEFT — Before/After Slider ────────────────────────── */
.aidw-slider-panel {
    position: relative;
    background: #0f172a;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.aidw-slider-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px 6px;
}

.aidw-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 4px;
}

.aidw-label-before {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.aidw-label-after {
    background: rgba(37, 99, 235, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(37, 99, 235, 0.4);
}

/* Slider container */
.aidw-comparison {
    position: relative;
    width: 100%;
    height: 264px;
    overflow: hidden;
    cursor: col-resize;
    user-select: none;
    touch-action: none;
}

/* BEFORE image */
.aidw-before {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.2) 100%),
        url('/img/products/car-before.webp') center / cover no-repeat;
    /* Fallback gradient that mimics a dull lot photo */
    background-color: #1c2433;
    filter: saturate(0.6) brightness(0.75) contrast(0.9);
}



/* AFTER image – only the revealed portion shows */
.aidw-after {
    position: absolute;
    inset: 0;
    background:
        url('/img/products/car-after.webp') center / cover no-repeat;
    /* Fallback: bright enhanced look */
    background-color: #1e293b;
    clip-path: inset(0 50% 0 0);
    filter: saturate(1.25) brightness(1.1) contrast(1.05);
    transition: clip-path 0s;
}



/* Dealer branding overlay (AFTER side) */
.aidw-branding-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(37, 99, 235, 0.9);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.aidw-comparison.revealed .aidw-branding-overlay {
    opacity: 1;
}

/* Glow behind AFTER side */
.aidw-after-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 75% 50%, rgba(37, 99, 235, 0.12) 0%, transparent 65%);
    pointer-events: none;
    z-index: 3;
}

/* Divider handle */
.aidw-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(-50%);
    z-index: 10;
    cursor: col-resize;
}

.aidw-handle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 20px;
    background: radial-gradient(ellipse, rgba(37, 99, 235, 0.35) 0%, transparent 70%);
    pointer-events: none;
}

.aidw-handle-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #2563eb, #60a5fa);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.3), 0 4px 16px rgba(37, 99, 235, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    animation: aidwKnobPulse 2.5s ease-in-out 1s 2;
}

@keyframes aidwKnobPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.3), 0 4px 16px rgba(37, 99, 235, 0.5); }
    50%       { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0), 0 4px 24px rgba(37, 99, 235, 0.8); }
}

.aidw-handle-arrows {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    color: #fff;
    pointer-events: none;
}

/* Drag hint */
.aidw-drag-hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    z-index: 12;
    transition: opacity 0.4s;
}

.aidw-comparison.dragging .aidw-drag-hint,
.aidw-comparison.interacted .aidw-drag-hint {
    opacity: 0;
}

/* AI metrics strip */
.aidw-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.aidw-metric {
    padding: 10px 12px;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.aidw-metric:last-child {
    border-right: none;
}

.aidw-metric-value {
    font-size: 15px;
    font-weight: 800;
    color: #60a5fa;
    line-height: 1;
}

.aidw-metric-label {
    font-size: 8.5px;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 3px;
}

/* ── RIGHT — Video + Features ──────────────────────────── */
.aidw-right-panel {
    display: flex;
    flex-direction: column;
    background: #111827;
}

/* Video preview */
.aidw-video-wrap {
    position: relative;
    width: 100%;
    height: 154px;
    background: #0f172a;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.aidw-video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 2;
}

.aidw-video-wrap video[data-playing] ~ .aidw-play-btn {
    display: none;
}

/* Play button overlay */
.aidw-play-btn {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.3s;
}

.aidw-play-btn i {
    width: 52px;
    height: 52px;
    background: rgba(37, 99, 235, 0.85);
    backdrop-filter: blur(6px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.25), 0 4px 20px rgba(0,0,0,0.4);
    transition: transform 0.2s, background 0.2s;
    pointer-events: none;
}

.aidw-play-label {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    pointer-events: none;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.aidw-play-btn:hover i {
    transform: scale(1.12);
    background: rgba(37, 99, 235, 1);
}

.aidw-video-label {
    position: absolute;
    top: 8px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 9px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 5px;
}

.aidw-rec-dot {
    width: 6px;
    height: 6px;
    background: #ef4444;
    border-radius: 50%;
    animation: aidwRec 1.2s ease-in-out infinite;
}

@keyframes aidwRec {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Features list */
.aidw-features {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    flex: 1;
}

.aidw-feature-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

.aidw-feature-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #60a5fa;
    flex-shrink: 0;
}

.aidw-feature-text { flex: 1; min-width: 0; }

.aidw-feature-title {
    font-size: 10.5px;
    font-weight: 700;
    color: #e2e8f0;
    line-height: 1.2;
}

.aidw-feature-desc {
    font-size: 9.5px;
    color: rgba(255, 255, 255, 0.38);
    margin-top: 2px;
    line-height: 1.3;
}

/* CTA */
.aidw-cta {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.aidw-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 9px 16px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: filter 0.2s, transform 0.2s;
    animation: aidwCtaGlow 3s ease-in-out infinite;
}

.aidw-cta-btn:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
    color: #fff;
}

@keyframes aidwCtaGlow {
    0%, 100% { box-shadow: 0 4px 18px rgba(37, 99, 235, 0.4); }
    50%       { box-shadow: 0 4px 30px rgba(37, 99, 235, 0.7); }
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
    .aidw-body {
        grid-template-columns: 1fr;
    }

    .aidw-slider-panel {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .aidw-comparison {
        height: 192px;
    }

    .aidw-header-stats {
        gap: 10px;
    }
}

/* ── Video Modal ───────────────────────────────────────── */
.aidw-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.aidw-modal[hidden] {
    display: none;
}

.aidw-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    cursor: pointer;
}

.aidw-modal-box {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: #111827;
    border-radius: 16px;
    border: 1px solid rgba(37, 99, 235, 0.25);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(37, 99, 235, 0.1);
    overflow: hidden;
    animation: aidwModalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes aidwModalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.aidw-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #1e2d4a, #1a2540);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.aidw-modal-title {
    font-size: 13px;
    font-weight: 700;
    color: #e2e8f0;
}

.aidw-modal-title i {
    color: #60a5fa;
}

.aidw-modal-close {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.aidw-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.aidw-modal-body {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    max-height: 75vh;
    background: #000;
    margin: 0 auto;
}

.aidw-modal-body iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: none;
}

/* ── Reduced motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .aidw-badge-dot,
    .aidw-handle-knob,
    .aidw-cta-btn,
    .aidw-rec-dot {
        animation: none;
    }
}
