/* =========================================
   DESIGN TOKENS & VARIABLES (LIGHT & DARK MODE)
   ========================================= */
:root {
    /* Colors - Light Mode Default */
    --primary: #1e3a8a; /* Deep Blue */
    --primary-light: #3b82f6;
    --primary-dark: #172554;
    --accent: #f59e0b; /* Amber/Gold */
    --accent-hover: #d97706;
    
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-light: #f8fafc;
    
    --bg-main: #ffffff;
    --bg-alt: #f1f5f9;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --header-bg: rgba(255, 255, 255, 0.85);
    --header-scrolled: rgba(255, 255, 255, 0.95);
    --dropdown-bg: #ffffff;
    
    /* Layout & Spacing */
    --container-width: 1200px;
    --nav-height: 80px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

/* Dark Mode Color Palette */
[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #1d4ed8;
    --accent: #fbbf24;
    --accent-hover: #f59e0b;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-light: #ffffff;
    
    --bg-main: #0f172a;
    --bg-alt: #1e293b;
    --bg-card: #1e293b;
    --border-color: #334155;
    --header-bg: rgba(15, 23, 42, 0.88);
    --header-scrolled: rgba(15, 23, 42, 0.96);
    --dropdown-bg: #1e293b;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.4);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* =========================================
   RESET & BASE STYLES
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* =========================================
   BUTTONS (MODERN NEAT DESIGN & ANIMATIONS)
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.7rem 1.4rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Outfit', sans-serif;
    line-height: 1.4;
    user-select: none;
    text-decoration: none;
}

.btn:active {
    transform: translateY(0) scale(0.98) !important;
}

.btn-pill {
    border-radius: 50px !important;
}

.btn-large {
    padding: 0.9rem 2rem;
    font-size: 1.05rem;
    border-radius: 14px;
}

.btn-sm {
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
    border-radius: 10px;
    gap: 0.4rem;
}

.btn-xs {
    padding: 0.3rem 0.7rem;
    font-size: 0.76rem;
    border-radius: 8px;
    gap: 0.3rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    border: none;
}

.btn-primary:hover {
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.45);
    transform: translateY(-2px);
    color: white !important;
}

.btn-outline-primary {
    background: transparent;
    border: 1.5px solid var(--primary-light);
    color: var(--primary-light) !important;
}

.btn-outline-primary:hover {
    background: var(--primary-light);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    color: white !important;
}

.btn-outline:hover {
    background: white;
    color: var(--primary) !important;
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 255, 255, 0.3);
}

/* =========================================
   HEADER & NAVIGATION
   ========================================= */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 1000;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-header.scrolled {
    height: 75px;
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 1001; /* Above mobile menu */
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.logo-text h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.logo-text span {
    display: block;
    font-size: 0.68rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* Main Nav */
.main-nav {
    height: 100%;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    height: 100%;
}

.nav-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.4rem;
    position: relative;
    transition: var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2.5px;
    background: linear-gradient(90deg, var(--primary-light), var(--accent));
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-light);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 80%;
}

.dropdown-icon {
    font-size: 0.72rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.8;
}

.nav-item:hover .dropdown-icon {
    transform: rotate(180deg);
    color: var(--primary-light);
}

/* Dropdown Menu */
.dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%) translateY(15px);
    background: var(--dropdown-bg);
    min-width: 270px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    padding: 0.6rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    z-index: 1050;
}

/* Sub-menu triangle pointer */
.dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: var(--dropdown-bg);
    border-top: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
}

.nav-item:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}

.dropdown li {
    position: relative;
    margin-bottom: 2px;
}

.dropdown li:last-child {
    margin-bottom: 0;
}

.dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.7rem 1.1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.dropdown a:hover {
    color: var(--primary-light);
    background-color: var(--bg-alt);
    padding-left: 1.4rem; /* Smooth micro shift */
    font-weight: 600;
}

.dropdown a::before {
    content: '•';
    color: var(--primary-light);
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    margin-right: -4px;
}

.dropdown a:hover::before {
    opacity: 1;
}
    font-weight: 500;
}

.dropdown a:hover {
    color: var(--primary);
    background-color: var(--bg-alt);
    padding-left: 1.8rem; /* Micro animation */
}

/* CTA Dropdown specifics */
.cta-item .btn {
    padding: 0.6rem 1.25rem;
}

.cta-item:hover .btn {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
    transform: translateY(-2px);
}

.cta-item .dropdown {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(15px);
}

.cta-item .dropdown::before {
    left: auto;
    right: 30px;
}

.cta-item:hover .dropdown {
    transform: translateX(0) translateY(0);
}

.dropdown a.highlight-link {
    color: var(--accent);
    font-weight: 700;
    border-top: 1px solid var(--bg-alt);
    margin-top: 0.5rem;
    padding-top: 0.8rem;
}

/* Mobile Toggle Hamburger Animation */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    width: 30px;
    height: 24px;
    position: relative;
    outline: none;
}

.mobile-toggle .bar {
    position: absolute;
    height: 3px;
    width: 100%;
    background: #ffffff;
    border-radius: 3px;
    left: 0;
    transition: all 0.3s ease-in-out;
}

.mobile-toggle .bar:nth-child(1) { top: 0; }
.mobile-toggle .bar:nth-child(2) { top: 50%; transform: translateY(-50%); }
.mobile-toggle .bar:nth-child(3) { bottom: 0; }

.mobile-toggle.active .bar:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}
.mobile-toggle.active .bar:nth-child(2) {
    opacity: 0;
}
.mobile-toggle.active .bar:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

/* Mobile Nav Overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    overflow: hidden;
    padding-top: var(--nav-height);
}

/* Abstract shapes background */
.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 1;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: rgba(59, 130, 246, 0.6);
    top: -100px;
    right: -100px;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: rgba(245, 158, 11, 0.4);
    bottom: -200px;
    left: -150px;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: url('https://www.transparenttextures.com/patterns/cubes.png');
    opacity: 0.1;
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 10;
    color: white;
    max-width: 800px;
    text-align: center;
    margin: 0 auto;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    color: var(--accent);
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-title span {
    color: var(--accent);
    background: -webkit-linear-gradient(0deg, #fcd34d, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* =========================================
   SEARCH & THEME TOGGLE
   ========================================= */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    height: 100%;
}
.action-item {
    display: flex;
    align-items: center;
    height: 100%;
}
.theme-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    transition: var(--transition);
}
.theme-btn:hover {
    color: var(--primary-light);
}

.search-item {
    position: relative;
}
.search-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background: var(--dropdown-bg);
    min-width: 300px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    z-index: 1050;
    transform: translateY(15px);
}
.search-item.active .search-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.search-form {
    display: flex;
    gap: 0.5rem;
}
.search-input {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
}
.search-input:focus {
    border-color: var(--primary);
}
.search-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.search-btn:hover {
    background: var(--primary-dark);
}

.d-lg-none {
    display: none;
}

/* =========================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================= */
@media (max-width: 1024px) {
    .nav-list {
        gap: 1rem;
    }
    .hero-title {
        font-size: 3.2rem;
    }
}

@media (max-width: 991px) {
    .mobile-toggle {
        display: block;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: var(--bg-main);
        border-left: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        transition: right 0.4s ease;
        padding-top: 80px; /* Space for header */
        z-index: 1000;
        overflow-y: auto;
    }

    .main-nav.active {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem;
        height: auto;
        gap: 0;
    }

    .nav-item {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        border-bottom: 1px solid var(--bg-alt);
    }
    
    .nav-item:last-child {
        border-bottom: none;
        margin-top: 1rem;
    }

    .nav-actions {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 1rem;
        padding-top: 1rem;
    }
    .action-item {
        height: auto;
        width: auto;
    }
    
    .action-item .nav-link, .action-item .theme-btn {
        padding: 0.8rem;
        background: var(--bg-alt);
        border-radius: 8px;
        width: auto;
        justify-content: center;
    }
    
    .cta-item .btn {
        padding: 0.8rem 1.2rem;
        width: auto;
    }
    
    .cta-item .cta-text {
        display: inline;
    }

    .nav-link {
        width: 100%;
        padding: 1rem 0;
        display: flex;
        justify-content: space-between;
        color: var(--text-main);
        text-align: left;
    }
    
    .theme-btn {
        justify-content: flex-start;
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text-main);
    }

    .nav-link:hover, .nav-link.active, .theme-btn:hover {
        color: var(--primary);
    }

    .nav-link::after {
        display: none;
    }
    
    .search-dropdown {
        position: absolute;
        bottom: 100%;
        left: 10px;
        width: calc(100% - 20px);
        transform: translateY(10px);
        box-shadow: var(--shadow-lg);
        opacity: 0;
        visibility: hidden;
        display: block;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        padding: 1rem;
        margin-bottom: 0.5rem;
        border-radius: 12px;
    }
    
    .search-item.active .search-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* Mobile Dropdown Accordion */
    .dropdown {
        position: static;
        width: 100%;
        transform: none;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        display: block;
        background: var(--bg-alt);
        border-radius: 8px;
        margin-bottom: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
        border: none;
    }
    
    .dropdown::before {
        display: none;
    }

    /* When item is active, accordion expands (max-height set via JS) */
    .nav-item.active .dropdown {
        margin-bottom: 1rem;
        margin-top: 0.5rem;
    }
    
    .nav-item.active .dropdown-icon {
        transform: rotate(180deg);
    }

    .cta-item .dropdown {
        transform: none;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
}

/* =========================================
   HOMEPAGE SECTIONS
   ========================================= */
.section {
    padding: 6rem 0;
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: var(--transition);
}

.news-section {
    background-color: var(--bg-alt);
}

.section-subtitle {
    display: inline-block;
    color: var(--primary-light);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 2.5rem;
    color: var(--text-main);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.section-header {
    margin-bottom: 3rem;
}

.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

@media (max-width: 768px) {
    .flex-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

.text-center {
    text-align: center;
}

/* Principal Message */
.principal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.principal-image {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.principal-image img {
    width: 100%;
    height: auto;
    display: block;
}

.principal-image .image-deco {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.6) 0%, transparent 40%);
}

.principal-content .quote-icon {
    font-size: 2.5rem;
    color: var(--accent);
    opacity: 0.3;
    margin-bottom: 1rem;
}

.quote-text {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.principal-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-left: 1rem;
    border-left: 4px solid var(--primary-light);
}

.principal-name strong {
    font-size: 1.1rem;
    color: var(--text-main);
}

.principal-name span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

@media (max-width: 991px) {
    .principal-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Stats Section */
.stats-section {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    padding: 4rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
}

.stat-card {
    padding: 1.5rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-8px);
}

.stat-icon-wrapper {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: var(--accent);
    backdrop-filter: blur(5px);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Programs Section */
.programs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.program-card {
    background: var(--bg-card);
    padding: 2.5rem 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.program-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-10px);
    border-color: var(--primary);
}

.program-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-alt);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.8rem;
    color: var(--primary);
    transition: var(--transition);
}

.program-card:hover .program-icon {
    background: var(--primary);
    color: white;
}

.program-title {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.program-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
}

@media (max-width: 1024px) {
    .programs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .programs-grid {
        grid-template-columns: 1fr;
    }
}

/* News Section */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.news-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.news-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.news-img {
    height: 220px;
    overflow: hidden;
}

.news-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-img img {
    transform: scale(1.1);
}

.news-content {
    padding: 1.5rem;
}

.news-date {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.news-title {
    font-size: 1.2rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.news-title a {
    color: var(--text-main);
}

.news-title a:hover {
    color: var(--primary);
}

.news-title a:hover {
    color: var(--primary);
}

.news-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-readmore {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.news-readmore:hover {
    color: var(--primary-dark);
}

@media (max-width: 991px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
}

/* Gallery Section */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 250px;
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}

.item-large {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.2) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-overlay span {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.gallery-overlay .overlay-icon {
    color: var(--accent);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-item:hover .gallery-overlay span,
.gallery-item:hover .gallery-overlay .overlay-icon {
    transform: translateY(0);
}

@media (max-width: 991px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 200px;
    }
}
@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 250px;
    }
    .item-large {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* Testimonials */
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.testimonial-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 16px;
    position: relative;
}

.testi-rating {
    color: var(--accent);
    margin-bottom: 1rem;
}

.quote-mark {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.05);
}

.testi-text {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.testi-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.testi-author img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.testi-info h4 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.testi-info span {
    font-size: 0.85rem;
    opacity: 0.7;
}

@media (max-width: 991px) {
    .testimonial-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .testimonial-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   FOOTER
   ========================================= */
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-links-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-links-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    transition: var(--transition);
}

.footer-links-list a i {
    font-size: 0.8rem;
    color: var(--accent);
    transition: transform 0.3s ease;
}

.footer-links-list a:hover {
    color: white;
}

.footer-links-list a:hover i {
    transform: translateX(5px);
}

.footer-contact-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-contact-list li {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.footer-contact-list .phone-icon, 
.footer-contact-list .email-icon, 
.footer-contact-list .clock-icon {
    color: var(--accent);
    font-size: 1.2rem;
}

.footer-contact-list .wa-icon {
    color: #25D366;
    font-size: 1.2rem;
}

.footer-contact-list .operational-hours {
    align-items: flex-start;
    margin-top: 0.5rem;
}

.footer-contact-list .hours-title {
    color: white;
    font-weight: 500;
}

.footer-contact-list small {
    font-size: 0.8rem;
    opacity: 0.7;
}

.social-links-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white !important;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-btn:hover {
    transform: translateY(-5px) scale(1.1);
}

.social-btn.instagram { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.social-btn.youtube { background: #FF0000; }
.social-btn.facebook { background: #1877F2; }
.social-btn.tiktok { background: #000000; border: 1px solid rgba(255,255,255,0.2); }

.footer-bottom {
    background: #060b14;
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.9rem;
}

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

/* =========================================
   SEARCH BAR (HEADER)
   ========================================= */
.search-item {
    position: relative;
    display: flex;
    align-items: center;
}

.search-toggle {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.1rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.search-toggle:hover {
    background: var(--bg-alt);
    color: var(--primary);
}

.search-dropdown {
    position: absolute;
    top: 130%;
    right: 0;
    width: 300px;
    background: white;
    border-radius: 50px;
    box-shadow: var(--shadow-lg);
    padding: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 1px solid rgba(0,0,0,0.05);
    z-index: 1000;
}

.search-item.active .search-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-form {
    display: flex;
    align-items: center;
    width: 100%;
}

.search-input {
    flex: 1;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 50px 0 0 50px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}

.search-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    margin-right: 2px;
}

.search-btn:hover {
    background: var(--primary-dark);
}

@media (max-width: 991px) {
    .search-item {
        width: 100%;
        margin-top: 1rem;
    }
    
    .search-toggle {
        display: none; /* Hide toggle on mobile, show input directly */
    }
    
    .search-dropdown {
        position: static;
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: transparent;
        border: 1px solid rgba(0,0,0,0.1);
        padding: 4px;
    }
}

/* =========================================
   FLOATING WHATSAPP BUTTON
   ========================================= */
.floating-wa {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25d366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 9999;
    text-decoration: none;
    transition: all 0.3s ease;
    animation: float-wa 3s ease-in-out infinite;
}

.floating-wa:hover {
    background: #128c7e;
    transform: scale(1.1);
    color: white;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.wa-tooltip {
    position: absolute;
    right: 75px;
    background: white;
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    transform: translateX(10px);
    white-space: nowrap;
}

.wa-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -6px;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-style: solid;
    border-color: transparent transparent transparent white;
}

.floating-wa:hover .wa-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

@keyframes float-wa {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

@media (max-width: 600px) {
    .floating-wa {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.8rem;
    }
    
    .wa-tooltip {
        display: none;
    }
}

/* =========================================
   ADMIN PANEL MODERN STYLES
   ========================================= */
body.admin-body {
    display: flex;
    min-height: 100vh;
    background-color: #f8fafc;
    color: #1e293b;
    font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
}

/* Admin Sidebar */
.admin-sidebar {
    width: 270px;
    height: 100vh;
    position: sticky;
    top: 0;
    background: #0f172a;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: 4px 0 25px rgba(0,0,0,0.15);
    z-index: 100;
}

.sidebar-brand {
    padding: 1.8rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.brand-details h2 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: white;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 2px;
}
.role-admin { background: rgba(37, 99, 235, 0.2); color: #60a5fa; }
.role-guru { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.role-kepsek { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }

.sidebar-nav-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Sidebar Custom Scrollbar - Sleek & Professional */
.sidebar-nav-wrapper::-webkit-scrollbar {
    width: 5px;
}
.sidebar-nav-wrapper::-webkit-scrollbar-track {
    background: transparent; 
    margin: 6px 0;
}
.sidebar-nav-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16); 
    border-radius: 20px;
    transition: background 0.3s ease;
}
.sidebar-nav-wrapper:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.28); 
}
.sidebar-nav-wrapper::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #38bdf8 0%, #2563eb 100%); 
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

.sidebar-menu {
    list-style: none;
}

.menu-header {
    padding: 0.8rem 1.5rem 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #64748b;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.7rem 1.1rem;
    margin: 3px 12px;
    border-radius: 12px;
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.92rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-menu li a i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    color: #64748b;
    transition: color 0.2s ease, transform 0.2s ease;
}

.sidebar-menu li a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    padding-left: 1.3rem;
}

.sidebar-menu li a:hover i {
    color: #38bdf8;
    transform: scale(1.1);
}

.sidebar-menu li.active a {
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
    border-left: none;
}

.sidebar-menu li.active a i {
    color: #ffffff;
}

.sidebar-user-footer {
    padding: 1rem 1.2rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.15);
}

.user-info-brief {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-icon {
    font-size: 2rem;
    color: #38bdf8;
}

.user-names strong {
    display: block;
    font-size: 0.88rem;
    color: white;
}

.user-names small {
    color: #94a3b8;
    font-size: 0.75rem;
}

.btn-logout-sidebar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-logout-sidebar:hover {
    background: #ef4444;
    color: white;
}

/* Main Content Area */
.admin-main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.admin-topbar {
    background: white;
    padding: 1.2rem 2.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border-bottom: 1px solid #e2e8f0;
}

.topbar-title h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.topbar-title p {
    font-size: 0.85rem;
    color: #64748b;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-body-content {
    padding: 2.2rem;
    flex: 1;
}

/* Admin Dashboard Cards & UI */
.admin-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.admin-card-stat {
    background: white;
    padding: 1.6rem;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 1.4rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.admin-card-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.07);
}

.stat-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: white;
    flex-shrink: 0;
}

.stat-icon-blue { background: linear-gradient(135deg, #2563eb, #3b82f6); box-shadow: 0 8px 16px rgba(37,99,235,0.25); }
.stat-icon-emerald { background: linear-gradient(135deg, #059669, #10b981); box-shadow: 0 8px 16px rgba(16,185,129,0.25); }
.stat-icon-amber { background: linear-gradient(135deg, #d97706, #f59e0b); box-shadow: 0 8px 16px rgba(245,158,11,0.25); }
.stat-icon-purple { background: linear-gradient(135deg, #7c3aed, #8b5cf6); box-shadow: 0 8px 16px rgba(139,92,246,0.25); }

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
    font-family: 'Outfit', sans-serif;
}

.stat-label {
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 500;
    margin-top: 4px;
}

/* Modern Data Table */
.admin-card-table {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin-bottom: 2rem;
}

.card-table-header {
    padding: 1.4rem 1.8rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-table-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-admin-table th {
    background: #f8fafc;
    padding: 1rem 1.4rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

.custom-admin-table td {
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.92rem;
    color: #334155;
    vertical-align: middle;
}

.custom-admin-table tr:hover td {
    background-color: #f8fafc;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #e0f2fe; color: #0369a1; }

/* Admin Buttons */
.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    border-radius: 8px;
}
.btn-emerald { background: #10b981; color: white; }
.btn-emerald:hover { background: #059669; color: white; }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; color: white; }
.btn-warning { background: #f59e0b; color: white; }
.btn-warning:hover { background: #d97706; color: white; }

.mobile-sidebar-toggle {
    display: none;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1001;
    background: var(--primary);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 10px;
    font-size: 1.5rem;
    box-shadow: var(--shadow-md);
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
}

@media (max-width: 992px) {
    body.admin-body { flex-direction: column; }
    
    .mobile-sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .admin-sidebar { 
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .admin-sidebar.show {
        left: 0;
    }
    
    .sidebar-overlay.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.6);
        z-index: 999;
        backdrop-filter: blur(4px);
    }
    
    /* Beri jarak padding atas di main content agar tidak tertutup tombol toggle */
    .admin-main-wrapper {
        padding-top: 60px;
        width: 100%;
    }
}

/* =========================================
   ACCESSIBILITY & WCAG 2.1 COMPLIANCE
   ========================================= */

/* High Contrast Focus Ring for Keyboard Navigation (Tab Navigation) */
:focus-visible {
    outline: 3px solid #2563eb !important;
    outline-offset: 3px !important;
    border-radius: 4px;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.3) !important;
}

/* Skip to Content Link for Screen Readers */
.skip-link {
    position: absolute;
    top: -100px;
    left: 10px;
    background: #2563eb;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 99999;
    font-weight: 700;
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 10px;
}

/* Respect User Preference for Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =========================================
   UNIVERSAL THEMING & RESPONSIVE UTILITIES
   ========================================= */

.card-box {
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

@media (max-width: 991px) {
    .card-box {
        padding: 2rem;
        border-radius: 16px;
    }
}

@media (max-width: 600px) {
    .card-box {
        padding: 1.25rem;
        border-radius: 12px;
    }
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 1rem;
    border-radius: 10px;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 550px;
}

.custom-table th, .custom-table td {
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.custom-table th {
    background: var(--bg-alt);
    font-weight: 700;
    color: var(--text-main);
}

.form-control, input[type="text"], input[type="email"], input[type="password"], input[type="date"], select, textarea {
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1.5px solid var(--border-color) !important;
    transition: var(--transition);
}

.form-control:focus, input:focus, select:focus, textarea:focus {
    border-color: var(--primary) !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}

.theme-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.95);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-btn:hover {
    background: var(--bg-alt);
    color: var(--accent);
}

/* Mobile Brand Header Adjustments */
@media (max-width: 576px) {
    .logo-text h1 {
        font-size: 0.95rem;
    }
    .logo-text span {
        display: none;
    }
    .container {
        padding: 0 1rem;
    }
    .hero-title {
        font-size: 2rem !important;
    }

    /* Admin Dark Mode Styling */
    [data-theme="dark"] .admin-topbar,
    [data-theme="dark"] .admin-card-stat,
    [data-theme="dark"] .admin-card-table,
    [data-theme="dark"] .card-table-header {
        background-color: var(--bg-card) !important;
        border-color: var(--border-color) !important;
        color: var(--text-main) !important;
    }

    [data-theme="dark"] .custom-admin-table th {
        background-color: var(--bg-alt) !important;
        border-color: var(--border-color) !important;
        color: var(--text-muted) !important;
    }

    [data-theme="dark"] .topbar-title h1,
    [data-theme="dark"] .card-table-header h2,
    [data-theme="dark"] .stat-number,
    [data-theme="dark"] .custom-admin-table td {
        color: var(--text-main) !important;
        border-color: var(--border-color) !important;
    }

    [data-theme="dark"] .topbar-title p,
    [data-theme="dark"] .stat-label {
        color: var(--text-muted) !important;
    }

    [data-theme="dark"] .custom-admin-table tr:hover td {
        background-color: var(--bg-alt) !important;
    }
    .hero-desc {
        font-size: 1rem !important;
    }
}

/* =========================================
   TEACHER DIRECTORY (GRID CARDS)
   ========================================= */
.teacher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.teacher-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.teacher-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    z-index: 1;
}

.teacher-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.teacher-avatar-wrap {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid var(--bg-card);
    background: white;
    position: relative;
    z-index: 2;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--primary-light);
    overflow: hidden;
}

.teacher-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.teacher-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.teacher-nip {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
    margin-bottom: 0.8rem;
    font-family: monospace;
}

.teacher-badge {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.teacher-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    margin-top: auto;
}

.teacher-actions .btn {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.8rem;
}

[data-theme="dark"] .teacher-card {
    border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .teacher-avatar-wrap {
    border-color: var(--bg-card);
}
[data-theme="dark"] .teacher-nip {
    background: rgba(255,255,255,0.05);
}

/* =========================================
   GLOBAL LOADER (PRE-LOADER)
   ========================================= */
#global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-main);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
#global-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}
.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(37, 99, 235, 0.2);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.loader-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 1px;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* =========================================
   ROLE BASED BADGES (DASHBOARD)
   ========================================= */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.role-admin { background: linear-gradient(135deg, #1e3a8a, #3b82f6); color: white; border: 1px solid rgba(255,255,255,0.2); }
.role-guru { background: linear-gradient(135deg, #064e3b, #10b981); color: white; border: 1px solid rgba(255,255,255,0.2); }
.role-kepsek { background: linear-gradient(135deg, #4c1d95, #8b5cf6); color: white; border: 1px solid rgba(255,255,255,0.2); }
.role-tu { background: linear-gradient(135deg, #78350f, #f59e0b); color: white; border: 1px solid rgba(255,255,255,0.2); }
.role-siswa { background: linear-gradient(135deg, #164e63, #06b6d4); color: white; border: 1px solid rgba(255,255,255,0.2); }

/* =========================================
   REALTIME VISITOR RADAR (DASHBOARD)
   ========================================= */
.stat-icon-live {
    background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
    position: relative;
    z-index: 1;
}

.realtime-pulse::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(16, 185, 129, 0.4);
    border-radius: inherit;
    z-index: -1;
    animation: live-radar 2s infinite ease-out;
}

@keyframes live-radar {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* =========================================
   GLOBAL CUSTOM SCROLLBAR
   ========================================= */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}
