/* Modern theme — flat, minimal, one accent. Fully self-contained (the only
   stylesheet loaded for this theme), so it also carries the shared nav and
   footer chrome plus the classes used by includes/notifications.php and
   includes/zuhrchangebanner.php. Palette from skins/*.css (fallbacks inline).

   Layout contract: at 992px+ the board fills the viewport exactly with no
   page scroll (only the two bottom panels scroll internally if they must),
   and type scales with viewport height so a TV renders larger than a
   laptop. Below 992px it's a normal stacked, scrolling page. */

html, body {
    margin: 0;
    padding: 0;
    background: var(--md-bg, #0e1116);
    color: var(--md-text, #e6edf3);
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
a:link, a:visited, a:hover, a:active {
    color: var(--md-accent, #2dd4bf);
    text-decoration: none;
}
.md-num { font-family: 'Space Grotesk', 'Inter', sans-serif; font-variant-numeric: tabular-nums; }

/* ---------- Nav (shared markup from navigation.php) ---------- */
#nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: var(--md-bg, #0e1116);
    border-bottom: 1px solid var(--md-line, rgba(255, 255, 255, .09));
}
#nav li { float: right; }
#nav li a {
    display: block;
    color: var(--md-muted, #8b98a5);
    text-align: center;
    padding: 0 14px;
    line-height: 48px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
}
#nav li a:hover:not(.active) { color: var(--md-text, #e6edf3); background: var(--md-surface, #161b22); }
#nav li span { display: block; text-align: center; padding: 0 20px; line-height: 48px; }
#nav .active { background: transparent; box-shadow: inset 0 -2px 0 var(--md-accent, #2dd4bf); }
#nav .active a { color: var(--md-text, #e6edf3); }
#nav #nav_name {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    text-transform: none;
    letter-spacing: -.01em;
    font-size: 17px;
    line-height: 48px;
    color: var(--md-text, #e6edf3);
    text-align: left;
}
#nav #myname { width: 500px; float: left; margin: 0 0 0 20px; }

#toggle { display: none; width: 26px; height: 0; margin: 10px auto; }
#toggle span:after, #toggle span:before { content: ""; position: absolute; left: 0; top: -8px; }
#toggle span:after { top: 8px; }
#toggle span { position: relative; display: block; }
#toggle span, #toggle span:after, #toggle span:before {
    width: 100%;
    height: 2px;
    background-color: var(--md-text, #e6edf3);
    transition: all .3s;
    backface-visibility: hidden;
    border-radius: 2px;
}
#toggle.on span { background-color: transparent; }
#toggle.on span:before { transform: rotate(45deg) translate(5px, 5px); }
#toggle.on span:after { transform: rotate(-45deg) translate(7px, -8px); }
#toggle.on + #menu { opacity: 1; visibility: visible; }
.show-menu { text-decoration: none; text-align: center; padding: 10px 0; display: none; }
input[type=checkbox] { display: none; }
input[type=checkbox]:checked ~ #menu { display: block; }

@media screen and (max-width: 975px) {
    #nav ul { position: static; display: none; }
    #nav li { margin-bottom: 1px; }
    #nav ul li, #nav li a { width: 100%; }
    .show-menu { display: block; }
    #toggle { display: block; }
    #nav #myname { width: 100%; text-align: center; }
    #nav #nav_name { font-size: 15px; line-height: 36px; text-align: center; }
}

/* ---------- Footer (shared markup from footer.php) — static, never fixed ---------- */
footer.footer {
    width: 100%;
    box-sizing: border-box;
    color: var(--md-muted, #8b98a5);
    font-size: 12px;
    background: var(--md-bg, #0e1116);
    border-top: 1px solid var(--md-line, rgba(255, 255, 255, .09));
    padding: 10px 16px;
    text-align: center;
}
footer.footer a { color: var(--md-muted, #8b98a5); }
footer.footer a:hover { color: var(--md-accent, #2dd4bf); }
footer.footer { position: relative; }
.mb-switchers { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); display: flex; gap: 12px; line-height: 0; }
.mb-switchers a { color: inherit; opacity: .45; }
.mb-switchers a:hover { opacity: 1; color: var(--md-accent, #2dd4bf); }
.mb-switchers svg { width: 18px; height: 18px; display: block; fill: currentColor; }
@media screen and (max-width: 975px) {
    footer.footer { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; min-height: 44px; }
    footer.footer .mb-footer-info { display: none; }
}

/* ---------- Board ---------- */
.md-board {
    max-width: 1900px;
    width: 100%;
    margin: 0 auto;
    padding: clamp(10px, 1.6vh, 26px) clamp(14px, 2vw, 40px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.6vh, 26px);
}
.md-hidden { display: none; }

/* Top line */
.md-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    font-size: clamp(.8rem, 1.6vh, 1.15rem);
    color: var(--md-muted, #8b98a5);
}
.md-brand-name {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.25em;
    color: var(--md-text, #e6edf3);
    letter-spacing: -.01em;
}
.md-brand-area { margin-left: .75em; }
.md-sep { margin: 0 .6em; opacity: .5; }

/* Hero: clock | next */
.md-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: clamp(16px, 3vw, 60px);
}
.md-clock {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: clamp(3rem, 13vh, 11rem);
    line-height: .95;
    letter-spacing: -.03em;
}
.md-next {
    min-width: clamp(220px, 22vw, 420px);
    text-align: right;
}
.md-next-label {
    text-transform: uppercase;
    letter-spacing: .16em;
    font-size: clamp(.65rem, 1.3vh, .95rem);
    font-weight: 600;
    color: var(--md-muted, #8b98a5);
}
.md-next-name {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3.6vh, 3rem);
    line-height: 1.1;
    color: var(--md-accent, #2dd4bf);
}
.md-next-name small { font-family: 'Inter', sans-serif; font-weight: 600; font-size: .45em; color: var(--md-muted, #8b98a5); margin-left: .4em; }
.md-next-count {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    font-size: clamp(1.6rem, 4.6vh, 4rem);
    line-height: 1.05;
}
.md-next-meta { font-size: clamp(.75rem, 1.5vh, 1.05rem); color: var(--md-muted, #8b98a5); margin-top: 2px; }
.md-progress {
    height: 4px;
    background: var(--md-surface-2, #1d242d);
    border-radius: 2px;
    margin-top: clamp(6px, 1vh, 12px);
    overflow: hidden;
}
.md-progress-bar { height: 100%; width: 0; background: var(--md-accent, #2dd4bf); transition: width 1s linear; }

/* Prayer columns: no boxes, hairline separators */
.md-prayers {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    border-top: 1px solid var(--md-line, rgba(255, 255, 255, .09));
    border-bottom: 1px solid var(--md-line, rgba(255, 255, 255, .09));
}
.md-prayer {
    position: relative;
    padding: clamp(10px, 2vh, 28px) clamp(10px, 1.4vw, 28px);
    border-left: 1px solid var(--md-line, rgba(255, 255, 255, .09));
    transition: background-color .3s;
}
.md-prayer:first-child { border-left: 0; }
.md-prayer-name {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: clamp(.9rem, 2.2vh, 1.5rem);
    font-weight: 700;
    color: var(--md-muted, #8b98a5);
    margin-bottom: clamp(4px, 1vh, 12px);
}
.md-prayer-adhan {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: clamp(1.8rem, 6vh, 5.4rem);
    line-height: 1;
    letter-spacing: -.02em;
}
.md-prayer-salaah {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    font-size: clamp(1rem, 2.6vh, 2.2rem);
    margin-top: clamp(4px, 1vh, 12px);
    color: var(--md-text, #e6edf3);
}
.md-prayer-salaah span:not([data-field]) {
    font-family: 'Inter', sans-serif;
    font-size: .5em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--md-muted, #8b98a5);
    margin-right: .6em;
    vertical-align: middle;
}
.md-prayer-jumuah .md-prayer-adhan { color: var(--md-muted, #8b98a5); }

/* Next salaah (set by script.js): accent top rule + accent time */
.md-prayer.is-next { background: var(--md-surface, #161b22); box-shadow: inset 0 3px 0 var(--md-accent, #2dd4bf); }
.md-prayer.is-next .md-prayer-adhan { color: var(--md-accent, #2dd4bf); }

/* Current salaah — js/livetime.js puts .vibrate-1 on the .azan-checker's
   parent, i.e. this column. Amber dot + "now" beside the name. */
.md-prayer.vibrate-1 .md-prayer-name::after {
    content: "now";
    display: inline-block;
    margin-left: .8em;
    padding: .15em .6em;
    border-radius: 999px;
    background: var(--md-now, #f59e0b);
    color: #1a1200;
    font-size: .85em;
    letter-spacing: .1em;
}

/* 24h timeline */
.md-timeline { padding: 0 clamp(4px, .6vw, 12px); }
.md-track {
    position: relative;
    height: 2px;
    background: var(--md-surface-2, #1d242d);
    margin: clamp(14px, 2.4vh, 30px) 0 clamp(18px, 3vh, 36px);
}
.md-track-fill { position: absolute; left: 0; top: 0; height: 100%; width: 0; background: var(--md-line, rgba(255, 255, 255, .09)); }
/* Makrooh windows (sunrise->Ishraaq, Zawal->Zuhr start): a thicker red
   strip so it reads clearly against the otherwise-thin track. */
.md-track-band-red { position: absolute; top: 50%; transform: translateY(-50%); height: 6px; min-width: 4px; border-radius: 3px; background: rgba(239, 68, 68, .65); }
.md-marker { position: absolute; top: 50%; transform: translate(-50%, -50%); text-align: center; }
.md-marker i {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--md-text, #e6edf3);
    margin: 0 auto;
}
.md-marker span {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: clamp(.6rem, 1.3vh, .9rem);
    font-weight: 600;
    color: var(--md-muted, #8b98a5);
}
.md-marker-minor i { width: 6px; height: 6px; background: var(--md-muted, #8b98a5); }
.md-marker-minor span { top: -22px; }
.md-now { position: absolute; top: 50%; transform: translate(-50%, -50%); transition: left 60s linear; }
.md-now i {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--md-now, #f59e0b);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, .25);
}
.md-track-scale {
    display: flex;
    justify-content: space-between;
    font-size: clamp(.55rem, 1.1vh, .8rem);
    color: var(--md-muted, #8b98a5);
    opacity: .6;
    margin-top: clamp(2px, .6vh, 8px);
}

/* Info row */
.md-info {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: clamp(8px, 1vw, 20px);
}
.md-info-item {
    background: var(--md-surface, #161b22);
    border: 1px solid var(--md-line, rgba(255, 255, 255, .09));
    border-radius: 10px;
    padding: clamp(6px, 1.2vh, 14px) clamp(10px, 1.2vw, 20px);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .6em;
}
.md-info-label { font-size: clamp(.7rem, 1.4vh, 1rem); color: var(--md-muted, #8b98a5); font-weight: 600; }
.md-info-value { font-family: 'Space Grotesk', 'Inter', sans-serif; font-variant-numeric: tabular-nums; font-weight: 700; font-size: clamp(1rem, 2.4vh, 1.9rem); }

/* Bottom panels */
.md-bottom {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: clamp(8px, 1vw, 20px);
}
/* A masjid can turn off either panel (admin/settings.php) -- fill the row
   with whichever one is left rather than leaving an empty column. */
.md-bottom:has(> :only-child) { grid-template-columns: 1fr; }
.md-panel {
    background: var(--md-surface, #161b22);
    border: 1px solid var(--md-line, rgba(255, 255, 255, .09));
    border-radius: 12px;
    padding: clamp(10px, 1.6vh, 20px) clamp(12px, 1.4vw, 24px);
}
.md-panel-title {
    margin: 0 0 clamp(6px, 1vh, 12px);
    font-size: clamp(.7rem, 1.4vh, 1rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--md-muted, #8b98a5);
}
.md-change-list { list-style: none; margin: 0; padding: 0; }
.md-change-list li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1.2em;
    align-items: baseline;
    padding: clamp(4px, .9vh, 10px) 0;
    border-top: 1px solid var(--md-line, rgba(255, 255, 255, .09));
    font-size: clamp(.85rem, 1.8vh, 1.3rem);
}
.md-change-list li:first-child { border-top: 0; }
.md-change-name { font-weight: 600; }
.md-change-date { color: var(--md-muted, #8b98a5); }
.md-change-times { font-family: 'Space Grotesk', 'Inter', sans-serif; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--md-accent, #2dd4bf); }
.md-change-times em { font-style: normal; color: var(--md-muted, #8b98a5); font-weight: 400; margin: 0 .2em; }
.md-empty { margin: 0; color: var(--md-muted, #8b98a5); font-size: clamp(.8rem, 1.6vh, 1.1rem); }

/* Shared includes inside the panels */
.md-changes #notice-container { margin-top: clamp(8px, 1.2vh, 14px); }
.md-changes .snotice {
    margin: 0;
    padding: 8px 12px;
    border-left: 3px solid var(--md-now, #f59e0b);
    background: var(--md-surface-2, #1d242d);
    border-radius: 6px;
    font-family: inherit;
    font-weight: 500;
    text-transform: none;
    line-height: 1.4;
    font-size: clamp(.75rem, 1.5vh, 1.05rem);
    text-align: left;
    color: var(--md-text, #e6edf3);
}
.md-notices #notice-container { display: none; }   /* panel supplies its own heading */
.md-notices .float-box-fluid {
    display: block;
    max-width: none;
    margin: 0 0 clamp(6px, 1vh, 12px);
    padding: clamp(8px, 1.2vh, 14px) clamp(10px, 1vw, 16px);
    background: var(--md-surface-2, #1d242d);
    border: 0;
    border-left: 3px solid var(--md-accent, #2dd4bf);
    border-radius: 6px;
    box-shadow: none;
    text-align: left;
    color: var(--md-text, #e6edf3);
}
.md-notices .card-header {
    margin: 0 0 4px;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    font-size: clamp(.95rem, 2vh, 1.5rem);
    color: var(--md-text, #e6edf3);
}
.md-notices .card-text { margin: 0; font-size: clamp(.8rem, 1.6vh, 1.15rem); line-height: 1.5; color: var(--md-text, #e6edf3); }

/* ---------- Laptop / TV: fill the viewport, no page scroll ---------- */
@media (min-width: 992px) {
    html, body { height: 100%; overflow: hidden; }
    body { display: flex; flex-direction: column; }
    #nav, footer.footer { flex: 0 0 auto; }
    .md-board { flex: 1 1 auto; min-height: 0; }
    .md-top, .md-hero, .md-prayers, .md-timeline, .md-info { flex: 0 0 auto; }
    .md-bottom { flex: 1 1 auto; min-height: 0; }
    .md-panel { min-height: 0; overflow-y: auto; }
}

/* ---------- Mobile / tablet: stacked, scrolling ---------- */
@media (max-width: 991px) {
    .md-top { flex-direction: column; align-items: center; text-align: center; gap: 4px; }
    .md-dates { display: flex; flex-direction: column; align-items: center; line-height: 1.4; }
    .md-sep { display: none; }
    .md-hero { grid-template-columns: 1fr; text-align: center; }
    .md-clock { font-size: clamp(2.6rem, 15vw, 5rem); }
    .md-next { min-width: 0; text-align: center; }
    .md-prayers { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: 1fr; }
    .md-prayer {
        border-left: 0;
        border-top: 1px solid var(--md-line, rgba(255, 255, 255, .09));
        display: grid;
        grid-template-columns: 1fr auto auto;
        align-items: baseline;
        gap: 12px;
        padding: 12px 8px;
    }
    .md-prayer:first-child { border-top: 0; }
    .md-prayer-name { margin: 0; font-size: clamp(1rem, 5vw, 1.4rem); }
    .md-prayer-adhan { font-size: clamp(1.4rem, 7vw, 2.2rem); }
    .md-prayer-salaah { margin: 0; font-size: clamp(.95rem, 4.5vw, 1.3rem); }
    .md-prayer.is-next { box-shadow: inset 3px 0 0 var(--md-accent, #2dd4bf); }
    .md-timeline { display: none; }
    .md-info { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md-bottom { grid-template-columns: 1fr; }
}
