/* ============================================
   SMA AL-MANAR CIBARUSAH - Custom CSS
   Premium Design Enhancements
============================================ */

/* Screen Reader Only Class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only.focus\:not-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

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

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

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

::-webkit-scrollbar-thumb {
    background: #047857;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #059669;
}

/* Header States */
#header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

#header.scrolled .text-neutral-700 {
    color: #1e293b;
}

#header.scrolled .text-neutral-800 {
    color: #0f172a;
}

/* Header Logo Shadow Enhancement */
#header .bg-gradient-primary {
    box-shadow: 0 4px 12px rgba(4, 120, 87, 0.4);
}

#header.scrolled .bg-gradient-primary {
    box-shadow: 0 4px 12px rgba(4, 120, 87, 0.5);
}

/* Navigation Link Hover Animation */
nav a {
    position: relative;
}

nav a::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #047857, #10b981);
    transition: width 0.3s ease;
}

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

/* Hero Section Enhanced Overlay */
#hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.85) 0%, rgba(15, 23, 42, 0.5) 50%, transparent 100%);
    z-index: 1;
    pointer-events: none;
}

/* Ensure hero content stays above the enhanced overlay */
#hero > div > div {
    position: relative;
    z-index: 10;
}

/* Mobile Menu Animation */
#mobile-menu {
    transition: all 0.3s ease-in-out;
}

#mobile-menu.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

#mobile-menu:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Hero Section Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#hero > div > div {
    animation: fadeInUp 0.8s ease-out;
}

#hero > div > div > * {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

#hero > div > div > *:nth-child(1) {
    animation-delay: 0.1s;
}
#hero > div > div > *:nth-child(2) {
    animation-delay: 0.2s;
}
#hero > div > div > *:nth-child(3) {
    animation-delay: 0.3s;
}
#hero > div > div > *:nth-child(4) {
    animation-delay: 0.4s;
}
#hero > div > div > *:nth-child(5) {
    animation-delay: 0.5s;
}

/* Card Hover Effects */
.group:hover .group-hover\:scale-110 {
    transform: scale(1.1);
}

/* Image Lazy Loading Fade In */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Focus Styles for Accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #047857;
    outline-offset: 2px;
}

/* Gradient Text Animation */
@keyframes gradientShift {
    0%,
    100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.text-transparent.bg-clip-text.bg-gradient-to-r {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Pulse Animation for Badge */
@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Section Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

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

/* Button Glow Effect */
@keyframes glow {
    0%,
    100% {
        box-shadow: 0 0 20px rgba(217, 119, 6, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(217, 119, 6, 0.5);
    }
}

.shadow-glow-accent {
    animation: glow 2s ease-in-out infinite;
}

/* Stats Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#stats .group {
    animation: countUp 0.6s ease-out forwards;
}

#stats .group:nth-child(1) {
    animation-delay: 0.1s;
}
#stats .group:nth-child(2) {
    animation-delay: 0.2s;
}
#stats .group:nth-child(3) {
    animation-delay: 0.3s;
}
#stats .group:nth-child(4) {
    animation-delay: 0.4s;
}

/* Testimonial Card Hover */
.testimonial-card {
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
}

/* Facility Card Image Zoom */
.facility-card img {
    transition: transform 0.5s ease;
}

.facility-card:hover img {
    transform: scale(1.1);
}

/* Activity Card Hover */
.activity-card {
    transition: all 0.3s ease;
}

.activity-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* CTA Section Background Pattern */
#cta::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

/* Footer Link Hover Animation */
footer a {
    position: relative;
}

footer a::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #047857;
    transition: width 0.3s ease;
}

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

/* Social Media Icon Hover */
footer .social-icon {
    transition: all 0.3s ease;
}

footer .social-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(4, 120, 87, 0.3);
}

/* Print Styles */
@media print {
    #header,
    #cta,
    #footer,
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
    }

    a {
        text-decoration: none;
        color: #000;
    }
}

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

/* High Contrast Mode */
@media (prefers-contrast: high) {
    body {
        background: #000;
        color: #fff;
    }

    .bg-white {
        background: #000 !important;
        color: #fff !important;
    }

    .text-neutral-600,
    .text-neutral-900 {
        color: #fff !important;
    }
}
