/* ======= Typography and Base ======= */
:root {
    --primary: #FBBF24;
    --primary-dark: #F59E0B;
    --dark: #222222;
    --gray-dark: #4B5563;
    --light-bg: #f5f6fa;
    --text-muted: #9CA3AF;
    --bs-body-font-family: 'Kanit', sans-serif;
    --bs-font-sans-serif: 'Kanit', sans-serif;
    --bs-body-font-size: 15px;
    --bs-body-font-weight: 200;
}

body {
    font-family: 'Kanit', sans-serif;
    font-size: 15px;
    font-weight: 200;
    background-color: var(--light-bg);
    color: #374151;
    overflow-x: hidden;
}

body, h1, h2, h3, h4, h5, h6, p, a, span, div, .btn, .nav-link, .card-title, .card-text, .counter {
    font-family: 'Kanit', sans-serif !important;
}

p, a, span, div, .card-text, .nav-link, .fw-bold, .fw-semibold, .fw-bolder {
    font-weight: 200 !important;
}

h1, h2, h3, h4, h5, h6, .card-title {
    font-weight: 300 !important;
}

.bg-light { background-color: var(--light-bg) !important; }

.text-dark-title { color: var(--dark) !important; }
.text-hover-warning:hover { color: var(--primary) !important; transition: 0.3s ease; }
.bg-warning-soft { background-color: rgba(255, 215, 0, 0.15); }

/* ======= Custom Utilities ======= */
.z-index-2 { z-index: 2; }
.z-index-3 { z-index: 3; }
.tracking-wide { letter-spacing: 0.1em; }
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

/* ======= Navbar (Glassmorphism) ======= */
.custom-navbar {
    background: rgba(255, 215, 0, 0.9); /* Yellow Glassmorphism */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    padding: 15px 0;
}
.custom-navbar.scrolled {
    padding: 10px 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}
.logo-circle {
    width: 40px; height: 40px;
    background: var(--dark);
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
}
.logo-circle i { color: var(--primary) !important; }
.school-name { font-size: 1.25rem; color: var(--dark); }
.nav-link { font-weight: 600; color: #111; margin: 0 5px; position: relative; transition: 0.3s; }
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(0,0,0,0.1); border-radius: 5px; }
.nav-link::after {
    content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 0; height: 2px; background: #111; transition: 0.3s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.navbar-toggler { background: #111; color: #fff; border-color: #111; }

/* ======= Hero Section ======= */
.hero-section {
    min-height: 80vh;
    display: flex; align-items: center;
    margin-top: 0; /* Removed offset as header is sticky-top */
}
.hero-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center; background-attachment: fixed;
    z-index: 0;
}
.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to right, rgba(17, 17, 17, 0.9), rgba(17, 17, 17, 0.6));
    z-index: 1;
}

/* Animations */
.animate-fade-up { opacity: 0; transform: translateY(30px); animation: fadeUp 1s ease forwards; }
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* ======= Stats Cards (Glassmorphism) ======= */
.glass-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.glass-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;
}
.glas.social-icon:hover {
    transform: translateY(-3px);
    background-color: var(--primary);
    color: var(--dark) !important;
}

/* Custom Folder Tabs */
.custom-folder-tabs {
    border-bottom: 3px solid var(--dark);
    flex-wrap: nowrap;
}
.custom-folder-tabs .nav-item {
    margin-bottom: 0;
}
.custom-folder-tabs .nav-link {
    border: 1px solid #e5e7eb;
    border-bottom: none;
    border-radius: 12px 12px 0 0 !important;
    color: var(--gray-dark) !important;
    background-color: #ffffff;
    transition: all 0.2s ease;
    margin-right: 4px;
}
.custom-folder-tabs .nav-link:hover {
    background-color: #f3f4f6;
}
.custom-folder-tabs .nav-link.active {
    background-color: var(--dark) !important;
    color: #fff !important;
    border-color: var(--dark) !important;
}
.icon-box { width: 70px; height: 70px; display: flex; justify-content: center; align-items: center; }

/* ======= News Cards ======= */
.news-card { transition: all 0.3s ease; border: 1px solid #eee !important; }
.news-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.08) !important; }
.news-img-wrapper { overflow: hidden; border-radius: calc(.5rem - 1px) calc(.5rem - 1px) 0 0; }
.news-img-wrapper img { transition: transform 0.5s ease; }
.news-card:hover .news-img-wrapper img { transform: scale(1.05); }

/* ======= End ======= */

/* ======= Footer ======= */
.footer { background-color: var(--dark); color: #ccc; border-top: 5px solid var(--primary); }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: #aaa; text-decoration: none; transition: 0.3s; }
.footer-links a:hover { color: var(--primary); padding-left: 5px; }

/* ======= AI Chatbot Widget ======= */
.ai-chat-widget {
    position: fixed; bottom: 90px; right: 30px; width: 350px;
    background: #fff; border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 1000; overflow: hidden;
    transform: translateY(20px); opacity: 0; pointer-events: none;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.ai-chat-widget.active { transform: translateY(0); opacity: 1; pointer-events: auto; }
.ai-chat-header { background: var(--dark); color: var(--primary); padding: 15px; font-weight: bold; }
.ai-chat-body { height: 300px; padding: 15px; overflow-y: auto; background: #f9f9f9; }
.ai-chat-input { padding: 15px; background: #fff; border-top: 1px solid #eee; }
.chat-message { margin-bottom: 15px; padding: 10px 15px; border-radius: 15px; font-size: 0.9rem; max-width: 85%; }
.bot-message { background: #fff; border: 1px solid #eee; border-bottom-left-radius: 0; }
.user-message { background: var(--primary); color: #000; margin-left: auto; border-bottom-right-radius: 0; }
.ai-chat-toggle-btn { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; z-index: 1000; display: flex; justify-content: center; align-items: center; transition: 0.3s; }
.ai-chat-toggle-btn:hover { transform: scale(1.1); }

/* ======= Newsletter Hover Effect ======= */
.newsletter-card .newsletter-img {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.newsletter-card .newsletter-img img {
    transition: transform 0.4s ease;
}
.newsletter-card:hover .newsletter-img img {
    transform: scale(1.08);
}
.newsletter-card .newsletter-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    color: white;
    font-size: 3rem;
    pointer-events: none;
}
.newsletter-card:hover .newsletter-overlay {
    opacity: 1;
}
