/* ====== Material Icons Setup ====== */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ====== Scroll Reveal Animations ====== */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ====== Staggered Delays ====== */
.stagger-1 {
    transition-delay: 0.1s;
}
.stagger-2 {
    transition-delay: 0.2s;
}
.stagger-3 {
    transition-delay: 0.3s;
}
.stagger-4 {
    transition-delay: 0.4s;
}

/* ====== Navigation Glass Effect ====== */
.nav-glass {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* ====== Navigation Link Animations ====== */
.nav-link {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    transform: scale(1.05);
}

.nav-link.active {
    background: #001e40;
    color: #ffffff;
    border-radius: 9999px;
}

.nav-link.active:hover {
    transform: scale(1.05);
}

.nav-underline {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #001e40;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover .nav-underline {
    width: 16px;
}

.nav-link.active .nav-underline {
    display: none;
}

/* ====== Logo Animation ====== */
@keyframes logoPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.logo-seal {
    animation: logoPulse 3s ease-in-out infinite;
}

.logo-seal:hover {
    animation: none;
    transform: scale(1.15) rotate(-5deg);
}

/* ====== Navbar Entrance Animation ====== */
@keyframes navSlideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

#main-header {
    animation: navSlideDown 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ====== DEPARTMENT CARD ANIMATIONS ====== */
.dept-card {
    border-radius: 24px;
    transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.dept-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border-color: #735c00;
}

/* Department Image Zoom */
.dept-image {
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.dept-card:hover .dept-image {
    transform: scale(1.1);
}

/* Department Tags */
.dept-tag {
    transition: all 0.3s ease;
}

.dept-card:hover .dept-tag {
    background: #001e40;
    color: #ffffff;
}

/* Department Button */
.dept-btn {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dept-btn:hover {
    background: #735c00;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.dept-btn:active {
    transform: scale(0.95);
}

/* Department Icon Box */
.dept-card .absolute {
    transition: all 0.3s ease;
}

.dept-card:hover .absolute {
    transform: scale(1.1) rotate(-5deg);
}

/* ====== SECTION GAP ====== */
.mt-section-gap {
    margin-top: 80px;
}

.mb-section-gap {
    margin-bottom: 80px;
}

/* ====== RESPONSIVE ADJUSTMENTS ====== */
@media (max-width: 768px) {
    .px-margin-desktop {
        padding-left: 20px;
        padding-right: 20px;
    }

    .py-section-gap {
        padding-top: 48px;
        padding-bottom: 48px;
    }

    .mt-section-gap {
        margin-top: 48px;
    }
    
    .mb-section-gap {
        margin-bottom: 48px;
    }

    /* Mobile Nav Adjustments */
    header .nav-glass {
        padding: 8px;
    }

    header nav a {
        padding-left: 10px;
        padding-right: 10px;
        font-size: 12px;
    }

    header nav a .material-symbols-outlined {
        font-size: 16px;
    }

    header nav a span {
        font-size: 12px;
    }

    header nav a .nav-underline {
        display: none;
    }

    /* Card adjustments */
    .dept-card {
        border-radius: 16px;
    }

    .dept-card .absolute {
        width: 48px;
        height: 48px;
    }

    .dept-card .absolute .material-symbols-outlined {
        font-size: 24px;
    }

    /* Main content padding for mobile */
    main {
        padding-top: 100px;
    }
}

/* Desktop main content padding */
@media (min-width: 769px) {
    main {
        padding-top: 110px;
    }
}

/* ====== SCROLLBAR STYLING ====== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #001e40;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #735c00;
}

/* ====== SELECTION COLOR ====== */
::selection {
    background: #ffe088;
    color: #001e40;
}

/* ====== FOCUS RING ====== */
*:focus-visible {
    outline: 2px solid #001e40;
    outline-offset: 2px;
}

/* ====== SMOOTH SCROLL BEHAVIOR ====== */
html {
    scroll-behavior: smooth;
}

/* ====== MATERIAL ICONS - PREVENT FOUT ====== */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    opacity: 0;
    transition: opacity 0.2s ease;
    display: inline-block;
    min-width: 24px;
    min-height: 24px;
    line-height: 1;
}

/* Show icons when loaded */
.material-symbols-outlined.loaded {
    opacity: 1;
}

/* Fallback - show after delay if not loaded */
.material-symbols-outlined.fallback {
    opacity: 1;
    font-family: 'Segoe UI', Arial, sans-serif;
}

/* Prevent layout shift */
.material-symbols-outlined {
    visibility: visible;
}

/* Nav link icon fix - always show nav icons */
.nav-link .material-symbols-outlined {
    opacity: 1 !important;
}

/* ====== DEPARTMENTS PAGE SPECIFIC ====== */

/* Hero Header Animation */
.hero-header {
    animation: fadeInUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Department Card Staggered Entrance */
.dept-card {
    opacity: 0;
    animation: cardEntrance 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.dept-card:nth-child(1) {
    animation-delay: 0.1s;
}
.dept-card:nth-child(2) {
    animation-delay: 0.2s;
}
.dept-card:nth-child(3) {
    animation-delay: 0.3s;
}
.dept-card:nth-child(4) {
    animation-delay: 0.4s;
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}