:root {
    --bg: #09090b;
    --surface: #18181b;
    --accent: #10b981;
    --accent-dim: rgba(16, 185, 129, 0.1);
    --text-main: #fafafa;
    --text-muted: #a1a1aa;
    --border: rgba(255, 255, 255, 0.1);
    --warn: #fbbf24;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* padding: 12px; */
    line-height: 1.4;
}

.container {
    width: 100%;
    max-width: 1100px; /* Aligned for the new top status */
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* --- HEADER & NAVIGATION (Original) --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
}

.branding h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 1px;
}

.month-btn {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid var(--accent);
    padding: 6px 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.month-btn:hover {
    background: var(--accent);
    color: white;
}

/* --- TOP STATUS: CLOCK & ZAWAL (New Logic) --- */
.top-status {
    display: flex;
    justify-content: center; 
    align-items: center;
    gap: 200px;
    margin: 5px 0;
    min-height: 55px;
    width: 100%;
    padding: 0 10px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* This class is toggled via JS when Zawal starts */
.top-status.zawal-active {
    justify-content: space-between;
}

#current-time {
    font-size: 2.5rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    letter-spacing: -2px;
    line-height: 1;
}

.zawal-notice {
    display: none; /* Controlled by JS */
    justify-content: center;
    background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%);
    padding: 10px 15px;
    border-radius: 20px;
    flex: 0 1 480px; /* Desktop width limit */
    box-shadow: 0 10px 25px rgba(185, 28, 28, 0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

.zawal-main-text { 
    font-size: 0.95rem; 
    font-weight: 800; 
    letter-spacing: 1px; 
    color: #fff; 
    margin-bottom: 4px; 
    text-align: center;
}

.zawal-sub-text { 
    font-size: 0.90rem; 
    font-weight: 700; 
    color: #fff; 
    text-align: center; 
}

#zawal-countdown { 
    font-family: monospace; 
    background: rgba(0,0,0,0.2); 
    padding: 2px 8px; 
    border-radius: 4px; 
}

/* --- MOBILE SPECIFIC FIX --- */
@media (max-width: 768px) {
    .top-status {
        flex-direction: column; /* Stack clock and zawal vertically */
        gap: 15px; /* Smaller gap for mobile */
        min-height: auto;
        padding: 10px;
    }

    .top-status.zawal-active {
        justify-content: center; /* Center everything on mobile */
    }

    .zawal-notice {
        flex: 1 1 auto; /* Allow box to take full mobile width */
        width: 100%;    /* Force full width minus container padding */
        max-width: 100%; 
        padding: 12px;
    }

    #current-time {
        font-size: 2.2rem; /* Slightly smaller for mobile screens */
    }
}

/* --- HERO NEXT PRAYER BOX (Original) --- */
.hero {
    background: linear-gradient(145deg, #1e1e1e, #09090b);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.hero-name {
    font-size: 1.6rem;
    font-weight: 800;
}

#countdown-timer {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--warn);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

/* --- PRAYER LIST (Original) --- */
.prayer-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prayer-row {
    background: var(--surface);
    border-radius: 18px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* border: 1px solid transparent; */
    transition: transform 0.2s ease;
	background: linear-gradient(145deg, #1e1e1e, #09090b);
    border: 1px solid var(--border);
}

.prayer-row.active {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.05);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
}

.p-label-text { font-size: 1.1rem; font-weight: 700; }
.p-sub { display: block; font-size: 0.75rem; color: var(--text-muted); }
.p-timings { display: flex; gap: 24px; text-align: right; }
.timing-box { display: flex; flex-direction: column; }
.t-label { font-size: 0.6rem; text-transform: uppercase; color: var(--text-muted); font-weight: 800; margin-bottom: 2px; }
.t-val { font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Footer & Jummah Logic */
footer {
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    margin-top: auto;
}

.jummah-container {
    width: 100%;
}

.jummah-single {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--accent);
}

.jummah-dual {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 0.7rem;
    font-weight: 600;
}

.jummah-dual strong {
    color: var(--accent);
    font-size: 1.1rem;
}

/* --- MODERN EVENT SECTION (Original) --- */
.events-blend-section { padding: 10px 0; background: transparent; font-family: 'Inter', sans-serif; }
.events-max-container { max-width: 1200px; margin: 0 auto; padding: 0 3px; }
.section-heading { font-size: 1.6rem; font-weight: 800; color: #fafafa; margin-bottom: 20px; letter-spacing: -0.5px; }
.events-grid-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.event-card-v4 {
    display: flex; align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(134, 239, 172, 0.3);
    border-radius: 16px; padding: 6px; height: 150px;
    transition: all 0.3s ease; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.event-card-v4:hover { border-color: rgb(134, 239, 172); background: rgba(134, 239, 172, 0.08); transform: translateY(-3px); }

.date-side {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-width: 70px; border-right: 1px solid rgba(255, 255, 255, 0.1);
    margin-right: 10px; padding-right: 10px;
}
.date-side .day-name { font-size: 0.75rem; font-weight: 600; color: #86efac; text-transform: uppercase; margin-bottom: 2px; }
.date-side .day-num { font-size: 1.6rem; font-weight: 800; color: #fff; line-height: 1; }
.date-side .month { font-size: 0.85rem; font-weight: 600; color: #fff; opacity: 0.8; }
.date-side .h-date { font-size: 0.65rem; color: #94a3b8; margin-top: 8px; text-align: center; line-height: 1.2; font-weight: 500; }

.info-side { flex: 1; display: flex; flex-direction: column; justify-content: space-between; height: 100%; overflow: hidden; }
.event-name { font-size: 1.05rem; font-weight: 700; color: #fff; margin: 0 0 4px 0; line-height: 1.2; }
.event-snippet { font-size: 0.8rem; color: #cbd5e1; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 5px; }
.event-meta-footer { font-size: 0.75rem; font-weight: 600; color: #86efac; display: flex; align-items: center; gap: 5px; }

.img-frame-clickable {
    width: 60px; height: 60px; margin-left: 12px; border-radius: 10px;
    overflow: hidden; position: relative; cursor: pointer; flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.1);
}
.img-frame-clickable img { width: 100%; height: 100%; object-fit: cover; }
.hover-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; opacity: 0; transition: 0.2s; }
.img-frame-clickable:hover .hover-overlay { opacity: 1; }

/* --- LIGHTBOX MODAL (Original) --- */
.lightbox-modal {
    display: none; position: fixed; z-index: 10000; left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95); align-items: center; justify-content: center;
}
.lightbox-content { max-width: 90%; max-height: 85%; border-radius: 12px; box-shadow: 0 0 30px rgba(0,0,0,0.5); }
.close-btn { position: absolute; top: 30px; right: 40px; color: #fff; font-size: 45px; cursor: pointer; font-weight: 300; }

/* --- DESKTOP GRID ADJUSTMENTS (Original) --- */
@media (min-width: 768px) {
    .prayer-list {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 12px;
    }
    .prayer-row {
        flex-direction: column;
        text-align: center;
        padding: 15px 10px;
        height: 180px;
        justify-content: space-between;
    }
    .p-timings {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        width: 100%;
    }
}

/* --- MOBILE FIX FOR EVENTS ONLY --- */
@media (max-width: 768px) {
    /* Stack tiles vertically instead of 3 columns */
    .events-grid-3col {
        grid-template-columns: 1fr; 
        gap: 15px;
    }

    .event-card-v4 {
        height: auto; /* Allow height to grow with text */
        min-height: 120px;
        flex-direction: row; /* Keep date and info side-by-side */
        align-items: flex-start;
        padding: 12px;
    }

    .date-side {
        min-width: 60px;
        margin-right: 10px;
        padding-right: 8px;
    }

    .date-side .day-num {
        font-size: 1.3rem;
    }

    .event-name {
        font-size: 0.95rem;
    }

    .event-snippet {
        -webkit-line-clamp: 3; /* Show slightly more text if needed */
        font-size: 0.75rem;
    }

    /* Make the image a bit smaller on mobile to save space */
    .img-frame-clickable {
        width: 60px;
        height: 60px;
        margin-left: 8px;
    }
}

.no-timetable-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 70vh;
    text-align: center;
    color: #94a3b8;
}

.no-timetable-wrapper h2 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

/* =========================================
   FOOTER STYLES (Sunrise & Jummah) - DARK THEME
   ========================================= */

#footer-jummah {
    /* Layout & Spacing */
    margin-top: 25px;
    padding: 20px 25px;
    
    /* Visuals - Your Requested Dark Gradient */
    background: linear-gradient(145deg, #1e1e1e, #09090b);
    border: 1px solid rgba(255, 255, 255, 0.1); /* Subtle border for definition */
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4); /* Deeper shadow for dark bg */
    
    /* Base Text Color */
    color: #d1d5db; /* Light grey for labels */
    
    /* Font settings for consistency */
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Flex Container */
.footer-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 20px;
}

/* --- LEFT SIDE (Sunrise) --- */
.footer-left {
    display: flex;
    align-items: center;
    font-size: 1rem; /* Matched with Jummah */
    font-weight: 500;
    color: #9ca3af; /* Muted label color */
}

/* --- RIGHT SIDE (Jummah) --- */
.footer-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Single Jummah Block */
.jummah-single {
    font-size: 1rem; /* Matched with Sunrise */
    font-weight: 600;
    color: #ffffff; /* White text */
}

/* Dual Jummah Block */
.jummah-dual {
    display: flex;
    align-items: center;
    font-size: 1rem; /* Matched with Sunrise */
    font-weight: 600;
    color: #ffffff;
}

/* Spacing between Jummah 1 and 2 on Desktop */
.jummah-dual span:first-of-type {
    margin-right: 15px;
}

/* Visual Separator between Jummah 1 and 2 */
.jummah-dual span:first-of-type::after {
    content: "•";
    color: rgba(255, 255, 255, 0.3);
    margin-left: 15px;
    font-weight: normal;
}

/* Make the Times (Bold) pop out */
.jummah-single strong, 
.jummah-dual strong,
.footer-left strong {
    color: #ffffff; /* Pure white for times */
    margin-left: 4px;
    font-weight: 700;
}


/* =========================================
   RESPONSIVE MOBILE STYLES
   ========================================= */
@media (max-width: 600px) {
    
    #footer-jummah {
        padding: 15px 20px;
        margin-top: 15px;
    }

    .footer-wrapper {
        /* Stack Vertically on Mobile */
        flex-direction: column; 
        text-align: center;
        gap: 15px;
    }

    .footer-left, .footer-right {
        width: 100%;
        justify-content: center; /* Center text inside boxes */
        text-align: center;
    }

    /* On mobile, stack Jummah 1 and 2 vertically to fit the screen */
    .jummah-dual {
        flex-direction: column;
        align-items: center;
        gap: 8px; /* Space between Jummah 1 and Jummah 2 */
        font-size: 0.95rem; /* Slightly smaller if very long text */
    }

    /* Hide the dot separator since we are stacking */
    .jummah-dual span:first-of-type::after {
        display: none;
    }
    
    /* Remove right margin from first span since we are centered */
    .jummah-dual span:first-of-type {
        margin-right: 0;
    }
}