﻿:root {
    --primary-gold: #ffc107;
    --dark-gold: #c2aa45; /* Tông vàng sẫm hơn một chút cho hiệu ứng hover */
    --light-gold: #fbf8e8; /* Tông vàng rất nhạt dùng cho background nhẹ */
    --primary-blue: #152b65; /* Màu xanh chủ đạo */
    --soft-bg: #f4f6fa; /* Nền sáng thiên sắc xanh nhẹ */
    --text-dark: #152b65; /* Màu chữ chính tông xanh đậm */
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text-dark);
    background-color: var(--soft-bg);
    overflow-x: hidden;
    margin: 0;
}

h1, h2, h3, h4, h5, .navbar-brand {
    font-family: 'Montserrat', sans-serif;
}

img {
    max-width: 100%;
    height: auto;
}

/* Utility */
.section-title {
    position: relative;
    margin-bottom: clamp(1.75rem, 3.5vw, 2.5rem);
    text-align: center;
    color: var(--primary-blue);
    font-size: clamp(1.35rem, 2.4vw, 2rem);
}

    .section-title::after {
        content: '';
        display: block;
        width: 60px;
        height: 3px;
        background: var(--primary-gold);
        margin: 10px auto 0;
        border-radius: 2px;
    }

.btn-gold {
    background-color: var(--primary-gold);
    color: #ffffff;
    font-weight: 600;
    border-radius: 25px;
    padding: 10px 24px;
    border: none;
    transition: all 0.3s ease;
    display: inline-block;
}

    .btn-gold:hover {
        background-color: var(--dark-gold);
        color: #ffffff;
        box-shadow: 0 4px 12px rgba(218, 195, 93, 0.35);
    }

/* Top Bar & Nav */
.top-bar {
    background-color: #0d1b40;
    color: #e0e6f5;
    font-size: clamp(0.75rem, 1.1vw, 0.875rem);
}

.navbar {
    position: sticky !important;
    top: 0;
    z-index: 1030;
}

    .navbar.sticky-top {
        top: 0;
        left: 0;
        width: 100%;
        z-index: 9999;
    }

.navbar-light .navbar-nav .nav-link {
    color: var(--primary-gold);
    font-weight: 600;
    padding: 0.5rem 1rem;
}

    .navbar-light .navbar-nav .nav-link:hover {
        color: var(--dark-gold);
    }

/* ===================================================
   MATHLINKS FULL WIDTH IMAGE-ONLY BANNER
   =================================================== */
.mathlinks-hero-img {
    width: 100%;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

    .mathlinks-hero-img .hero-img {
        width: 100%;
        height: clamp(220px, 52vw, 620px);
        object-fit: cover;
        object-position: center;
        display: block;
    }

    .mathlinks-hero-img .carousel-indicators [data-bs-target] {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background-color: #ffffff;
        opacity: 0.6;
        margin: 0 5px;
    }

    .mathlinks-hero-img .carousel-indicators .active {
        opacity: 1;
        background-color: #ffc107;
        width: 24px;
        border-radius: 10px;
    }

/* Stats Counter Bar */
.stat-card {
    background: #ffffff;
    border-bottom: 3px solid var(--primary-gold);
    border-radius: 12px;
    padding: clamp(14px, 2vw, 20px);
    box-shadow: 0 4px 15px rgba(21, 43, 101, 0.06);
    height: 100%;
}

.stat-number {
    font-size: clamp(1.5rem, 2.8vw, 2.2rem);
    font-weight: 800;
    color: var(--primary-blue);
    line-height: 1.2;
}

/* Feature Cards */
.feature-card {
    background: #ffffff;
    border-radius: 12px;
    padding: clamp(18px, 2.5vw, 28px);
    box-shadow: 0 10px 30px rgba(21, 43, 101, 0.08);
    border-top: 4px solid var(--primary-gold);
    transition: transform 0.3s ease;
    height: 100%;
}

    .feature-card:hover {
        transform: translateY(-5px);
    }

.icon-box {
    width: clamp(48px, 5vw, 60px);
    height: clamp(48px, 5vw, 60px);
    background-color: var(--primary-blue);
    color: var(--primary-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(18px, 2vw, 24px);
    margin-bottom: 16px;
}

/* Gallery Overlay */
.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(21, 43, 101, 0.1);
}

    .gallery-item img {
        width: 100%;
        height: clamp(180px, 22vw, 260px);
        object-fit: cover;
        transition: transform 0.4s ease;
        display: block;
    }

    .gallery-item:hover img {
        transform: scale(1.08);
    }

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(21, 43, 101, 0.9), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: clamp(12px, 2vw, 20px);
    color: #fff;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* Teacher Cards (đã gộp bản trùng và căn đều chiều cao theo thẻ dài nhất) */
.teacher-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(21, 43, 101, 0.06);
    padding: clamp(18px, 2.2vw, 24px) clamp(12px, 1.5vw, 16px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

    .teacher-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 28px rgba(21, 43, 101, 0.1);
    }

.teacher-img {
    width: clamp(130px, 16vw, 210px);
    height: clamp(130px, 16vw, 210px);
    max-width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* Course Cards */
.course-card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(21, 43, 101, 0.06);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

    .course-card:hover {
        box-shadow: 0 10px 30px rgba(21, 43, 101, 0.15);
    }

.course-img {
    width: 100%;
    height: clamp(160px, 18vw, 210px);
    object-fit: cover;
    display: block;
}

/* Footer */
footer {
    background-color: var(--primary-blue);
    color: #d0d7ea;
}

    footer h5 {
        color: var(--primary-gold);
    }

    footer a {
        color: #d0d7ea;
        text-decoration: none;
    }

        footer a:hover {
            color: var(--primary-gold);
        }

/* ===================================================
   RESPONSIVE THEO TỈ LỆ & KÍCH THƯỚC MÀN HÌNH
   =================================================== */

/* Desktop lớn & hover dropdown */
@media (min-width: 992px) {
    .navbar .nav-item.dropdown:hover .dropdown-menu {
        display: block;
        margin-top: 0;
    }

    .navbar .dropdown-menu {
        transition: all 0.2s ease-in-out;
    }
}

/* Màn hình gần vuông / tỉ lệ 4:3 (iPad ngang, màn hình 1024x768, 1280x960...) */
@media (max-width: 1199.98px) and (min-width: 768px) {
    .mathlinks-hero-img .hero-img {
        height: clamp(280px, 42vw, 460px);
    }

    .teacher-img {
        width: clamp(130px, 18vw, 180px);
        height: clamp(130px, 18vw, 180px);
    }
}

/* Tablet đứng & màn hình vừa (iPad dọc 768x1024, 800x600...) */
@media (max-width: 991.98px) {
    .navbar-light .navbar-nav .nav-link {
        padding: 0.5rem 0.25rem;
    }

    .gallery-item:hover .gallery-overlay {
        opacity: 0; /* Tránh kẹt overlay khi chạm trên màn hình cảm ứng */
    }
}

/* Mobile lớn & nhỏ (dưới 768px) */
@media (max-width: 767.98px) {
    .mathlinks-hero-img .hero-img {
        height: clamp(200px, 48vw, 300px);
    }

    .gallery-item img {
        height: clamp(180px, 52vw, 240px);
    }

    .course-img {
        height: clamp(160px, 48vw, 220px);
    }

    .btn-gold {
        padding: 8px 18px;
        font-size: 0.9rem;
    }
}

/* Mobile rất nhỏ (dưới 576px) */
@media (max-width: 575.98px) {
    .mathlinks-hero-img .hero-img {
        height: clamp(180px, 50vw, 240px);
    }

    .teacher-img {
        width: 140px;
        height: 140px;
    }
}
