/* ============================================
   Masjid Connect — Custom Styles
   ============================================ */

/* Global body smoothing */
html { scroll-behavior: smooth; }

/* Ramadan & Eid Theme Modes */
.ramadan-mode { background-color: #064e3b; color: #ecfdf5; }
.ramadan-mode .bg-white { background-color: #0d3d2e !important; color: #d1fae5 !important; }
.ramadan-mode .text-gray-800 { color: #a7f3d0 !important; }
.ramadan-mode .text-gray-500 { color: #6ee7b7 !important; }
.ramadan-mode .text-gray-400 { color: #6ee7b7 !important; }
.ramadan-mode .text-gray-700 { color: #a7f3d0 !important; }
.ramadan-mode .bg-gray-50 { background-color: #064e3b !important; }

.eid-mode { background-color: #1e3a8a; color: #eff6ff; }
.eid-mode .bg-white { background-color: #1e3a8a !important; color: #dbeafe !important; }
.eid-mode .text-gray-800 { color: #bfdbfe !important; }
.eid-mode .text-gray-500 { color: #93c5fd !important; }
.eid-mode .text-gray-700 { color: #bfdbfe !important; }
.eid-mode .bg-gray-50 { background-color: #1e40af !important; }

/* Smooth transitions */
body, .bg-white, .bg-gray-50 {
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* ============================================
   Next Prayer Highlight
   ============================================ */
.prayer-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    position: relative;
}

.prayer-card.next-prayer {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%) !important;
    border-top: 4px solid #059669 !important;
    box-shadow: 0 0 0 2px #059669, 0 8px 30px rgba(5, 150, 105, 0.3);
    transform: scale(1.05);
    z-index: 5;
}

.prayer-card.next-prayer::after {
    content: '▶ NEXT';
    position: absolute;
    top: -11px;
    right: -4px;
    background: linear-gradient(135deg, #059669, #0d9488);
    color: white;
    font-size: 8px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.4);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.08); }
}

/* ============================================
   Gallery Lightbox
   ============================================ */
.lightbox-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-caption {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    background: rgba(0,0,0,0.6);
    padding: 8px 24px;
    border-radius: 20px;
    white-space: nowrap;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 36px;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 10000;
    line-height: 1;
    transition: transform 0.2s;
}

.lightbox-close:hover { transform: scale(1.2); }

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 28px;
    cursor: pointer;
    background: rgba(255,255,255,0.1);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-nav:hover { background: rgba(255,255,255,0.3); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* ============================================
   Gallery Grid Items
   ============================================ */
.gallery-item {
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.gallery-item img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img { transform: scale(1.08); }

.gallery-item .overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    padding: 20px 16px 16px;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

/* ============================================
   Filter Buttons (Gallery)
   ============================================ */
.filter-btn {
    padding: 6px 18px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: 2px solid #d1d5db;
    background: white;
    color: #6b7280;
    transition: all 0.2s ease;
}

.filter-btn:hover, .filter-btn.active {
    background: #059669;
    color: white;
    border-color: #059669;
}

/* ============================================
   Timeline (About Page)
   ============================================ */
.timeline-item {
    position: relative;
    padding-left: 40px;
    padding-bottom: 32px;
    border-left: 3px solid #e5e7eb;
}

.timeline-item:last-child { border-left-color: transparent; }

.timeline-item::before {
    content: '';
    position: absolute;
    left: -9px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #059669;
    border: 3px solid white;
    box-shadow: 0 0 0 3px #059669;
}

/* ============================================
   Founding Member Cards
   ============================================ */
.member-card {
    text-align: center;
    padding: 24px 16px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.member-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.member-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669, #064e3b);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: white;
    font-size: 28px;
    font-weight: 800;
}

/* ============================================
   Mobile Navigation
   ============================================ */
.mobile-menu { display: none; }

/* ============================================
   Desktop Nav Link Hover Effects
   ============================================ */
.desktop-nav a {
    position: relative;
    padding: 6px 14px;
    border-radius: 9999px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(255, 255, 255, 0.8);
}

.desktop-nav a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #6ee7b7;
    backdrop-filter: blur(4px);
    box-shadow: 0 0 12px rgba(110, 231, 183, 0.15);
}

.desktop-nav a.nav-active {
    background: rgba(5, 150, 105, 0.25);
    color: #6ee7b7;
    border: 1px solid rgba(110, 231, 183, 0.2);
    box-shadow: 0 0 16px rgba(5, 150, 105, 0.15);
}

/* ============================================
   Sub-page Hero with Fade
   ============================================ */
.subpage-hero {
    position: relative;
    overflow: hidden;
    padding: 4rem 1rem 3.5rem;
    text-align: center;
    color: white;
}

.subpage-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #064e3b 0%, #065f46 30%, #0d9488 70%, #064e3b 100%);
    background-size: 200% 200%;
    animation: hero-gradient-shift 8s ease infinite;
    z-index: 0;
}

.subpage-hero::after {
    content: '';
    position: absolute;
    inset: 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="%23ffffff" fill-opacity="0.04"%3E%3Ccircle cx="30" cy="30" r="2"/%3E%3C/g%3E%3C/svg%3E');
    z-index: 0;
}

.subpage-hero > * {
    position: relative;
    z-index: 1;
}

@keyframes hero-gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@media (max-width: 768px) {
    .desktop-nav { display: none !important; }
    .mobile-menu { display: block; }
    .mobile-nav-links {
        display: none;
        flex-direction: column;
        background: #065f46;
        padding: 16px 20px;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 100;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    }
    .mobile-nav-links.open { display: flex; }
    .mobile-nav-links a {
        padding: 12px 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        font-size: 14px;
        font-weight: 600;
    }
    .mobile-nav-links a:last-child { border-bottom: none; }
}

/* ============================================
   Scroll to Top Button
   ============================================ */
.scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669, #0d9488);
    color: white;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 20px rgba(5, 150, 105, 0.5);
    z-index: 50;
    transition: opacity 0.3s, transform 0.3s;
}

.scroll-top.visible { display: flex; }
.scroll-top:hover { transform: scale(1.15); }

/* ============================================
   Loading Skeleton
   ============================================ */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* ============================================
   Hero Section
   ============================================ */
.hero-section {
    min-height: 420px;
}

/* ============================================
   Selection & Focus
   ============================================ */
::selection {
    background: #059669;
    color: white;
}

/* Subtle page background pattern */
body {
    background-color: #f8fafb;
    background-image: radial-gradient(circle at 1px 1px, #e5e7eb 1px, transparent 0);
    background-size: 40px 40px;
}
