@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&display=swap');

:root {
    --primary: #0d9488;       /* Màu Teal hiện đại */
    --primary-light: #ccfbf1;
    --primary-dark: #0f766e;
    --bg-body: #f8fafc;       /* Nền xám xanh cực nhạt */
    --surface: #ffffff;
    --text-main: #1e293b;     /* Chữ màu đen slate sang trọng */
    --text-muted: #64748b;
    --radius-lg: 24px;
    --radius-md: 16px;
    --shadow-soft: 0 20px 40px -15px rgba(0,0,0,0.05);
    --shadow-hover: 0 25px 50px -12px rgba(13, 148, 136, 0.15);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    width: 100vw; /* Ép chiều rộng đúng bằng 100% màn hình hiển thị */
    max-width: 100%;
    overflow-x: hidden !important; /* Lệnh thép: Cắt bỏ mọi thứ tràn ra chiều ngang */
    box-sizing: border-box; /* Đảm bảo padding không làm tăng kích thước */
}
body {
    /* Đổi màu nền hơi ngả xanh ngọc nhạt cho dịu mắt */
    background-color: #f8fbfa; 
    /* Tạo họa tiết chấm bi mờ */
    background-image: radial-gradient(#d1e8e6 2px, transparent 2px);
    background-size: 30px 30px;
}
img { max-width: 100%; display: block; }

/* --- 1. HEADER ẢNH NỀN LÀM MỜ --- */
header { 
    position: relative;
    color: white; 
    padding: 5rem 15px 4rem; 
    text-align: center; 
    overflow: hidden; /* Giữ phần mờ không tràn ra ngoài */
    z-index: 1;
}

header::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    /* Bạn có thể thay link ảnh dưới đây bằng link ảnh trường mà bạn thích nhất */
    background-image: url('https://i.postimg.cc/QxTqFwHB/166d3dda-316a-4ff6-8b25-dff9bae28292.jpg'); 
    background-size: cover;
    background-position: center;
    /* Hiệu ứng làm mờ (blur) và làm tối (brightness) để chữ trắng nổi bật lên */
    filter: blur(8px) brightness(0.65); 
    z-index: -1;
    transform: scale(1.05); /* Phóng to nhẹ để giấu phần viền bị lem do hiệu ứng mờ */
}

header h1 { 
    margin: 0; 
    font-size: 3rem; 
    font-weight: 800; 
    letter-spacing: -1px; 
    text-shadow: 0 4px 20px rgba(0,0,0,0.5); /* Tăng bóng đổ để chữ sắc nét hơn trên nền ảnh */
}

header p { 
    margin-top: 10px; 
    font-size: 1.2rem; 
    opacity: 0.95; 
    font-weight: 500; 
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
/* --- 2. FLOATING GLASS NAV (BẢN LÀM LẠI HOÀN TOÀN) --- */
nav { 
    background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.5);
    display: flex; justify-content: center; 
    padding: 10px 15px; gap: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    position: sticky; top: 20px; z-index: 1000;
    width: max-content; max-width: 95%;
    margin: -30px auto 40px; border-radius: 50px;
    position: relative; /* Bắt buộc để làm mốc cho cục trượt */
}

/* ÉP TẤT CẢ CÁC THẺ A PHẢI TRONG SUỐT VÀ XÓA MỌI ĐỊNH DẠNG CŨ */
nav a { 
    text-decoration: none !important; 
    padding: 12px 24px !important; 
    font-weight: 600 !important; 
    font-size: 0.95rem !important;
    border-radius: 50px !important; 
    position: relative !important;
    z-index: 2 !important; /* Chữ phải nổi lên trên */
    transition: color 0.3s ease !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* CỤC HIGHLIGHT TRƯỢT (NỀN XANH) */
.nav-indicator {
    position: absolute;
    top: 10px; left: 0;
    height: calc(100% - 20px);
    background: var(--primary); /* Màu xanh Teal */
    border-radius: 50px;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1; /* Nằm dưới chữ */
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
    pointer-events: none; /* Tránh cản trở khi bấm chuột */
}

nav a { 
    color: var(--text-muted); 
    text-decoration: none; 
    padding: 12px 24px; 
    font-weight: 600; 
    font-size: 0.95rem;
    transition: color 0.3s ease; /* Chỉ làm mượt màu chữ, bỏ làm mượt nền */
    border-radius: 50px; 
    position: relative;
    z-index: 2; /* Chữ phải nổi lên trên cục highlight */
}

/* Xóa màu nền cứng của thẻ hover/active cũ */
nav a:hover, nav a.active, nav a[style*="background-color"] { 
    background: transparent !important; 
    color: white !important; 
    box-shadow: none !important;
}

/* KHỐI HIGHLIGHT TRƯỢT (MAGIC PILL) */
.nav-indicator {
    position: absolute;
    top: 10px; /* Bằng với padding-top của thẻ nav */
    left: 0;
    height: calc(100% - 20px); /* Kích thước trừ đi padding trên/dưới */
    background: var(--primary);
    border-radius: 50px;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); /* Gia tốc trượt mượt như bơ */
    z-index: 1; /* Nằm dưới chữ */
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
    pointer-events: none; /* Không cản tương tác chuột */
}

/* --- 3. BỐ CỤC & TIÊU ĐỀ SẠCH SẼ (XÓA VẠCH DỌC) --- */
.container { max-width: 1200px; margin: 0 auto 60px; padding: 0 20px; }

/* Sạch sẽ hoàn toàn tiêu đề */
h2 { 
    color: var(--text-main); 
    text-align: center; 
    font-weight: 800; 
    font-size: 2rem; 
    margin: 50px 0 30px; 
    border: none !important; /* Đảm bảo không bao giờ có vạch dọc */
    padding: 0 !important;
}

.main-layout { display: flex; gap: 40px; align-items: flex-start; }
.content { flex: 3; min-width: 0; } 
.sidebar { flex: 1; min-width: 0; position: sticky; top: 100px; }

/* --- 4. CARDS (THẺ) MỀM MẠI, NỔI 3D --- */
.card, .widget, .bgh-card, .gv-card { 
    background: var(--surface); 
    padding: 30px; 
    border-radius: var(--radius-lg); 
    box-shadow: var(--shadow-soft); 
    margin-bottom: 30px; 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(226, 232, 240, 0.8);
}
.card:hover, .bgh-card:hover, .gv-card:hover { 
    transform: translateY(-8px); 
    box-shadow: var(--shadow-hover); 
    border-color: rgba(13, 148, 136, 0.3);
}
.card p { line-height: 1.8; font-size: 1.05rem; color: var(--text-muted); }

/* Widget Sidebar */
.widget { padding: 25px; border-top: 6px solid var(--primary); }
.widget h3 { color: var(--text-main); margin-top: 0; border-bottom: 2px dashed #e2e8f0; padding-bottom: 15px; font-weight: 800; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget ul li { padding: 15px 0; border-bottom: 1px solid #f1f5f9; }
.widget ul li:last-child { border-bottom: none; padding-bottom: 0; }
.widget ul li a { text-decoration: none; color: var(--text-muted); font-weight: 600; transition: 0.3s; display: block; }
.widget ul li a:hover { color: var(--primary); transform: translateX(5px); }

/* --- 5. NÚT BẤM VÀ ẢNH --- */
.btn-link { 
    display: inline-block; 
    background: var(--primary); 
    color: white; 
    padding: 14px 30px; 
    text-decoration: none; 
    border-radius: 50px; 
    font-weight: 700; 
    box-shadow: 0 10px 20px rgba(13, 148, 136, 0.2); 
    transition: 0.3s; 
}
.btn-link:hover { background: var(--primary-dark); transform: translateY(-3px); box-shadow: 0 15px 25px rgba(13, 148, 136, 0.3); }

.school-image { width: 100%; height: 400px; object-fit: cover; border-radius: var(--radius-md); margin-top: 20px; transition: 0.5s; }
.school-image:hover { transform: scale(1.02); }

/* Lưới ảnh */
.image-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 25px; margin-top: 20px; }
.image-grid img { width: 100%; height: 300px; object-fit: cover; border-radius: var(--radius-md); transition: 0.4s; cursor: pointer; }
.image-grid img:hover { transform: scale(1.03); }

/* --- 6. CAROUSEL TRƯỢT MƯỢT MÀ --- */
.carousel-wrapper { position: relative; width: 100%; margin-top: 25px; }
.carousel-container { width: 100%; overflow: hidden; border-radius: var(--radius-md); }
.carousel-slide { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.carousel-slide::-webkit-scrollbar { display: none; }
.carousel-slide img { flex: 0 0 100%; width: 100%; height: 450px; object-fit: cover; border-radius: var(--radius-md); scroll-snap-align: center; }

.slider-btn { 
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%); 
    background: rgba(255,255,255,0.9); 
    backdrop-filter: blur(5px); 
    color: var(--primary-dark); 
    border: none; 
    width: 45px; 
    height: 45px; 
    border-radius: 50%; 
    font-size: 20px; 
    cursor: pointer; 
    z-index: 10; 
    
    /* CHỈ CẦN BỎ !important Ở DÒNG NÀY: */
    display: flex; 
    
    align-items: center !important; 
    justify-content: center !important; 
    padding: 0 !important; 
    margin: 0 !important;
    line-height: 1 !important; 
    
    box-shadow: 0 4px 10px rgba(0,0,0,0.15); 
    transition: 0.3s; 
}
.slider-btn:hover { background: var(--primary); color: white; transform: translateY(-50%) scale(1.1); }
.left-btn { left: 20px; } .right-btn { right: 20px; }

/* --- 7. TỐI ƯU MOBILE --- */
@media (max-width: 900px) {
    header { padding: 4rem 15px 3rem; }
    header h1 { font-size: 2.2rem; }
    
    /* SỬA LỖI MENU TRÊN ĐIỆN THOẠI Ở ĐÂY */
    nav { 
        max-width: 95%; 
        flex-wrap: nowrap !important; /* Ép tuyệt đối không cho rớt dòng */
        overflow-x: auto; /* Cho phép dùng tay vuốt ngang */
        -webkit-overflow-scrolling: touch; /* Vuốt mượt mà trên iPhone */
        justify-content: flex-start; /* Vuốt từ trái sang phải */
        border-radius: 50px; 
        padding: 8px 10px; /* Thu nhỏ viền menu lại một chút */
        scroll-behavior: smooth;
    }
    
    /* Giấu thanh cuộn ngang đi cho menu đẹp và gọn */
    nav::-webkit-scrollbar { display: none; }
    
    nav a {
        white-space: nowrap; /* Ép chữ trong nút không bị gãy dòng */
        padding: 10px 18px; /* Thu nhỏ nút bấm cho vừa ngón tay */
        font-size: 0.9rem;
    }

    /* Điều chỉnh lại cục highlight trượt cho khớp với padding mới */
    .nav-indicator {
        top: 8px; 
        height: calc(100% - 16px);
    }

    /* Tối ưu các phần khác */
    .main-layout { flex-direction: column; }
    .image-grid { grid-template-columns: 1fr; }
    .school-image, .image-grid img, .carousel-slide img { height: 280px; }
    .sidebar { position: static; }
}
/* =========================================================
   BẢN VÁ LỖI GIAO DIỆN ĐIỆN THOẠI (CHỐNG TRÀN & VỠ MENU)
   ========================================================= */

/* 1. Khóa chặt chiều ngang, ép các chữ quá dài phải bẻ dòng */
html, body {
    max-width: 100vw;
    overflow-x: hidden !important;
    overflow-wrap: break-word; 
}

/* 2. Sắp xếp lại toàn bộ tỷ lệ cho Mobile */
/* --- 7. TỐI ƯU MOBILE (BẢN GIA CỐ CHỐNG TRÀN VIỀN) --- */
/* =========================================================
   BẢN VÁ LỖI TRÀN VIỀN ĐIỆN THOẠI TUYỆT ĐỐI (CẬP NHẬT CUỐI)
   ========================================================= */

/* 1. Ép body vừa khít 100% màn hình, cấm tuyệt đối dùng 100vw */
html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

@media (max-width: 900px) {
    /* 2. Ép tất cả các khối (container, card, section) thụt lề an toàn */
    .container, .main-layout, section, header {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .container {
        padding: 0 10px !important; /* Rút bớt lề ngoài để có không gian */
    }

    .card, .widget {
        width: 100% !important;
        max-width: 100% !important;
        padding: 15px !important; /* Thu nhỏ lề trong của khung trắng */
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 15px !important;
        box-sizing: border-box !important;
    }

    /* 3. Ép chữ tự động xuống dòng, không được chọc thủng viền */
    h1, h2, h3, h4, p, span, div {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        max-width: 100% !important;
    }

    /* Thu nhỏ bớt chữ tiêu đề trên điện thoại để vừa khung */
    h2 { font-size: 1.6rem !important; }
    .class-name-title { font-size: 2.2rem !important; letter-spacing: 1px !important; }
    .main-slogan-text { font-size: 1.3rem !important; }

    /* 4. Sửa Menu (Dạng thanh vuốt ngang mượt mà) */
    nav {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        justify-content: flex-start !important;
        padding: 10px !important;
        width: 95% !important;
        margin: 0 auto 20px !important;
        box-sizing: border-box !important;
    }
    nav a { white-space: nowrap !important; }
    nav::-webkit-scrollbar { display: none !important; }

    /* 5. Giữ ảnh và Slider (Carousel) không bị đẩy viền */
    .carousel-wrapper, .carousel-container {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    img, .carousel-slide img, .school-image {
        max-width: 100% !important;
        height: auto !important;
        object-fit: cover !important;
    }

    /* Đặt lại chiều cao ảnh cho gọn trên mobile */
    .carousel-slide img, .school-image { height: 220px !important; }

    /* Điều chỉnh nút bấm slider chui hẳn vào trong ảnh */
    .slider-btn { width: 35px !important; height: 35px !important; font-size: 16px !important; }
    .left-btn { left: 10px !important; }
    .right-btn { right: 10px !important; }
}
/* =========================================================
   BẢN VÁ LỖI FONT CHỮ MÁY TÍNH (ÉP QUICKSAND MAX 700)
   ========================================================= */
h1, h2, h3, h4, .class-name-title, .main-slogan-text, .slogan-badge {
    font-family: 'Quicksand', sans-serif !important;
    font-weight: 700 !important; /* Ép về độ đậm an toàn nhất của Quicksand */
}
/* =========================================================
   THIẾT KẾ PHẦN KỶ NIỆM (NEW SECTIONS)
   ========================================================= */

/* Lưới ảnh thông minh: Tự động chia cột tùy kích thước màn hình */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); /* Cực kỳ mượt trên Mobile & Desktop */
    gap: 25px;
    padding: 10px 0;
}

/* Thẻ kỷ niệm bo tròn, bóng đổ, hiệu ứng hover nhẹ nhàng */
.memory-card {
    background: white;
    border-radius: 25px; /* Bo tròn mạnh mẽ đúng style của bạn */
    overflow: hidden; /* Không cho ảnh phình ra ngoài viền bo */
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); /* Bóng đổ mờ siêu nhẹ */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.03); /* Viền mảnh siêu tinh tế */
}

/* Hiệu ứng khi di chuột vào thẻ */
.memory-card:hover {
    transform: translateY(-8px); /* Nhấc thẻ lên cao một chút */
    box-shadow: 0 15px 40px rgba(0,0,0,0.1); /* Tăng độ sâu bóng đổ */
}

/* Thiết kế ảnh kỷ niệm (Chiếm 100% chiều ngang, cao cố định để gọn gàng) */
.memory-img {
    width: 100%;
    height: 240px; /* Độ cao lý tưởng cho ảnh trên cả Desktop & Mobile */
    object-fit: cover; /* Ép ảnh tự cắt để vừa khít khung, không bị méo */
    transition: transform 0.5s ease;
}

/* Hiệu ứng phóng to ảnh khi hover vào thẻ */
.memory-card:hover .memory-img {
    transform: scale(1.03); /* Phóng to nhẹ ảnh bên trong */
}

/* Phần chi tiết chú thích bên dưới ảnh */
.memory-details {
    padding: 25px;
}

/* Tiêu đề kỷ niệm */
.memory-details h4 {
    margin: 0 0 8px 0;
    color: var(--primary-dark);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Ngày tháng kỷ niệm */
.memory-date {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
    font-style: italic;
    opacity: 0.8;
}

/* Nội dung chú thích */
.memory-desc {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6; /* Giúp đoạn văn dễ đọc hơn */
}

/* Tối ưu Mobile cho phần Kỷ niệm */
@media (max-width: 600px) {
    .memory-grid {
        grid-template-columns: 1fr; /* 1 cột trên điện thoại nhỏ */
        gap: 15px;
    }
    .memory-img {
        height: 200px; /* Thu nhỏ bớt chiều cao ảnh trên Mobile */
    }
    .memory-card {
        border-radius: 20px; /* Thu nhỏ độ bo tròn */
    }
}
