/*
   HUIT IT FACULTY PORTAL
   Responsive layout, motion effects, and light/dark mode
*/

/* ==========================================================================
       HEADER LIGHT/DARK INTEGRATION & SEARCH COMPONENT FIX
       ========================================================================== */
.custom-navbar {
    background: var(--glass-bg) !important;
    border-bottom: 1px solid var(--glass-border) !important;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transition: var(--transition-standard);
}

.custom-navbar .nav-link {
    color: var(--text-main) !important;
    font-weight: 500;
    transition: var(--transition-standard);
}

.custom-navbar .nav-link:hover,
.custom-navbar .nav-link.active {
    color: var(--primary-color) !important;
}

.custom-navbar .navbar-brand-title {
    color: var(--primary-color);
    transition: var(--transition-standard);
}

.custom-navbar .navbar-brand-subtitle {
    color: var(--text-secondary);
}

.custom-navbar .navbar-toggler-icon {
    filter: var(--menu-toggler-filter, none);
}

/* --------------------------------------------------------------------------
       FIXED: FIXING SEARCH INPUT & BUTTON FOR LIGHT/DARK MODE
       -------------------------------------------------------------------------- */
/* Khối ô nhập dữ liệu tìm kiếm */
.custom-search-form .header-search-input {
    background: rgba(0, 0, 0, 0.04) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    font-size: 0.9rem;
    transition: var(--transition-standard);
    width: 150px; /* Cố định chiều rộng nhỏ hơn để tránh chiếm chỗ */
}

/* Xử lý dải chữ placeholder gợi ý theo chế độ màu */
.custom-search-form .header-search-input::placeholder {
    color: var(--text-secondary) !important;
    opacity: 0.7;
}

.custom-search-form .header-search-input:focus {
    background: var(--surface-color) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px var(--primary-light) !important;
    color: var(--text-main) !important;
}

/* Khối nút bấm kính lúp tìm kiếm */
.custom-search-form .header-search-btn {
    background: transparent !important;
    border: 1px solid var(--border-color) !important;
    border-left: none !important;
    /* Triệt tiêu viền trùng với ô input */
    color: var(--text-secondary) !important;
    transition: var(--transition-standard);
}

.custom-search-form .header-search-btn:hover {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
}

/* ==========================================================================
   FIXED: DỊCH CHUYỂN THEME TOGGLE RA NGOÀI CÙNG BÊN PHẢI (DESKTOP)
   ========================================================================== */
@media (min-width: 992px) {

    /* Ép container của navbar-collapse thành Flexbox để điều khiển thứ tự */
    .navbar-collapse {
        display: flex !important;
        align-items: center;
        flex-wrap: nowrap; /* Ngăn các thành phần bên trong xuống dòng */
    }

    /* Đẩy toàn bộ menu và form tìm kiếm sang trái, nhường chỗ cho nút Theme */
    .custom-nav-grid {
        margin-left: auto !important;
        margin-right: 0 !important;
        flex-shrink: 0; /* Ngăn menu bị co lại quá mức */
    }

    /* Đảm bảo nút Theme luôn nằm ở cuối cùng */
    .theme-item {
        order: 99;
        /* Đẩy xuống cuối danh sách */
        margin-left: 10px !important; /* Giảm khoảng cách để tiết kiệm không gian */
    }
}

/* ==========================================================================
   MOBILE & TABLET: BẢO TOÀN RESPONSIVE
   ========================================================================== */
@media (max-width: 991.98px) {

    /* Trên di động, giữ nguyên bố cục dọc của Bootstrap */
    .theme-item {
        order: -1;
        /* Đưa lên đầu hoặc vị trí tùy ý nếu muốn */
        margin-bottom: 15px;
        text-align: center;
    }

    /* Làm nút toggle to ra để dễ bấm trên điện thoại */
    .theme-toggle-btn {
        width: 100%;
        padding: 10px;
        border-radius: 8px;
        background: rgba(0, 0, 0, 0.05);
    }
}

/* --------------------------------------------------------------------------
       DARK MODE OVERRIDES SPECIFIC FOR SEARCH MODULE
       -------------------------------------------------------------------------- */
[data-theme="dark"] .custom-navbar {
    --menu-toggler-filter: invert(1);
}

[data-theme="dark"] .custom-search-form .header-search-input {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

[data-theme="dark"] .custom-search-form .header-search-btn {
    border-color: rgba(255, 255, 255, 0.15) !important;
    border-left: none !important;
    color: var(--primary-color) !important;
    /* Đổi icon kính lúp sang xanh neon trong đêm */
}

[data-theme="dark"] .custom-search-form .header-search-btn:hover {
    background: var(--primary-color) !important;
    color: #061224 !important;
    /* Đổi chữ/icon thành màu tối sâu khi hover nút trong Dark Mode */
}


:root {
    --primary-color: #034EA2;
    --primary-soft: #2073B7;
    --primary-light: #EAF3FF;
    --accent-color: #FFC107;
    --success-color: #198754;
    --text-main: #162033;
    --text-secondary: #657184;
    --bg-main: #FFFFFF;
    --bg-secondary: #F4F8FC;
    --surface-color: #FFFFFF;
    --border-color: #DDE7F2;
    --shadow-color: rgba(12, 38, 76, 0.14);
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.55);
    --glass-blur: blur(16px);
    --transition-standard: all 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="dark"] {
    --primary-color: #5EA2FF;
    --primary-soft: #8ca9ff;
    --primary-light: #132A47;
    --accent-color: #FFD166;
    --text-main: #EEF5FF;
    --text-secondary: #B8C6D8;
    --bg-main: #08111F;
    --bg-secondary: #101B2C;
    --surface-color: #132238;
    --border-color: #243B5C;
    --shadow-color: rgba(0, 0, 0, 0.38);
    --glass-bg: rgba(16, 27, 44, 0.78);
    --glass-border: rgba(255, 255, 255, 0.12);
}

html,
body {
    scroll-behavior: smooth;
}

body {
    padding-top: 76px !important;
    /* Bằng đúng chiều cao thực tế của thanh điều hướng HUIT */
}

body {
    min-width: 320px;
    color: var(--text-main);
    background:
        radial-gradient(circle at 12% 8%, rgba(32, 115, 183, 0.12), transparent 28rem),
        linear-gradient(180deg, var(--bg-main), var(--bg-secondary));
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

body,
.navbar,
.glass-card,
.form-control,
.form-select,
footer {
    transition: background-color 0.28s ease, color 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

a {
    color: var(--primary-color);
}

img {
    max-width: 100%;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.bg-light {
    background-color: var(--bg-secondary) !important;
}

.btn-primary,
.btn-interactive {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover,
.btn-interactive:hover {
    background-color: var(--primary-soft);
    border-color: var(--primary-soft);
    color: #fff;
}

.btn-interactive {
    position: relative;
    overflow: hidden;
    transition: var(--transition-standard);
}

.btn-interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px var(--shadow-color);
}

.btn-interactive:active {
    transform: scale(0.97);
}

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    box-shadow: 0 18px 45px var(--shadow-color);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 24px 55px var(--shadow-color);
}

.section-band {
    padding: 72px 0;
}

.section-heading {
    max-width: 720px;
    margin: 0 auto 32px;
    text-align: center;
}

.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-title {
    margin-bottom: 18px;
    color: var(--text-main);
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    font-weight: 800;
    line-height: 1.15;
}

.section-text {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
}

/* Navigation */
.navbar {
    background-color: rgba(255, 255, 255, 0.88) !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 8px 24px var(--shadow-color);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

[data-theme="dark"] .navbar {
    background-color: rgba(8, 17, 31, 0.9) !important;
}

.navbar-brand img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.navbar-brand-title {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
}

.navbar-brand-subtitle {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.navbar-toggler {
    border-color: var(--border-color);
}

[data-theme="dark"] .navbar-toggler-icon {
    filter: invert(1);
}

/* ==========================================================================
   REFRACTORED: Grid Menu Navigation (Chia ô cho các nút điều hướng)
   ========================================================================== */

/* Thiết lập cấu trúc bao ngoài trên Desktop */
@media (min-width: 992px) {
    .navbar-nav {
        align-items: stretch !important;
        /* Ép các li (nav-item) có chiều cao bằng nhau */
        height: 100%;
    }

    .navbar-nav .nav-item {
        display: flex;
        align-items: center;
        border-right: 1px solid var(--border-color);
        /* Sử dụng biến hệ thống của bạn */
        transition: var(--transition-standard);
    }

    /* Thêm border bên trái cho ô đầu tiên để khép kín khối nếu muốn */
    .navbar-nav .nav-item:first-child {
        border-left: 1px solid var(--border-color);
    }

    /* Khử border bên phải của ô danh mục cuối cùng đứng trước ô chứa nút Theme */
    .navbar-nav .nav-item:has(+ .nav-item .theme-toggle-btn),
    .navbar-nav .nav-item:nth-last-child(2) {
        border-right: none;
    }

    /* Hiệu ứng hover bừng sáng cả ô */
    .navbar-nav .nav-item:not(:last-child):hover {
        background-color: rgba(var(--primary-color-rgb, 0, 102, 204), 0.05);
    }
}

/* Kiểu dáng cho các liên kết liên kết */
.nav-link {
    color: var(--text-main) !important;
    font-weight: 600;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    width: 100%;
    text-align: center;
    transition: var(--transition-standard);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

/* Thay đổi logic Active State từ gạch chân cụm từ sang highlight khối hoặc border dưới */
@media (min-width: 992px) {
    .nav-link.active {
        position: relative;
        background-color: rgba(var(--primary-color-rgb, 0, 102, 204), 0.03);
    }

    /* Kéo dài thanh underline phủ kín đáy ô thay vì co ngắn như cũ */
    .nav-link.active::after {
        position: absolute;
        right: 0;
        bottom: -1px;
        /* Khớp với border-bottom của navbar */
        left: 0;
        height: 3px;
        background-color: var(--primary-color);
        content: "";
    }
}

/* Cấu trúc chia ô khi Responsive trên Mobile/Tablet (< 992px) */
@media (max-width: 991.98px) {
    .navbar-nav {
        width: 100%;
        margin-top: 1rem;
        align-items: stretch !important;
    }

    .navbar-nav .nav-item {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    /* Ô chứa nút Toggle Theme trên mobile */
    .navbar-nav .nav-item:last-child {
        border-bottom: none;
        padding: 1rem 0;
        justify-content: center;
    }

    .nav-link {
        text-align: left;
        padding: 0.75rem 1rem !important;
    }

    /* Khử thanh gạch chân không phù hợp trên Mobile Layout */
    .nav-link.active::after {
        display: none;
    }

    .nav-link.active {
        border-left: 4px solid var(--primary-color);
        padding-left: 0.75rem !important;
        background-color: rgba(var(--primary-color-rgb, 0, 102, 204), 0.05);
    }
}

/* Cấu hình nút Theme Toggle nguyên bản */
.theme-toggle-btn {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    color: #fff;
    background-color: var(--primary-color);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 10px 22px var(--shadow-color);
    transition: var(--transition-standard);
}

.theme-toggle-btn:hover {
    transform: translateY(-2px) rotate(8deg);
    background-color: var(--primary-soft);
}

/* ==========================================================================
   FIXED HERO: RENDER LAYER & INTERACTION COMPATIBILITY
   ========================================================================== */

.hero-carousel {
    background-color: #061224;
    position: relative;
}

.hero-slide {
    position: relative;
    min-height: clamp(560px, 78vh, 760px);
    overflow: hidden;
}

/* Thẻ ảnh vật lý - Khóa chết tọa độ tuyệt đối dưới đáy */
.hero-slide .hero-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    z-index: 1;
    pointer-events: none;
    /* Khử chặn sự kiện chuột */
}

/* Lớp phủ màu xanh dương nhạt hệ thống */
.hero-slide .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(3, 25, 55, 0.94) 0%,
            rgba(15, 76, 129, 0.65) 50%,
            rgba(3, 25, 55, 0.35) 100%);
    z-index: 2;
    pointer-events: none;
    /* GIẢI PHÁP CHÍ MẠNG: Cho phép chuột lướt xuyên qua lớp kính màu */
}

/* Nội dung hiển thị */
.hero-content {
    position: relative;
    z-index: 3;
    display: flex;
    min-height: clamp(560px, 78vh, 760px);
    max-width: 980px;
    flex-direction: column;
    justify-content: center;
    padding-top: 70px;
    padding-bottom: 70px;
    color: #fff;
}

.hero-content .section-kicker {
    color: #B9DCFF;
}

.hero-content h1 {
    max-width: 820px;
    margin-bottom: 22px;
    font-size: clamp(2.25rem, 6vw, 5rem);
    font-weight: 900;
    line-height: 1.04;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    max-width: 680px;
    margin-bottom: 32px;
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.7;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    position: relative;
    z-index: 4;
    /* Đẩy các nút tương tác lên cao nhất */
}

.hero-actions .btn {
    border-radius: 999px;
    padding-right: 26px;
    padding-left: 26px;
}

.carousel-indicators [data-bs-target] {
    width: 34px;
    height: 4px;
    border: 0;
    border-radius: 999px;
    z-index: 5;
}

@media (max-width: 575.98px) {
    .hero-slide .hero-bg-img {
        object-position: 75% center;
    }

    .hero-content {
        text-align: center;
        align-items: center;
    }

    .hero-actions {
        justify-content: center;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
    }
}

/* Stats */
.stats-section {
    margin-top: -48px;
    padding-top: 0;
    position: relative;
    z-index: 3;
}

.stat-card {
    padding: 28px 16px;
}

.stat-card i {
    margin-bottom: 14px;
    color: var(--primary-color);
    font-size: 2.4rem;
}

.stat-card h2 {
    margin-bottom: 6px;
    color: var(--text-main);
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    font-weight: 900;
}

.stat-card p {
    margin: 0;
    color: var(--text-secondary);
    font-weight: 600;
}

/* About */
.about-section {
    background-color: var(--bg-main);
}

.media-frame {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 24px 50px var(--shadow-color);
}

.media-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.media-frame:hover img {
    transform: scale(1.04);
}

.feature-list {
    display: grid;
    gap: 14px;
    margin-top: 28px;
}

.feature-list div {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--text-main);
    font-weight: 650;
}

.feature-list i {
    margin-top: 4px;
    color: var(--success-color);
}

/* Programs */
.program-section {
    background-color: var(--bg-secondary);
}

.program-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.program-card {
    padding: 28px;
}

.program-card i {
    display: inline-flex;
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-soft));
    border-radius: 8px;
    font-size: 1.55rem;
}

.program-card h3,
.bento-item h3 {
    color: var(--text-main);
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.35;
}

.program-card p,
.bento-item p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Bento News */
.bento-grid {
    display: grid;
    grid-auto-rows: minmax(210px, auto);
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.bento-item {
    min-height: 210px;
    padding: 24px;
    overflow: hidden;
}

.bento-large {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-wide {
    grid-column: span 2;
}

.news-feature {
    position: relative;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 24px 50px var(--shadow-color);
    overflow: hidden;
    /* THÊM: Cắt góc ruy-băng thừa khi xoay 45 độ */
}

.news-feature img {
    width: 100%;
    height: 100%;
    min-height: 440px;
    object-fit: cover;
}

/* ==========================================================================
   INTEGRATED: Top-Right Diagonal Ribbon Component
   ========================================================================== */
.ribbon-wrapper {
    position: absolute;
    top: 0;
    right: 0;
    width: 135px;
    height: 135px;
    overflow: hidden;
    z-index: 5;
    /* Nằm trên lớp img và lớp .news-overlay (z-index: 2) */
    pointer-events: none;
    /* Không cản trở tương tác chuột vào card */
}

.ribbon-badge {
    position: absolute;
    top: 25px;
    right: -38px;
    width: 185px;
    transform: rotate(45deg);
    /* Xoay chéo góc chuẩn */
    text-align: center;
    padding: 5px 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    color: #fff;
}

/* Tối ưu hóa Z-Index cho Lớp phủ nội dung để không che mất Ribbon */
.news-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 28px;
    color: #fff;
    background: linear-gradient(180deg, transparent 35%, rgba(3, 17, 36, 0.88));
    z-index: 2;
    /* Đảm bảo lớp phủ nằm dưới lớp Ribbon wrapper */
}

.news-overlay h3 {
    max-width: 560px;
    margin: 14px 0 8px;
    color: #fff;
    font-size: clamp(1.5rem, 3vw, 2.4rem);
}

.news-overlay p {
    max-width: 560px;
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
}

.news-tag {
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.news-tag.green {
    color: var(--success-color);
}

.bento-item a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    text-decoration: none;
}

.student-corner {
    display: grid;
    grid-template-columns: 1fr 150px;
    gap: 22px;
    align-items: center;
}

.student-corner img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

/* Reveal and motion */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

.ripple {
    position: absolute;
    width: 20px;
    height: 20px;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(1);
    animation: ripple 0.55s ease-out forwards;
}

@keyframes ripple {
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(12);
    }
}

/* Chat Box */
.chat-box-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
}

.chat-box-toggle {
    display: flex;
    width: 58px;
    height: 58px;
    align-items: center;
    justify-content: center;
    color: #fff;
    background-color: var(--primary-color);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 14px 32px var(--shadow-color);
    font-size: 1.4rem;
    transition: var(--transition-standard);
}

.chat-box-toggle:hover {
    transform: translateY(-3px);
    background-color: var(--primary-soft);
}

.chat-box-window {
    position: absolute;
    right: 0;
    bottom: 78px;
    display: none;
    width: min(360px, calc(100vw - 32px));
    height: 500px;
    max-height: calc(100vh - 120px);
    flex-direction: column;
    overflow: hidden;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 24px 55px var(--shadow-color);
    animation: slideUp 0.25s ease-out;
}

.chat-box-window.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    color: #fff;
    background-color: var(--primary-color);
    font-weight: 800;
}

.chat-close-btn {
    color: #fff;
    background: none;
    border: 0;
    font-size: 1.1rem;
}

.chat-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    overflow-y: auto;
}

.chat-message {
    max-width: 84%;
    padding: 10px 14px;
    border-radius: 8px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.chat-message.bot {
    align-self: flex-start;
    color: var(--text-main);
    background-color: var(--primary-light);
}

.chat-message.user {
    align-self: flex-end;
    color: #fff;
    background-color: var(--primary-color);
}

.chat-input-area {
    display: flex;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid var(--border-color);
}

.chat-input-area input,
.form-control,
.form-select {
    color: var(--text-main);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.chat-input-area input {
    min-width: 0;
    flex: 1;
    padding: 10px 14px;
    border-radius: 999px;
    outline: none;
}

.chat-input-area button {
    display: inline-flex;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    color: #fff;
    background-color: var(--primary-color);
    border: 0;
    border-radius: 50%;
}

.form-control:focus,
.form-select:focus {
    color: var(--text-main);
    background-color: var(--bg-secondary);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(3, 78, 162, 0.2);
}

/* Footer */
footer {
    color: var(--text-main) !important;
    background-color: var(--bg-secondary) !important;
    border-top: 1px solid var(--border-color);
}

footer a {
    color: var(--text-secondary) !important;
    text-decoration: none;
}

footer a:hover {
    color: var(--primary-color) !important;
}

footer .text-white,
footer .text-white-50 {
    color: var(--text-main) !important;
}

footer hr {
    border-color: var(--border-color);
}

.custom-footer {
    background: var(--bg-secondary) !important;
    border-top: 1px solid var(--border-color);
    transition: var(--transition-standard);
}

.footer-title {
    color: var(--primary-color) !important;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.footer-text {
    color: var(--text-secondary) !important;
    font-size: 0.92rem;
}

.footer-icon {
    color: var(--primary-soft);
}

.footer-link {
    color: var(--text-secondary) !important;
    font-size: 0.92rem;
    transition: var(--transition-standard);
}

.footer-link:hover {
    color: var(--primary-color) !important;
    padding-left: 4px;
}

.footer-divider {
    color: var(--border-color);
    opacity: 1;
}

.footer-map-box {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--glass-bg);
}

.footer-map-box iframe {
    width: 100%;
    height: 100%;
}

.footer-icon-link {
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: var(--transition-standard);
}

.footer-icon-link:hover {
    color: var(--primary-color);
}

[data-theme="dark"] .custom-footer {
    background: rgba(10, 25, 47, 0.4) !important;
    border-top-color: var(--glass-border);
}

@media (max-width: 1199px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 991px) {
    .navbar-collapse {
        padding: 16px 0;
    }

    .navbar-nav {
        align-items: stretch !important;
    }

    .nav-link.active::after {
        display: none;
    }

    .theme-toggle-btn {
        margin: 10px 0 0;
    }

    .program-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .section-band {
        padding: 54px 0;
    }

    .hero-slide,
    .hero-content {
        min-height: 620px;
    }

    .hero-slide {
        background:
            linear-gradient(180deg, rgba(3, 25, 55, 0.86), rgba(3, 25, 55, 0.64)),
            var(--hero-image) center / cover no-repeat;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .stats-section {
        margin-top: 0;
        padding-top: 28px;
    }

    .bento-grid {
        grid-auto-rows: auto;
        grid-template-columns: 1fr;
    }

    .bento-large,
    .bento-wide {
        grid-column: span 1;
        grid-row: span 1;
    }

    .news-feature img {
        min-height: 360px;
    }

    .student-corner {
        grid-template-columns: 1fr;
    }

    .student-corner img {
        width: 100%;
        height: 210px;
    }
}

/* Responsive Chatbox Styling */
.huit-chat-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
}

@media (max-width: 575px) {
    .navbar-brand-title {
        max-width: 210px;
        font-size: 0.86rem;
    }

    .navbar-brand-subtitle {
        max-width: 210px;
        font-size: 0.7rem;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .chat-box-container {
        right: 12px;
        bottom: 12px;
    }
}

@media (max-width: 576px) {
    .huit-chat-wrapper {
        bottom: 10px;
        right: 10px;
    }

    #chat-window-box {
        width: 90vw !important;
        height: 70vh !important;
        bottom: 75px !important;
        right: 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
