/* ================= GLOBAL RESET & TYPOGRAPHY ================= */
/* Force animations globally - especially important for mobile */
* {
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

/* Prevent mobile browsers from disabling animations */
html {
    -webkit-animation-play-state: running !important;
    animation-play-state: running !important;
}

body {
    -webkit-animation-play-state: running !important;
    animation-play-state: running !important;
    background:#f4f7f6;
    color:#333333; /* Global text color */ 
    line-height:1.6;
    font-family: 'Poppins', 'Segoe UI', Tahoma, sans-serif;
    overflow-x:hidden;
}

/* General Image Reset for Visibility across all pages */
img {
    max-width: 100%;
    height: auto;
    display: block;
    image-rendering: -webkit-optimize-contrast; /* Improves image sharpness */
    object-position: center 20%; /* Prioritizes the top-middle of photos to avoid cutting off heads */
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-15 { margin-top: 15px; }

/* ================= HEADER ================= */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding:15px 40px;
    background:#001f3f; /* Dark navy blue */
    color: white;
    position:sticky;
    top:0;
    z-index:1100; /* Higher than overlay to ensure interaction */
    box-shadow:0 4px 15px rgba(0,0,0,0.2);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-area img {
    height: 55px; /* Matches the visual height of the text block */
    width: auto;
}

.logo-area div {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-area h2, 
.logo-area p {
    margin: 0 !important;
    line-height: 1.2 !important;
}

/* ================= HERO ================= */
.hero {
    height: 100vh; 
    min-height: 400px;
    position:relative;
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    color:rgb(25, 10, 59);
    background-color: #000; /* Changed from green to black to remove the "green gaps" effect */
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* Define the 60vh height used on subpages (About, Academics, etc.) */
.hero-60 {
    height: 60vh !important;
    min-height: 350px !important;
}


header h2 {
color: white; /* Professional white text */
font-size:20px;
font-weight: 700;
}

.menu-toggle {
    display: none;
    cursor: pointer;
    width: 42px;
    height: 42px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 0; /* Sharp square frame for a unique architectural look */
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1100;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: auto; /* Ensure it's always clickable */
    overflow: hidden;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #f9d423;
    transform: rotate(90deg); /* Unique rotation on hover */
}

.menu-toggle.open span {
    background-color: #f9d423; /* Golden Yellow accent */
    border-color: #f9d423;
    transform: rotate(0deg); /* Reset rotation when open */
    background: rgba(26, 90, 58, 0.9); /* Fill with deep green when open */
}

.menu-toggle.open {
    box-shadow: 0 0 20px rgba(249, 212, 35, 0.6); /* Adds a subtle golden glow to the square frame when open */
    border-color: #f9d423;
}

.menu-toggle:focus {
    outline: 2px solid #7CFFB2;
    outline-offset: 5px;
}

/* ================= SCROLL REVEAL ANIMATIONS ================= */
/* Smooth Fade In */
@keyframes fadeInSmooth {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Smooth Fade Up */
@keyframes fadeUpSmooth {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Smooth Slide In Left */
@keyframes slideInLeftSmooth {
    0% { opacity: 0; transform: translateX(-20px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* Circle Reveal - Center expansion */
@keyframes circleReveal {
    0% {
        opacity: 0;
        clip-path: circle(0% at 50% 50%);
    }
    100% {
        opacity: 1;
        clip-path: circle(100% at 50% 50%);
    }
}

/* Shutter Open - Vertical split from center */
@keyframes shutterOpen {
    0% {
        opacity: 0;
        clip-path: polygon(50% 0%, 50% 0%, 50% 100%, 50% 100%);
    }
    100% {
        opacity: 1;
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
    }
}

/* Ken Burns Effect: Slow Zoom and Panning */
@keyframes heroZoom {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.2) translate(5%, 3%); }
}

/* ================= WORD-BY-WORD ANIMATIONS (PowerPoint Style) ================= */

/* Word Bounce In - Like PowerPoint Effect */
@keyframes wordBounceIn {
    0% { 
        opacity: 0; 
        transform: translateY(20px) scale(0.3) rotateZ(-20deg);
    }
    50% {
        opacity: 1;
        transform: translateY(-5px) scale(1.1) rotateZ(5deg);
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1) rotateZ(0deg);
    }
}

/* Word Fade In Smooth */
@keyframes wordFadeSlide {
    0% {
        opacity: 0;
        transform: translateX(-15px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Word Pop In */
@keyframes wordPopIn {
    0% {
        opacity: 0;
        transform: scale(0) rotateZ(-180deg);
    }
    70% {
        transform: scale(1.15) rotateZ(10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateZ(0deg);
    }
}

/* Word Flip In */
@keyframes wordFlipIn {
    0% {
        opacity: 0;
        transform: rotateX(90deg) scale(0.5);
    }
    70% {
        transform: rotateX(-10deg) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: rotateX(0) scale(1);
    }
}

/* Word Glow In */
@keyframes wordGlowIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
        text-shadow: 0 0 0px #1dbf73;
        color: #1dbf73;
    }
    50% {
        text-shadow: 0 0 10px #1dbf73, 0 0 20px #1dbf73;
    }
    100% {
        opacity: 1;
        transform: scale(1);
        text-shadow: 0 0 0px transparent;
        color: inherit;
    }
}

/* Word Spin In */
@keyframes wordSpinIn {
    0% {
        opacity: 0;
        transform: rotateZ(-180deg) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: rotateZ(0deg) translateY(0);
    }
}

/* Word Elastic In */
@keyframes wordElasticIn {
    0% {
        opacity: 0;
        transform: scaleX(0) translateY(10px);
    }
    50% {
        opacity: 1;
        transform: scaleX(1.2) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scaleX(1) translateY(0);
    }
}

/* Apply word animations - default bounce */
.word {
    display: inline-block;
    opacity: 1; /* Safety: Visible by default */
    margin-right: 0; /* Removed extra margin since JavaScript already adds spaces */
    animation: wordBounceIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    will-change: transform, opacity;
    transform-origin: center;
}

/* Force visibility for all text elements when their container is active */
.active .word, 
.active p, 
.active li, 
.active h1, 
.active h2, 
.active h3,
.active span,
.active small {
    opacity: 1 !important;
    visibility: visible !important;
    transition: opacity 0.3s ease-out;
}

/* Vary animation types for different elements */
h1 .word, h2 .word { animation: wordBounceIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards; }
h3 .word { animation: wordPopIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards; }
p .word { animation: wordFadeSlide 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.card h3 .word { animation: wordSpinIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards; }
.card p .word { animation: wordGlowIn 0.3s ease-out forwards; }

/* Alternative animation styles for variety */
.word-variant-1 { animation: wordFlipIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards !important; }
.word-variant-2 { animation: wordElasticIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards !important; }
.word-variant-3 { animation: wordSpinIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards !important; }
.word-variant-4 { animation: wordGlowIn 0.3s ease-out forwards !important; }
.word-variant-5 { animation: wordPopIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards !important; }

/* Staggered delays for word sequence */
.word:nth-child(1) { animation-delay: 0s; }
.word:nth-child(2) { animation-delay: 0.04s; }
.word:nth-child(3) { animation-delay: 0.08s; }
.word:nth-child(4) { animation-delay: 0.12s; }
.word:nth-child(5) { animation-delay: 0.16s; }
.word:nth-child(6) { animation-delay: 0.20s; }
.word:nth-child(7) { animation-delay: 0.24s; }
.word:nth-child(8) { animation-delay: 0.28s; }
.word:nth-child(9) { animation-delay: 0.32s; }
.word:nth-child(10) { animation-delay: 0.36s; }
.word:nth-child(11) { animation-delay: 0.40s; }
.word:nth-child(12) { animation-delay: 0.44s; }
.word:nth-child(13) { animation-delay: 0.48s; }
.word:nth-child(14) { animation-delay: 0.52s; }
.word:nth-child(15) { animation-delay: 0.56s; }

/* Emphasized first word */
.word:first-of-type {
    font-weight: inherit; /* Matches the rest of the line */
    color: inherit; /* Matches the rest of the line */
}

/* Add glow effect to certain words */
.word:nth-child(2n) {
    text-shadow: none; /* Removes distracting glow in the middle of lines */
}

/* Apply animations to reveal elements */
.reveal {
    opacity: 1; /* Visible by default */
}

.reveal.active {
    animation: fadeInSmooth 0.4s ease-out forwards;
}

.reveal.active h1,
.reveal.active h2,
.reveal.active h3 {
    animation: fadeUpSmooth 0.5s ease-out forwards;
}

.reveal.active p {
    animation: slideInLeftSmooth 0.45s ease-out forwards;
}

.reveal.active .card {
    animation: fadeUpSmooth 0.5s ease-out both;
}

/* Staggered animation for grid items */
.reveal.active .card:nth-child(2),
.grid .card:nth-child(2).active {
    animation-delay: 0.05s;
}

.reveal.active .card:nth-child(3),
.grid .card:nth-child(3).active {
    animation-delay: 0.1s;
}

.reveal.active .card:nth-child(4),
.grid .card:nth-child(4).active {
    animation-delay: 0.15s;
}

.reveal.active .card:nth-child(5),
.grid .card:nth-child(5).active {
    animation-delay: 0.2s;
}

.reveal.active .card:nth-child(6),
.grid .card:nth-child(6).active {
    animation-delay: 0.25s;
}

.menu-toggle:hover {
    transform: scale(1.05);
}

.menu-toggle span {
    position: absolute;
    display: block;
    height: 2.5px;
    width: 20px;
    background-color: white;
    border-radius: 0; /* Sharp lines to match the square frame */
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    transform-origin: center;
}

/* Asymmetrical geometric layout */
.menu-toggle span:nth-child(1) { 
    transform: translateY(-8px) translateX(-4px); 
    width: 12px; 
}
.menu-toggle span:nth-child(2) { 
    width: 24px; 
}
.menu-toggle span:nth-child(3) { 
    transform: translateY(8px) translateX(4px); 
    width: 12px; 
}

.menu-toggle.open span:nth-child(1) {
    transform: translateY(0) rotate(45deg);
    width: 32px; /* Stretches to corners of the square */
    background-color: #f9d423;
}
.menu-toggle.open span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}
.menu-toggle.open span:nth-child(3) {
    transform: translateY(0) rotate(-45deg);
    width: 32px; /* Stretches to corners of the square */
    background-color: #f9d423;
}

header p {
font-size:12px; /* This style might not be used on index.html if p is replaced by hero p */
opacity:0.9;
color: #f9d423 !important; /* Golden Yellow accent */
font-weight: 500;
}

.overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.6);
opacity: 0;
visibility: hidden;
transition: all 0.4s ease;
z-index: 1000; /* Sits below the header/nav layer */
}

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

/* NAVIGATION */
nav { /* This nav is inside .header-nav-wrapper now */
display:flex;
gap:15px;
}

nav a {
color:white;
text-decoration:none;
font-weight:500;
transition:0.3s;
position:relative;
}

nav a:hover {
color:#f9d423;
}

nav a::after {
content:"";
position:absolute;
width:0;
height:2px;
background:#f9d423;
bottom:-5px;
left:0;
transition:0.3s;
}

nav a:hover::after {
width:100%;
}

nav a.active {
color:#f9d423;
}

nav a.active::after {
width:100%;
}
.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center top; /* Prioritizes the top of the image to keep heads visible */
    background-repeat: no-repeat;
    background-attachment: local;
    transition: opacity 0.4s ease-in-out;
    opacity: 0; 
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    will-change: transform, opacity;
    transform: scale(1);
}

.hero-slide.active {
    opacity: 1;
    z-index: 2;
    animation: heroZoom 6s ease-out forwards;
}

.hero-content {
    z-index: 3;
}

.hero-overlay {
position:absolute;
width:100%;
height:100%;
background:rgba(0,0,0,0.3); /* Lightened overlay to make background images more visible */
z-index:1;
}

.hero-content {
z-index:3; /* Higher z-index to appear above hero-slides */
max-width: 800px;
padding: 40px;
animation:fadeUp 1s ease-out;
position: relative; /* Make sure it's positioned relative to stacking context */
text-align: center;
width: 90%;
}

.hero-content h1 {
    margin-bottom: 15px;
    font-weight: 700;
}

.hero-content p {
    margin-bottom: 15px;
    font-size: 18px;
}
.hero h1, .hero h2 {
font-size:45px;
text-shadow:0 5px 15px rgba(0,0,0,0.7);
color: white; /* Ensures the h2 inside hero stays white regardless of global h2 settings */
}

.hero p {
font-size:18px;
opacity:0.95;
color: #f9d423 !important; /* Golden Yellow accent */
text-shadow: 0 2px 8px rgba(0,0,0,0.5);
font-weight: 500;
}

/* ================= SECTIONS ================= */
section {
padding:50px 20px;
max-width:1200px;
margin:auto;
}

/* Add fade-in and shake to sections */
section.reveal {
    opacity: 0;
}

section.reveal.active {
    animation: fadeInSmooth 0.6s ease-out forwards;
}

section p, .card p, .reveal p, section li, .card li, .reveal li {
    opacity: 1; /* Ensure text is seen even if JS is slow */
    transition: opacity 0.4s ease;
    margin-bottom: 12px;
    margin-top: 0;
}

section.active p, .card.active p, .reveal.active p, p.active,
section.active li, .card.active li, .reveal.active li, li.active {
    opacity: 1 !important;
    animation: slideInLeftSmooth 0.6s ease-out forwards;
}

/* Unified Headings */
h1, h2, h3 {
color:#1a5a3a; /* Matching the deeper green */
font-weight: 700; /* Standardize boldness */
letter-spacing: -0.5px;
}

h2 {
font-size:30px;
margin-bottom:15px;
position:relative;
padding-bottom: 10px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: #f9d423;
}

/* ================= GRID & CARDS ================= */
.grid {
display:grid;
grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
gap:25px;
}

.card {
background:white;
padding:20px;
border-radius:14px;
box-shadow: 0 10px 30px rgba(0,0,0,0.05);
transition:0.3s ease;
overflow:hidden;
text-align:left;
border-top:4px solid #1a5a3a;
opacity: 0;
position: relative;
border-bottom: 1px solid #eee;
}

.card.active {
    opacity: 1;
    animation: fadeUpSmooth 0.8s cubic-bezier(0.2, 1, 0.3, 1) forwards;
}

.card:hover {
transform:translateY(-8px);
box-shadow:0 12px 35px rgba(0,0,0,0.15);
}

.card img {
width:100%;
height:240px; /* Standardized height to show more of landscape photos */
object-fit:cover;
object-position: center 15%; /* Higher position ensures subjects' faces stay in frame */
border-radius:10px;
margin-bottom:15px;
}

.hm-photo {
    object-fit: cover !important;
    object-position: center 45% !important; /* Adjusted to your requested 45 setting */
}

.card h3 {
color:#1a5a3a;
font-weight: 700;
margin-bottom:10px;
}

.img-box {
height: 180px;
background: #e6e6e6;
display: flex;
align-items: center;
justify-content: center;
color: #666;
border-radius: 10px;
margin-bottom: 15px;
font-size: 14px;
}

/* ================= TESTIMONIALS ================= */
.profile-img {
    width: 100px !important;
    height: 100px !important;
    border-radius: 50% !important;
    margin: 0 auto 15px !important;
    display: block !important;
    border: 3px solid #f9d423;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* ================= PROGRESS BARS ================= */
.progress {
background: #e9ecef;
border-radius: 20px;
height: 25px;
width: 100%;
margin-top: 15px;
overflow: hidden;
box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-bar {
background: linear-gradient(90deg, #1a5a3a, #f9d423);
height: 100%;
color: white;
text-align: center;
font-size: 12px;
line-height: 25px;
font-weight: bold;
width: 0; /* Start at 0 for animation */
transition: width 1.5s ease-in-out;
}

.counter {
font-size: 40px;
font-weight: bold;
color: #1a5a3a;
}

/* ================= ADMIN & MODAL ================= */
#login-container {
max-width: 400px;
margin: 100px auto;
}

#admin-dashboard .dashboard-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}

#previewModal {
display: none; /* Hidden by default */
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.85); /* Dark overlay background */
align-items: center;
justify-content: center;
z-index: 2000;
}

#previewModal.active {
display: flex; /* Show only when 'active' class is added via JS */
}

.modal-content {
width: 90%;
max-width: 600px;
padding: 30px;
position: relative;
max-height: 90vh;
overflow-y: auto;
}

.close-preview {
position: absolute;
right: 15px;
top: 10px;
cursor: pointer;
font-size: 24px;
color: #666;
}

.preview-header {
margin-bottom: 20px;
border-bottom: 1px solid #eee;
padding-bottom: 10px;
}

/* ================= ADMIN BUTTONS & UPLOADS ================= */
.admin-file-btn {
    display: inline-block;
    background: #6c757d;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    margin: 10px 0;
    font-size: 14px;
    transition: 0.3s;
    border: none;
    font-weight: 600;
}

.admin-file-btn:hover { background: #495057; transform: translateY(-2px); }

.btn-publish {
    background: linear-gradient(135deg, #1dbf73, #0a5c3d) !important;
    width: 100%;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 15px !important;
}

.file-status { font-size: 12px; color: #1dbf73; margin-bottom: 10px; font-style: italic; }

input[type="file"] {
    display: block;
    width: 100%;
    padding: 10px;
    background: #f8f9fa;
    border: 2px dashed #1a5a3a;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
}

/* ================= FORMS & BUTTONS ================= */
input, textarea, select {
width:100%;
padding:12px;
margin:8px 0;
border-radius:8px;
border:1px solid #648886;
outline:none;
transition:0.3s;
}

input:focus, textarea:focus {
border-color:#1a5a3a;
box-shadow:0 0 8px rgba(248, 250, 248, 0.911);
}

button {
background:linear-gradient(135deg,#1a5a3a,#0b3d2e);
color:rgb(249, 252, 250);
padding:12px 25px;
border:none;
border-radius:8px;
cursor:pointer;
font-weight:600;
transition:0.3s;
opacity: 0;
animation: fadeInSmooth 0.4s ease-out forwards;
}

button:hover {
background: #0a5c3d !important;
background-image: none !important;
color: #ffffff !important;
display: inline-block !important;
visibility: visible !important;
opacity: 1 !important;
transform:scale(1.05);
box-shadow:0 8px 20px rgba(0,0,0,0.15);
}

button:active {
    background-color: #0b3d2e !important;
    background-image: none !important;
    color: #ffffff !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: scale(0.98);
}

/* SOCIAL MEDIA LINKS */
.social-links {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-links a {
    color: white;
    font-size: 24px;
    transition: 0.3s ease;
}

.social-links a:hover {
    color: #f9d423;
    transform: translateY(-3px);
}

/* Specific Brand Colors for Social Icons */
.fa-facebook  { color: #1877F2; }
.fa-twitter   { color: #1DA1F2; }
.fa-instagram {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.fa-youtube   { color: #FF0000; }
.fa-tiktok    { color: #000000; }

/* ================= FOOTER ================= */
footer {
background:#001f3f;
color:white;
text-align:center;
padding:30px;
margin-top:40px;
}

.footer-stats {
display: flex;
justify-content: center;
gap: 20px;
margin-top: 15px;
font-size: 13px;
border-top: 1px solid rgba(255,255,255,0.1);
padding-top: 15px;
}

.stats-item strong {
color: #f9d423;
}

.back-to-top {
position: fixed;
bottom: 90px; /* Positioned above the WhatsApp button */
right: 20px;
background: #f9d423; /* Golden Yellow Accent */
color: #1a5a3a; /* Deep School Green for contrast */
width: 55px; /* Increased size */
height: 55px; /* Increased size */
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
cursor: pointer;
transition: all 0.3s ease;
font-size: 28px; /* Larger and thicker arrow */
font-weight: bold;
z-index: 9998;
opacity: 0;
visibility: hidden;
box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.back-to-top.show {
opacity: 1;
visibility: visible;
}

.back-to-top:hover {
background: #1a5a3a; /* Deep School Green */
color: #f9d423; /* Golden Yellow Accent */
transform: translateY(-5px);
}

/* ================= WHATSAPP ================= */
.whatsapp-btn {
position:fixed;
bottom:20px;
right:20px;
background:#25D366;
color:white;
padding:14px 20px;
border-radius:50px;
text-decoration:none;
font-weight:bold;
box-shadow:0 6px 20px rgba(0,0,0,0.2);
z-index:9999;
transition:0.3s;
}

.whatsapp-btn:hover {
transform:scale(1.1);
}

/* ================= ANIMATIONS ================= */
@keyframes fadeUp {
from { opacity:0; transform:translateY(30px); }
to { opacity:1; transform:translateY(0); }
}

.reveal {
    transition: opacity 0.8s ease, transform 0.8s ease;
    opacity: 0;
    transform: translateY(20px);
}

.reveal.active {
opacity:1;
    transform: translateY(0);
}

/* ================= MOBILE ================= */
@media(max-width:768px) {
    section, p, .card, li, label, section h1, section h2, section h3 {
        text-align: left !important;
        overflow-wrap: break-word;
    }

header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
}

/* Force logo area to grow so toggle stays at the far right */
header > div:first-child {
    flex-grow: 1;
}

header h2 {
    font-size: 16px; /* Shrink font on mobile to make room for toggle */
    max-width: 180px;
    line-height: 1.2;
}

    .logo-area img {
        height: 45px; /* Scale logo down for mobile alignment */
    }

.menu-toggle {
    display: flex !important;
    margin-left: auto; /* Force to far right */
}

nav { /* This nav is inside .header-nav-wrapper now */
display: flex;
position: fixed;
top: 0;
right: -100%; /* Hidden off-screen to the right */
width: 280px; /* Width of the sidebar */
height: 100vh;
flex-direction: column;
background: rgba(0, 31, 63, 0.92); /* Dark navy blue semi-transparent */
backdrop-filter: blur(15px); /* Premium Glassmorphism */
-webkit-backdrop-filter: blur(15px);
padding: 80px 30px; /* Padding at top to clear the header toggle */
gap: 20px;
transition: right 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
z-index: 1200; /* Ensure nav is above everything else */
box-shadow: -10px 0 30px rgba(0,0,0,0.3);
}

nav.nav-active {
right: 0; /* Slide in to the edge */
}

/* Staggered Link Animation for Mobile Menu */
nav a {
    opacity: 0;
    transform: translateX(30px) scale(0.8);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55), opacity 0.4s ease;
}

nav.nav-active a {
    opacity: 1;
    transform: translateX(0) scale(1);
}

nav.nav-active a:nth-child(1) { transition-delay: 0.1s; }
nav.nav-active a:nth-child(2) { transition-delay: 0.15s; }
nav.nav-active a:nth-child(3) { transition-delay: 0.2s; }
nav.nav-active a:nth-child(4) { transition-delay: 0.25s; }
nav.nav-active a:nth-child(5) { transition-delay: 0.3s; }
nav.nav-active a:nth-child(6) { transition-delay: 0.35s; }
nav.nav-active a:nth-child(7) { transition-delay: 0.4s; }

/* ================= MOBILE ANIMATIONS - Reduced for performance ================= */
/* Mobile hero optimization */
@media(max-width:768px) {
    body {
        line-height: 1.5; /* Tighter line spacing for better readability on small screens */
    }

    .hero {
        height: 60vh; /* Optimized for mobile viewports */
        min-height: 300px;
        position: relative; /* Ensure proper positioning */
        overflow: hidden; /* Prevent overflow issues */
    }
    
    .hero-slide {
        background-attachment: scroll;
        background-position: center center;
        background-size: cover; 
    }
    
    .hero-content {
        padding: 30px 20px;
    }
    
    /* Force immediate visibility and natural wrapping on mobile */
    .reveal, .card, .word { 
        opacity: 1 !important; 
        visibility: visible !important;
        display: inline !important; /* Fixes word-wrapping issues on small screens */
        animation: none !important; /* Disables problematic animations on small devices */
    }

    .hero h1 { font-size: 34px !important; text-align: center !important; text-shadow: 0 2px 15px rgba(0,0,0,0.9) !important; line-height: 1.1 !important; margin-bottom: 12px !important; }
    .hero h2 { font-size: 28px !important; text-align: center !important; text-shadow: 0 2px 10px rgba(0,0,0,0.9) !important; margin-bottom: 10px !important; }
    .hero p { font-size: 18px !important; text-align: center !important; text-shadow: 0 2px 10px rgba(0,0,0,1) !important; font-weight: 600 !important; }
    .hero-content { text-align: center !important; margin: 0 auto; }

    section {
        padding: 35px 12px !important; /* Reduced padding to remove big gaps */
        width: 100% !important;
    }

    .grid {
        gap: 15px !important; /* Tighter grid for mobile */
    }

    .card {
        padding: 15px !important; /* More space for text, less for empty margins */
        margin-bottom: 10px;
    }

    h2 {
        font-size: 24px !important;
        margin-bottom: 10px !important;
    }

    h2 {
        margin-bottom: 5px !important;
        padding-bottom: 5px !important;
    }

    p, li, div, span, small, label {
        font-size: 15px;
        line-height: 1.5 !important; /* Slightly more air for readability */
        margin-bottom: 10px !important; /* Better rhythm between paragraphs */
        margin-top: 0 !important;
        overflow-wrap: break-word; /* Fixes text cutting off */
        hyphens: auto;
        opacity: 1 !important; /* Immediate visibility fallback for mobile */
    }

/* Force animations on mobile - override browser defaults */
* {
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
}

/* Ensure animations work on mobile browsers */
.reveal.active {
    -webkit-animation: fadeInSmooth 0.3s ease-out forwards;
    animation: fadeInSmooth 0.3s ease-out forwards;
    -webkit-transform: translateZ(0); /* Force hardware acceleration */
    transform: translateZ(0);
}

.reveal.active h1,
.reveal.active h2,
.reveal.active h3 {
    -webkit-animation: fadeUpSmooth 0.4s ease-out forwards;
    animation: fadeUpSmooth 0.4s ease-out forwards;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.card.active {
    -webkit-animation: fadeUpSmooth 0.4s ease-out forwards;
    animation: fadeUpSmooth 0.4s ease-out forwards;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

button {
    -webkit-animation: fadeInSmooth 0.3s ease-out forwards;
    animation: fadeInSmooth 0.3s ease-out forwards;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Mobile bar animations - simplified */
section:nth-child(2) .reveal.active,
section:nth-child(4) .reveal.active,
section:nth-child(6) .reveal.active {
    -webkit-animation: barWipeLeft 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation: barWipeLeft 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

section:nth-child(3) .reveal.active,
section:nth-child(5) .reveal.active,
section:nth-child(7) .reveal.active {
    -webkit-animation: barWipeRight 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation: barWipeRight 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.word {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Force hardware acceleration for all animated elements */
.reveal, .card, .word, button, section, p, h1, h2, h3 {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000px;
    perspective: 1000px;
}

/* Respect user's reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .reveal, .card, .word, button, section, p, h1, h2, h3 {
        animation: none !important;
        -webkit-animation: none !important;
        transition: none !important;
        -webkit-transition: none !important;
    }
}

/* Force animations on mobile even if browser tries to disable them */
@media(max-width:768px) and (prefers-reduced-motion: no-preference) {
    .reveal.active,
    .card.active,
    .word,
    button,
    section.reveal.active {
        animation-play-state: running !important;
        -webkit-animation-play-state: running !important;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .reveal.active,
    .card.active,
    .word,
    button,
    section.reveal.active {
        -webkit-animation-fill-mode: forwards !important;
        animation-fill-mode: forwards !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }
}

/* Debug: Add visual indicator for animations (remove in production) */
.reveal.active::before {
    content: "🎬";
    position: absolute;
    top: -20px;
    left: 10px;
    font-size: 12px;
    color: red;
    z-index: 1000;
    display: none; /* Hide by default, show only for debugging */
}

/* Test animation that should work on all mobile devices */
@keyframes mobileTestPulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.test-mobile-animation {
    -webkit-animation: mobileTestPulse 2s infinite;
    animation: mobileTestPulse 2s infinite;
    -webkit-animation-play-state: running !important;
    animation-play-state: running !important;
}

/* ================= JELLY / LIQUID ELASTIC EFFECT ================= */
.jelly, .jelly-text, .jelly-image {
    opacity: 0;
    cursor: pointer;
    position: relative;
    transform-origin: center;
    display: inline-block;
}

.jelly.active, .jelly-text.active {
    animation: liquidJelly 0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94) both,
               floatingJelly 4s ease-in-out 0.85s infinite;
}

.jelly-image.active {
    animation: liquidJelly 0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94) both,
               floatingJelly 3s ease-in-out 0.85s infinite; /* Faster floating for images */
}

@keyframes liquidJelly {
    0% {
        opacity: 0;
        transform: scale(0.4, 1.6) translateY(50px) skewY(15deg);
    }
    40% {
        opacity: 1;
        transform: scale(1.2, 0.8) translateY(-15px) skewY(-10deg);
    }
    60% {
        transform: scale(0.9, 1.1) translateY(8px) skewY(5deg);
    }
    80% {
        transform: scale(1.05, 0.95) translateY(-3px) skewY(-2deg);
    }
    100% {
        opacity: 1;
        transform: scale(1, 1) translateY(0) skewY(0);
    }
}

@keyframes floatingJelly {
    0%, 100% { transform: translateY(0) rotate(0); color: inherit; }
    33% { transform: translateY(-5px) rotate(0.8deg); color: #f9d423; }
    66% { transform: translateY(2px) rotate(-0.5deg); color: inherit; }
}

.jelly:hover, .jelly-text:hover, .jelly-image:hover {
    transition: transform 0.3s ease;
    transform: scale(1.05);
}

    /* Final Mobile Polish to remove gaps */
    section { padding: 30px 15px !important; }
    .hero-slide { background-size: cover !important; }
} 
/* End of main mobile media query (768px) */

/* ================= CUSTOM ENTRANCE ANIMATIONS ================= */

section h1, section h2, section h3, .hero h1, .hero h2 {
    opacity: 1; 
    display: block;
    will-change: transform, opacity;
    transform-origin: center;
}

/* Target specific phone sizes to ensure cover behavior */
@media screen and (max-width: 767px) {
    .hero, .hero-slide { 
        background-size: cover !important;
        background-position: center center !important;
        background-attachment: scroll !important;
    }
} 

/* ================= ADMIN DASHBOARD VISIBILITY FIX ================= */
/* Ensure all elements in admin dashboard are visible */
#admin-dashboard {
    background-color: #f5f5f5;
}

#admin-dashboard section {
    opacity: 1;
}

#admin-dashboard section h1,
#admin-dashboard section h2,
#admin-dashboard section h3,
#admin-dashboard section label,
#admin-dashboard section p {
    opacity: 1 !important;
    text-align: left !important;
    color: #333333 !important;
}

#admin-dashboard .card {
    opacity: 1 !important;
    background: white;
    color: #333333;
}

#admin-dashboard .card h1,
#admin-dashboard .card h2,
#admin-dashboard .card h3,
#admin-dashboard .card h4 {
    opacity: 1 !important;
    color: #333333 !important;
}

#admin-dashboard input,
#admin-dashboard textarea,
#admin-dashboard select,
#admin-dashboard button,
#admin-dashboard label {
    opacity: 1 !important;
    color: #333333 !important;
}

#admin-dashboard .grid .card {
    opacity: 1 !important;
}

/* Ensure all text content in admin dashboard is visible */
#admin-dashboard div,
#admin-dashboard span,
#admin-dashboard small {
    opacity: 1 !important;
    color: #333333 !important;
}

/* Force visibility for admin dashboard cards even without active class */
#admin-dashboard .card,
#admin-dashboard .card.active {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ================= ADMIN FORM LABELS ================= */
#admin-dashboard label {
    display: block;
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 5px;
    color: #2c3e50;
    font-size: 14px;
}

#admin-dashboard input[type="text"],
#admin-dashboard input[type="email"],
#admin-dashboard input[type="password"],
#admin-dashboard textarea,
#admin-dashboard select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

#admin-dashboard textarea {
    resize: vertical;
    min-height: 80px;
}

#admin-dashboard select {
    background-color: white;
    cursor: pointer;
}

#admin-dashboard .file-status {
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

/* Section separators */
#admin-dashboard hr {
    border: 0;
    border-top: 2px solid #f0f0f0;
    margin: 40px 0;
}

/* Button styling */
#admin-dashboard .btn-publish {
    background: #1dbf73;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

#admin-dashboard .btn-publish:hover {
    background: #17a85a;
}

/* Section headers with icons */
#admin-dashboard .card h2 {
    border-bottom: 2px solid #1dbf73;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 18px;
}

#admin-dashboard .card h2 i {
    margin-right: 10px;
    color: #1dbf73;
}

#admin-dashboard .card h3 {
    color: #2c3e50;
    font-size: 16px;
    margin-top: 30px;
    margin-bottom: 15px;
    border-left: 4px solid #1dbf73;
    padding-left: 10px;
}

/* Form field groups */
#admin-dashboard .form-group {
    margin-bottom: 20px;
}

#admin-dashboard .form-group label {
    margin-top: 0;
}

/* Preview and action buttons */
#admin-dashboard .action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

#admin-dashboard .action-buttons button {
    flex: 1;
}

/* Status messages */
#admin-dashboard .status-message {
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    font-weight: bold;
}

#admin-dashboard .status-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#admin-dashboard .status-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ================= LIGHTBOX STYLES ================= */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    cursor: zoom-out;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.close-lightbox {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 35px;
    cursor: pointer;
}

.lightbox-caption {
    background: white;
    padding: 15px;
    border-radius: 0 0 8px 8px;
    margin-top: -5px;
    text-align: center;
}

/* ================= STATUS MODAL STYLES ================= */
.status-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    backdrop-filter: blur(8px);
}

.status-modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-top: 6px solid #1dbf73;
}

.status-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.status-modal-content h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #0b3d2e;
}

.status-modal-content p {
    color: #444;
    font-size: 16px;
    margin-bottom: 30px;
    opacity: 1 !important;
}

.btn-status {
    width: 100%;
    padding: 15px !important;
    font-size: 16px !important;
    opacity: 1 !important;
}

/* ================= LOADING SPINNER ================= */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ================= FLOATING CONTACT BUTTON ================= */
.floating-contact {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #f9d423; /* Golden Yellow Accent */
    color: #1a5a3a; /* Deep School Green */
    padding: 14px 22px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9997;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50px);
}

.floating-contact.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.floating-contact:hover {
    transform: scale(1.05) translateX(5px);
    background: #1a5a3a;
    color: #f9d423;
}