/* ========================================
   CEIP Cardenal Tavera — Custom Styles
   ======================================== */

/* Base & Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
}

/* Selection Color */
::selection {
    background-color: #059669;
    color: white;
}

/* ========================================
   Geometric Background Shapes
   ======================================== */
.geo-shapes {
    z-index: 0;
}

.geo-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
}

.geo-circle-1 {
    width: 600px;
    height: 600px;
    background: #059669;
    top: -200px;
    right: -150px;
    animation: float-slow 20s ease-in-out infinite;
}

.geo-circle-2 {
    width: 400px;
    height: 400px;
    background: #d97706;
    bottom: 10%;
    left: -100px;
    animation: float-slow 15s ease-in-out infinite reverse;
}

.geo-square {
    position: absolute;
    opacity: 0.04;
    background: #059669;
    animation: spin-slow 30s linear infinite;
}

.geo-square-1 {
    width: 200px;
    height: 200px;
    top: 30%;
    right: 5%;
    border-radius: 30px;
}

.geo-triangle {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0.05;
    border-left: 80px solid transparent;
    border-right: 80px solid transparent;
    border-bottom: 140px solid #059669;
    animation: float-slow 18s ease-in-out infinite;
}

.geo-triangle-1 {
    top: 60%;
    left: 3%;
}

.geo-dots {
    position: absolute;
    opacity: 0.08;
    background-image: radial-gradient(circle, #059669 1.5px, transparent 1.5px);
    background-size: 20px 20px;
    width: 150px;
    height: 150px;
    top: 40%;
    right: 10%;
}

.geo-line {
    position: absolute;
    width: 300px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #059669, transparent);
    opacity: 0.06;
    top: 50%;
    left: -50px;
    transform: rotate(-15deg);
}

/* ========================================
   Animations
   ======================================== */
@keyframes float-slow {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(3deg); }
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

@keyframes float-delayed {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float-delayed 5s ease-in-out infinite;
    animation-delay: 1s;
}

/* ========================================
   Floating Stat Cards
   ======================================== */
.animate-float,
.animate-float-delayed {
    will-change: transform;
}

/* ========================================
   Navigation
   ======================================== */
#navbar {
    transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
    background-color: rgba(254, 253, 248, 0.92);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 20px rgba(5, 150, 105, 0.08);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #059669;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 60%;
}

/* Mobile Menu */
#mobile-menu {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.mobile-link {
    transform: translateX(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

#mobile-menu.open .mobile-link {
    transform: translateX(0);
    opacity: 1;
}

#mobile-menu.open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.25s; }
#mobile-menu.open .mobile-link:nth-child(5) { transition-delay: 0.3s; }
#mobile-menu.open .mobile-link:nth-child(6) { transition-delay: 0.35s; }

/* ========================================
   Scroll Reveal Animations
   ======================================== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* Stagger delays */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ========================================
   Cards Hover Effects
   ======================================== */
.group:hover .group-hover\:rotate {
    transform: rotate(5deg);
}

/* ========================================
   Form Styles
   ======================================== */
input:focus,
textarea:focus,
select:focus {
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: #9ca3af;
}

/* ========================================
   Counter Animation
   ======================================== */
.font-serif {
    font-variant-numeric: tabular-nums;
}

/* ========================================
   Back to Top Button
   ======================================== */
#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#back-to-top:not(.visible) {
    pointer-events: none;
}

/* ========================================
   Image Hover Zoom
   ======================================== */
img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   Smooth Transitions for All Interactive
   ======================================== */
a, button {
    transition: all 0.3s ease;
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 768px) {
    .geo-circle-1 {
        width: 300px;
        height: 300px;
    }
    
    .geo-circle-2 {
        width: 200px;
        height: 200px;
    }
    
    .geo-square-1 {
        width: 100px;
        height: 100px;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .geo-shapes,
    #back-to-top,
    .animate-float,
    .animate-float-delayed {
        display: none !important;
    }
    
    body {
        background: white;
    }
}

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