/* ============================================
   Chisti Sabri Musjid — Prayer Times
   Aesthetic: Warm Islamic luxury, gold on dark
   ============================================ */

:root {
    --gold-light: #D4AF37;
    --gold: #C5961A;
    --gold-dark: #8B6914;
    --gold-muted: rgba(197, 150, 26, 0.15);
    --gold-glow: rgba(212, 175, 55, 0.08);
    --bg-deep: #0F0E0B;
    --bg-card: #181610;
    --bg-card-hover: #1E1C16;
    --bg-elevated: #232118;
    --cream: #F5F0E1;
    --cream-muted: #B8B3A4;
    --cream-dim: #7A7668;
    --text-primary: #F5F0E1;
    --text-secondary: #B8B3A4;
    --text-dim: #b9b4a0;
    --border: rgba(197, 150, 26, 0.12);
    --border-active: rgba(197, 150, 26, 0.35);
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-card: 0 2px 20px rgba(0,0,0,0.4), 0 0 60px rgba(197,150,26,0.03);
    --shadow-glow: 0 0 40px rgba(212,175,55,0.08);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Subtle grain texture */
.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background: repeating-linear-gradient(
        0deg,
        rgba(255,255,255,0.03) 0px,
        transparent 1px,
        transparent 3px
    );
}

/* ---- HEADER / HERO ---- */

.hero {
    position: relative;
    padding: 3.5rem 1.5rem 2.5rem;
    text-align: center;
    overflow: hidden;
    background: radial-gradient(ellipse 70% 50% at 50% 30%, rgba(197,150,26,0.06) 0%, transparent 70%);
}

.hero-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image:
        repeating-conic-gradient(var(--gold) 0% 25%, transparent 0% 50%) 0 0 / 40px 40px,
        repeating-conic-gradient(var(--gold) 0% 25%, transparent 0% 50%) 20px 20px / 40px 40px;
    mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.logo-mark {
    margin: 0 auto 1rem;
    width: 80px;
    height: 94px;
    animation: fadeInDown 1s ease-out;
}

.logo-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 20px rgba(212,175,55,0.2));
}

.masjid-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    letter-spacing: 0.02em;
    color: var(--cream);
    line-height: 1.15;
    animation: fadeInUp 0.8s ease-out 0.15s both;
}

.masjid-location {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--gold);
    margin-top: 0.35rem;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.date-display {
    margin-top: 1.2rem;
    animation: fadeInUp 0.8s ease-out 0.45s both;
}

.date-gregorian {
    font-size: 0.95rem;
    color: var(--cream-muted);
    letter-spacing: 0.08em;
}

/* ---- NEXT PRAYER HIGHLIGHT ---- */

.next-prayer-section {
    padding: 0 1.25rem;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.55s both;
}

.next-prayer-card {
    max-width: 480px;
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(197,150,26,0.12) 0%, rgba(197,150,26,0.04) 100%);
    border: 1px solid var(--border-active);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-glow);
}

.next-prayer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.next-prayer-label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.3rem;
}

.next-prayer-name {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--cream);
}

.next-prayer-time {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 900;
    color: var(--gold-light);
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.countdown {
    font-size: 0.85rem;
    color: var(--cream-muted);
    margin-top: 0.3rem;
    font-style: italic;
    min-height: 1.2em;
}

/* ---- SECTION TITLES ---- */

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    text-align: center;
    margin-bottom: 1.25rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background: var(--gold);
    margin: 0.6rem auto 0;
    opacity: 0.5;
}

/* ---- PRAYER GRID ---- */

.prayer-times-section {
    padding: 0 1.25rem 2rem;
}

.prayer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.9rem;
    max-width: 720px;
    margin: 0 auto;
}

.prayer-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1rem 1rem;
    text-align: center;
    transition: all 0.35s ease;
    position: relative;
    overflow: hidden;
}

.prayer-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width 0.35s ease;
}

.prayer-card:hover,
.prayer-card.active {
    background: var(--bg-card-hover);
    border-color: var(--border-active);
    box-shadow: var(--shadow-card);
    transform: translateY(-2px);
}

.prayer-card:hover::after,
.prayer-card.active::after {
    width: 60%;
}

.prayer-card.active {
    background: linear-gradient(180deg, rgba(197,150,26,0.08) 0%, var(--bg-card) 100%);
}

/* Skeleton loading */
.prayer-card.skeleton .time-value,
.prayer-card.skeleton .extra-value {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, rgba(197,150,26,0.06) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s infinite;
    border-radius: 4px;
    color: transparent;
    user-select: none;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.prayer-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--cream);
    margin-bottom: 0.75rem;
    letter-spacing: 0.04em;
}

.prayer-time-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.time-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.15rem 0;
}

.time-row.single {
    justify-content: center;
    padding: 0.4rem 0;
}

.time-label {
    font-size: 0.78rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.time-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cream);
    letter-spacing: 0.03em;
    min-width: 3.5em;
    text-align: right;
}

.time-value.large {
    font-size: 1.4rem;
    text-align: center;
}

.time-row.highlight .time-value {
    color: var(--gold-light);
}

.prayer-extra {
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    min-height: 1.6em;
}

.extra-label {
    font-size: 0.72rem;
    color: var(--text-dim);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.extra-value {
    font-size: 0.9rem;
    color: var(--cream-muted);
    font-weight: 600;
}

/* ---- JUMU'AH SECTION ---- */

.jumuah-section {
    padding: 0 1.25rem 2rem;
    animation: fadeInUp 0.8s ease-out 0.7s both;
}

.jumuah-card {
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.jumuah-detail {
    text-align: center;
    flex: 1;
    min-width: 80px;
}

.jumuah-label {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
}

.jumuah-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold-light);
}

.jumuah-divider {
    width: 1px;
    height: 36px;
    background: var(--border);
}

.jumuah-khateeb {
    width: 100%;
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 1.5rem;
    color: var(--cream-muted);
    font-style: italic;
}

/* ---- ANNOUNCEMENT ---- */

.announcement-section {
    padding: 0 1.25rem 2rem;
}

.announcement-card {
    max-width: 480px;
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(197,150,26,0.08) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border-active);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    text-align: center;
    font-size: 1rem;
    color: var(--cream);
    line-height: 1.6;
}

/* ---- CONTACT ---- */

.contact-section {
    padding: 0 1.25rem 3.5rem;
}

.contact-card {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
    padding: 1rem;
}

.contact-line {
    font-size: 0.9rem;
    color: var(--cream-muted);
    margin-bottom: 0.25rem;
}

.contact-line a {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.2s;
}

.contact-line a:hover {
    color: var(--gold-light);
}

.last-updated {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.6rem;
}

/* ---- FOOTER ---- */

footer {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-dim);
    letter-spacing: 0.1em;
}

/* ---- ANIMATIONS ---- */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered card animations */
.prayer-card {
    animation: fadeInUp 0.6s ease-out both;
}
.prayer-card:nth-child(1) { animation-delay: 0.6s; }
.prayer-card:nth-child(2) { animation-delay: 0.7s; }
.prayer-card:nth-child(3) { animation-delay: 0.8s; }
.prayer-card:nth-child(4) { animation-delay: 0.9s; }
.prayer-card:nth-child(5) { animation-delay: 1.0s; }
.prayer-card:nth-child(6) { animation-delay: 1.1s; }

/* ---- RESPONSIVE ---- */

@media (max-width: 520px) {
    .prayer-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .hero {
        padding: 1rem 1.25rem 2rem;
    }

    .logo-mark {
        width: 65px;
        height: 76px;
    }

    .next-prayer-time {
        font-size: 2rem;
    }

    .jumuah-card {
        flex-direction: column;
        gap: 0.6rem;
    }

    .jumuah-divider {
        width: 40px;
        height: 1px;
    }
}

@media (max-width: 360px) {
    .prayer-grid {
        grid-template-columns: 1fr;
        max-width: 240px;
    }
}

@media (min-width: 768px) {
    .prayer-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero {
        padding: 4.5rem 2rem 3rem;
    }
}

/* ---- UTILITY: HIDE EMPTY EXTRAS ---- */
.prayer-extra:empty {
    display: none;
}
