/* Enhanced CSS Stylesheet - Baiturrahman Mosque Homepage */

:root {
    /* Warna Hijau (Emerald) - Lebih rich dan deep (Forest Green) sesuai desain */
    --emerald: #125436;
    --emerald-light: #1a754b;
    --emerald-dark: #072e1d;

    /* Warna Emas/Kuning - Lebih vibrant dan menyala (Bukan emas kusam) */
    --gold: #f3b52a;
    --gold-light: #f7ca5d;
    --gold-dim: #d49a1c;

    /* Warna Netral & Teks - Lebih bersih (Clean Modern) */
    --ivory: #ffffff;
    --charcoal: #1e293b;
    /* Slate 800 - Elegan untuk judul */
    --charcoal-light: #475569;
    /* Slate 600 - Nyaman dibaca untuk paragraf */

    --soft-gray: #f8f9fa;
    /* Background abu-abu sangat muda */
    --soft-gray-2: #e2e8f0;
    /* Garis border yang lebih halus */

    /* Spring Physics / Custom Easing */
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

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

::-webkit-scrollbar-track {
    background: var(--emerald-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--gold-dim);
    border-radius: 4px;
    border: 2px solid var(--emerald-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
    font-family: 'Inter', sans-serif;
    background-color: var(--soft-gray);
    color: var(--charcoal);
}

/* Custom Selection Highlight */
::selection {
    background-color: var(--gold);
    color: var(--emerald-dark);
}

/* Background Geometric Patterns */
.bg-geo-pattern {
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23f3b52a' stroke-width='1'%3E%3Cpolygon points='40,4 76,22 76,58 40,76 4,58 4,22'/%3E%3Cpolygon points='40,16 66,29 66,51 40,64 14,51 14,29'/%3E%3Ccircle cx='40' cy='40' r='8'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 80px 80px;
}

/* Dynamic Island Navbar Morphing Transition */
.navbar-transition {
    transition:
        width 0.6s var(--ease-spring),
        max-width 0.6s var(--ease-spring),
        border-radius 0.6s var(--ease-spring),
        background-color 0.5s var(--ease-smooth),
        backdrop-filter 0.5s var(--ease-smooth),
        padding 0.5s var(--ease-smooth),
        height 0.5s var(--ease-smooth),
        top 0.6s var(--ease-spring),
        border 0.5s var(--ease-smooth),
        box-shadow 0.5s var(--ease-smooth),
        transform 0.6s var(--ease-spring);
}

/* Dynamic Island State Class */
.navbar-scrolled {
    position: fixed !important;
    top: 1rem !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 90% !important;
    max-width: 1140px !important;
    border-radius: 9999px !important;
    height: 4.5rem !important;
    padding-left: 2.5rem !important;
    padding-right: 2.5rem !important;
    background-color: rgba(7, 46, 29, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(243, 181, 42, 0.3) !important;
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.3),
        0 10px 10px -5px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(243, 181, 42, 0.15) !important;
}

/* Draw gold underline under menu items on hover */
.nav-link-underline {
    position: relative;
}

.nav-link-underline::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--gold);
    transform-origin: bottom right;
    transition: transform 0.35s var(--ease-smooth);
}

.nav-link-underline:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Active nav link - always show gold underline */
.nav-link-active::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Hide scrollbar for horizontal scroll sections */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Quick access card hover */
.quick-access-card {
    transition: transform 0.35s var(--ease-spring), box-shadow 0.35s var(--ease-smooth), border-color 0.35s var(--ease-smooth);
}

.quick-access-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(7, 46, 29, 0.12);
    border-color: rgba(243, 181, 42, 0.35);
}

/* Agenda card colored stripes */
.agenda-stripe-orange {
    background: linear-gradient(180deg, #e07a2f 0%, #c4621a 100%);
}

.agenda-stripe-yellow {
    background: linear-gradient(180deg, #f3b52a 0%, #d49a1c 100%);
}

.agenda-stripe-blue {
    background: linear-gradient(180deg, #3b82c4 0%, #2563a8 100%);
}

.agenda-stripe-green {
    background: linear-gradient(180deg, #1a754b 0%, #125436 100%);
}

/* Prayer widget split card */
.prayer-widget-card {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.prayer-row-active {
    background-color: #fdf6e3;
    border-radius: 12px;
}

/* Media tab active state */
.media-tab {
    transition: color 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
}

.media-tab.active {
    color: #fff;
    border-bottom: 2px solid var(--gold);
}

/* Gallery filter tabs */
.g-tab-home {
    transition: all 0.3s var(--ease-smooth);
    cursor: pointer;
}

.g-tab-home.active {
    background-color: var(--emerald-dark);
    color: #fff;
}

/* Contact section green bg pattern */
.contact-section-bg {
    background: linear-gradient(135deg, #073924 0%, #0b5635 50%, #073924 100%);
}

/* Khutbah row hover */
.khutbah-row:hover {
    background-color: rgba(248, 249, 250, 0.8);
}

/* Testimonial card */
.testi-card-home {
    transition: opacity 0.5s ease;
}

/* Mobile menu button */
#mobile-menu-btn {
    border-radius: 9999px;
}

/* Footer social buttons rounded */
.soc-btn {
    border-radius: 8px;
}

/* Line clamp utility fallback */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Scroll-Driven Reveal Base Classes */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.8s var(--ease-smooth),
        transform 0.8s var(--ease-smooth);
}

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

/* Staggered Delay Helpers */
.delay-100 {
    transition-delay: 100ms;
}

.delay-200 {
    transition-delay: 200ms;
}

.delay-300 {
    transition-delay: 300ms;
}

.delay-400 {
    transition-delay: 400ms;
}

/* Micro-Animations & Keyframes */
@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-spin-slow {
    animation: spin-slow 20s linear infinite;
}

@keyframes pulse-gold {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(243, 181, 42, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(243, 181, 42, 0.6);
    }
}

/* Pulse Highlight for Active Prayer Row */
.prayer-row.active-prayer {
    animation: pulse-soft-gold 2.5s infinite ease-in-out;
    border: 1px solid rgba(243, 181, 42, 0.2);
    /* Detail garis luar super tipis */
}

@keyframes pulse-soft-gold {

    0%,
    100% {
        box-shadow: 0 0 0px rgba(243, 181, 42, 0);
    }

    50% {
        box-shadow: 0 0 15px rgba(243, 181, 42, 0.15);
    }
}

/* Hover scales and card expansions */
.card-hover-lift {
    transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease-smooth), border-color 0.4s var(--ease-smooth);
}

.card-hover-lift:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 25px 50px -12px rgba(7, 46, 29, 0.15);
    border-color: rgba(243, 181, 42, 0.4);
}

.img-zoom-hover {
    overflow: hidden;
}

.img-zoom-hover img {
    transition: transform 0.6s var(--ease-smooth);
}

.img-zoom-hover:hover img {
    transform: scale(1.06);
}

/* --- Sejarah Page Specific Styles --- */
#sejarah-scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: var(--gold);
    z-index: 100;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px rgba(243, 181, 42, 0.8);
}

.sticky-breadcrumbs {
    position: sticky;
    top: 4.8rem;
    z-index: 40;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Before & After Slider Widget */
.before-after-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    user-select: none;
    border: 1px solid rgba(243, 181, 42, 0.25);
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(7, 46, 29, 0.25);
}

.before-after-container img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
}

.before-after-container .after-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: inset(0 50% 0 0);
}

.before-after-container .slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background-color: var(--gold);
    transform: translateX(-50%);
    cursor: ew-resize;
    z-index: 30;
    box-shadow: 0 0 10px rgba(243, 181, 42, 0.8);
}

.before-after-container .slider-handle-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-color: var(--emerald-dark);
    border: 3px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 14px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s, transform 0.3s var(--ease-spring);
}

.before-after-container:hover .slider-handle-circle {
    background-color: var(--emerald);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Vertical Timeline Layout Adjustments */
.timeline-axis::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent, var(--gold) 15%, var(--gold) 85%, transparent);
    transform: translateX(-50%);
}

@media (max-width: 768px) {
    .timeline-axis::before {
        left: 20px;
        transform: none;
    }
}

/* Lightbox Modal */
.lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    background-color: rgba(7, 46, 29, 0.95);
    backdrop-filter: blur(15px);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s var(--ease-smooth);
}

.lightbox-modal.flex {
    display: flex;
    opacity: 1;
}

/* Parallax backgrounds */
.parallax-bg-effect {
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
}

.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

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

@media (min-width: 768px) {
    .md\:w-14 {
        width: 55px !important;
    }

    .md\:h-14 {
        height: 55px !important;
    }
}

@media (max-width: 1024px) {
    .parallax-bg-effect {
        background-attachment: scroll;
    }
}