/* Crimson Dawn International School - Modern Stylesheet & Smooth Transitions */

:root {
    --color-crest-blue: #1E3A8A;
    --color-crest-royal: #1D449C;
    --color-crest-deep: #0F1E4A;
    --color-crest-gold: #FFDD00;
    --color-crest-amber: #EAB308;
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    scroll-behavior: smooth;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    opacity: 1;
    transition: opacity 0.25s var(--ease-smooth);
}

body.page-leaving {
    opacity: 0;
    transition: opacity 0.2s var(--ease-smooth);
}

/* Custom Smooth Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F1F5F9;
}

::-webkit-scrollbar-thumb {
    background: #1D449C;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0F1E4A;
}

/* Smooth Transitions for Interactive Elements */
a, button, input, select, textarea {
    transition: all 0.25s var(--ease-smooth);
}

/* Star pulse effect */
@keyframes starGlow {
    0%, 100% {
        filter: drop-shadow(0 0 2px rgba(255, 221, 0, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 10px rgba(255, 221, 0, 0.85));
    }
}

.star-glow {
    animation: starGlow 3s ease-in-out infinite;
}

/* Glassmorphism Navigation Bar & Tabs */
.glass-header {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    background: rgba(255, 255, 255, 0.72) !important;
    backdrop-filter: blur(16px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
}

.glass-header.header-scrolled {
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(20px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(190%) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.85) !important;
    box-shadow: 0 10px 30px -4px rgba(29, 68, 156, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.04) !important;
}

.glass-tab {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    transition: all 0.25s var(--ease-smooth);
}

.glass-tab:hover {
    background: rgba(239, 246, 255, 0.85);
    border-color: rgba(29, 68, 156, 0.3);
    color: #1D449C;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(29, 68, 156, 0.12);
}

.glass-tab-active {
    background: rgba(239, 246, 255, 0.9) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(29, 68, 156, 0.35) !important;
    color: #1D449C !important;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(29, 68, 156, 0.12);
}

/* Mobile Navigation Drawer Smooth Animation */
.mobile-menu-drawer {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-8px);
    transition: max-height 0.35s var(--ease-spring), opacity 0.3s var(--ease-smooth), transform 0.35s var(--ease-spring), padding 0.3s ease;
    padding-top: 0;
    padding-bottom: 0;
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.mobile-menu-drawer.open {
    max-height: 600px;
    opacity: 1;
    transform: translateY(0);
    padding-top: 0.75rem;
    padding-bottom: 1.5rem;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
}

/* Glassmorphism panel */
.glass-blue {
    background: rgba(29, 68, 156, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 221, 0, 0.35);
}

/* Modal Smooth Transitions */
.modal-open {
    overflow: hidden;
}

.modal-backdrop {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease-smooth), visibility 0.3s var(--ease-smooth);
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop .modal-card {
    transform: scale(0.92) translateY(16px);
    opacity: 0;
    transition: transform 0.35s var(--ease-spring), opacity 0.3s var(--ease-smooth);
}

.modal-backdrop.active .modal-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Mobile & Touch Compatibility Tweaks */
@media (max-width: 640px) {
    /* Prevent iOS zoom on input focus */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important;
    }
}
