/* ========== DASHBOARD SEQUENTIAL VISUAL ========== */

.dashboard-visual-wrapper {
    width: 100%;
    max-width: 1140px;
    margin: 40px auto 0;
    position: relative;
    z-index: 5;
}

.dashboard-device-frame {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow:
        0 30px 60px -12px rgba(0, 0, 0, 0.15),
        0 18px 36px -18px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

/* Browser-style Header */
.frame-browser-header {
    height: 44px;
    background: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.frame-dots {
    display: flex;
    gap: 8px;
}

.f-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.f-red {
    background: #ff5f56;
}

.f-yellow {
    background: #ffbd2e;
}

.f-green {
    background: #27c93f;
}

.frame-url {
    flex: 1;
    background: rgba(0, 0, 0, 0.04);
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #667085;
    font-family: var(--font-main);
}

/* Slider Logic */
.dashboard-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 6;
    /* Reduced height to ~80% of original 7.5 */
    min-height: 320px;
    max-height: 60vh;
    overflow: hidden;
    background: #fff;
    /* Changed from black to white to blend with dashboard */
}

.dashboard-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1), opacity 0.8s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Slide 1: Video (Active default) */
#slideVideo {
    transform: translateX(0);
    opacity: 1;
    z-index: 2;
    /* Fallback image while YouTube loads. Video covers this once ready. */
    background-image: url('../../img/img_chat.webp');
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
}

/* Slide 2: Canvas (Off-screen default) */
#slideCanvas {
    transform: translateX(100%);
    opacity: 0;
    z-index: 1;
    background: #fff;
}

/* Slide 3: Mobile Placeholder (Off-screen default) */
#slideMobile {
    transform: translateX(100%);
    opacity: 0;
    z-index: 1;
    background: #fff;
}

#slideMobile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* State: Slid to Canvas */
.dashboard-slider.slid #slideCanvas {
    transform: translateX(0);
    opacity: 1;
    z-index: 3;
}

/* State: Slid to Mobile Image */
.dashboard-slider.slid-mobile #slideVideo {
    transform: translateX(-100%);
    opacity: 0;
}

.dashboard-slider.slid-mobile #slideMobile {
    transform: translateX(0);
    opacity: 1;
    z-index: 3;
}

/* Elements Scaling */
.hero-video-visual {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

#slideVideo iframe {
    width: 100%;
    height: 175%;
    /* Increased height to allow for significant top offset */
    border: none;
    position: absolute;
    top: -60px;
    /* Shifted significantly higher to hide YT header/artifacts */
    left: 0;
    pointer-events: none;
    /* Prevent user from clicking/hovering to pause video */
}

.img-rounded-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Indicators */
.slider-indicators {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slid .slider-dot {
    background: rgba(0, 0, 0, 0.2);
}

.slider-dot.active {
    background: #375DFA !important;
    transform: scale(1.4);
}

/* RESPONSIVE */
@media (max-width: 768px) {

    /* Mobile-specific adjustments (spacing) */
    .dashboard-visual-wrapper {
        margin: 48px auto 0;
        padding: 0 16px;
    }

    .dashboard-device-frame {
        border-radius: 12px;
    }

    .frame-browser-header {
        height: 32px;
        padding: 0 12px;
    }
}

/* Force Video context for Mobile */
@media (max-width: 768px) {
    .dashboard-slider {
        aspect-ratio: 16 / 3.4;
        /* Thu ngắn thêm nữa theo yêu cầu */
        min-height: auto;
        height: auto;
    }

    #slideVideo iframe {
        height: 140%;
        /* Tăng độ phóng để phủ kín khung hình mỏng */
        top: -65px;
        /* Căn chỉnh lại vị trí để tập trung vào nội dung chính */
    }

    /* Lớp mask trắng để che dải đen phía dưới video */
    #slideVideo::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 32px; /* Tăng độ cao để che phủ dải đen tốt hơn */
        background: #fff;
        z-index: 5;
    }

    #slideMobile img {
        object-fit: cover;
        /* Lấp đầy toàn bộ khung hình, không để khoảng trắng */
        object-position: top;
    }
}