/* ===================================
   Colegio Andrés Manjón - Custom Styles
   =================================== */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

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

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

::-webkit-scrollbar-thumb {
    background: #9ee6bd;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6dd59d;
}

/* Selection color */
::selection {
    background-color: #9ee6bd;
    color: #102a43;
}

/* Underline highlight animation */
.underline-highlight {
    animation: underlineGrow 1s ease-out forwards;
}

@keyframes underlineGrow {
    from {
        transform: scaleX(0);
        transform-origin: bottom left;
    }
    to {
        transform: scaleX(1);
        transform-origin: bottom left;
    }
}

/* Scroll reveal animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* Staggered reveal delays */
.scroll-reveal:nth-child(1) { transition-delay: 0s; }
.scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.2s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.3s; }

/* Navbar scroll effect */
.nav-scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 20px rgba(16, 42, 67, 0.08);
}

.nav-scrolled .nav-link {
    color: #102a43 !important;
}

.nav-scrolled .nav-link:hover {
    color: #48c77e !important;
}

/* Mobile menu animation */
.mobile-link {
    opacity: 0;
    transform: translateY(20px);
}

.mobile-menu-open .mobile-link {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.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; }

/* Active nav link */
.nav-link.active {
    color: #48c77e !important;
}

.nav-link.active::after {
    width: 100% !important;
}

/* Image hover effects */
img {
    max-width: 100%;
    height: auto;
}

/* Button focus styles */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #48c77e;
    outline-offset: 2px;
}

/* 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;
    }
    
    .scroll-reveal {
        opacity: 1;
        transform: none;
    }
    
    .animate-float {
        animation: none;
    }
}

/* Print styles */
@media print {
    nav, .scroll-indicator, button {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    section {
        page-break-inside: avoid;
    }
}

/* Tablet adjustments */
@media (max-width: 768px) {
    .font-serif {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }
}

/* Large desktop */
@media (min-width: 1280px) {
    .scroll-reveal {
        transition-duration: 1s;
    }
}
