/* --- RESET & BASIC SETUP --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #000;
    color: #fff;
    overflow: hidden; 
    height: 100dvh; 
    width: 100vw;
}

/* --- CONTAINER --- */
.story-container {
    width: 100%;
    height: 100dvh; 
    max-width: 550px; 
    margin: 0 auto;
    position: relative;
    background: #000;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
}

/* --- SCROLL WRAPPER --- */
.slides-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: hidden; 
    overflow-y: hidden;
    scroll-behavior: smooth;
}

/* --- SLIDE SETUP --- */
.slide {
    flex: 0 0 100%; 
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Ảnh nền chung */
.slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; 
    z-index: 1;
    transition: opacity 1s ease-in-out;
}

/* Logic cho Slide 2 (Nhiều ảnh) */
.sub-slide-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}
.sub-bg {
    opacity: 0; /* Mặc định ẩn */
    position: absolute;
    top: 0; 
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 1.5s ease; /* Transition mượt hơn */
}
.sub-bg.active-sub {
    opacity: 1; /* Hiện khi được active */
}

/* --- DARK OVERLAY & GRADIENT --- */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Gradient đậm hơn ở dưới đáy để làm nền cho chữ */
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.95) 100%);
    z-index: 2;
    pointer-events: none; 
}

/* --- CONTENT BOX (CHUNG CHO CÁC SLIDE THƯỜNG) --- */
.content {
    position: absolute;
    bottom: 40px; 
    left: 50%;
    transform: translateX(-50%);
    width: 92%; 
    max-height: 50%; 
    overflow-y: auto; 
    z-index: 3;
    
    /* Trong suốt hoàn toàn (mặc định cho các slide sau) */
    background: transparent; 
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 10px;
    border: none;
    box-shadow: none;
    
    /* Animation */
    opacity: 0;
    transform: translate(-50%, 30px);
    transition: all 0.8s ease-out 0.3s;
    
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Khi slide active thì hiện content */
.slide.active .content {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* --- CUSTOM STYLE QUAN TRỌNG CHO SLIDE 0 (INTRO) --- */
#slide-0 .content {
    bottom: auto;
    top: 50%; /* Đưa về giữa theo chiều dọc */
    transform: translate(-50%, -40%); 
    
    width: 90%;
    max-height: 90vh; 
    overflow-y: hidden; 
    
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

#slide-0.active .content {
    opacity: 1;
    transform: translate(-50%, -50%) !important; 
}

#slide-0 p {
    text-align: justify;
    margin-bottom: 15px;
    font-size: 16px;
}
#slide-0 h2 {
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.4); 
    text-shadow: none; 
    color: #fca311;
}

/* --- TYPOGRAPHY --- */
.vingroup-logo {
    width: 60px;
    margin-bottom: 15px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}

h2 {
    font-size: 22px; 
    line-height: 1.35;
    margin-bottom: 15px;
    text-transform: uppercase;
    font-weight: 800;
    color: #fca311; 
    text-align: center;
    text-shadow: 2px 2px 4px #000, 0 0 10px rgba(0,0,0,0.8);
    width: 100%;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.3);
}

p {
    font-size: 16px;
    line-height: 1.55;
    color: #fff;
    text-align: justify; 
    font-weight: 500; 
    margin-bottom: 12px;
    text-shadow: 1px 1px 2px #000, 0 0 5px rgba(0,0,0,0.9);
}
p:last-child { margin-bottom: 0; }

/* --- PROGRESS BAR --- */
.progress-container {
    position: absolute;
    top: 15px; 
    left: 15px;
    right: 15px;
    display: flex;
    gap: 4px;
    z-index: 10;
}
.progress-item {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: #fca311;
    transition: width 0.3s linear;
}
.progress-item.active .progress-fill {
    width: 100%;
    transition: width 10s linear; 
}
.progress-item.completed .progress-fill { width: 100%; transition: none; }
.progress-item.paused .progress-fill { transition-play-state: paused; }

/* --- CONTROLS --- */
.top-controls {
    position: absolute;
    top: 30px;
    right: 15px;
    z-index: 20;
    display: flex;
    gap: 15px;
}
.control-btn {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.control-btn:hover {
    background: #fca311;
    border-color: #fca311;
    color: #000;
}

/* --- NAVIGATION ARROWS --- */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.7);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s;
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.nav-btn:hover {
    background: rgba(252, 163, 17, 0.8);
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}
.nav-prev { left: 10px; }
.nav-next { right: 10px; }

/* --- RESPONSIVE --- */
@media (min-width: 768px) {
    h2 { font-size: 26px; }
    p { font-size: 17px; }
    .content { padding: 20px; bottom: 60px; }
    #slide-0 .content {
        padding: 40px;
        max-width: 80%;
    }
}