/* Shared prayer icons + bilingual names (Family / Masjid polish) */

.prayer-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
    position: relative;
}

.prayer-emoji::before {
    content: '';
    width: 58%;
    height: 58%;
    background-color: currentColor;
    -webkit-mask: var(--prayer-icon) center / contain no-repeat;
    mask: var(--prayer-icon) center / contain no-repeat;
}

.prayer-emoji-fajr { background: #ede7f6; color: #6a4c9c; --prayer-icon: url('/images/prayer/fajr.svg'); }
.prayer-emoji-sunrise { background: #ffe0b2; color: #ef6c00; --prayer-icon: url('/images/prayer/sunrise.svg'); }
.prayer-emoji-dhuhr { background: #fff8e1; color: #f9a825; --prayer-icon: url('/images/prayer/dhuhr.svg'); }
.prayer-emoji-asr { background: #ffecb3; color: #fb8c00; --prayer-icon: url('/images/prayer/asr.svg'); }
.prayer-emoji-maghrib { background: #ffcdd2; color: #e53935; --prayer-icon: url('/images/prayer/maghrib.svg'); }
.prayer-emoji-isha { background: #e8eaf6; color: #3949ab; --prayer-icon: url('/images/prayer/isha.svg'); }
.prayer-emoji-jumaa { background: #e0f2f1; color: #00897b; --prayer-icon: url('/images/prayer/jumaa.svg'); }
.prayer-emoji-tasks { background: #e8f5e9; color: #43a047; --prayer-icon: url('/images/prayer/tasks.svg'); }

.prayer-emoji-sm {
    width: 1.75rem;
    height: 1.75rem;
}

.prayer-emoji-md {
    width: 2.4rem;
    height: 2.4rem;
}

.prayer-emoji-lg {
    width: 3rem;
    height: 3rem;
}

.prayer-name-bilingual {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.prayer-name-en {
    font-weight: 700;
}

.prayer-name-ar {
    font-family: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;
    font-weight: 700;
    font-size: 1.12em;
    color: var(--highlight);
    line-height: 1.05;
    letter-spacing: 0;
}

.prayer-name-row {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

[data-theme="dark"] .prayer-name-ar {
    color: #4dd0e1;
}

[data-theme="dark"] .prayer-emoji {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.prayer-heading-lg {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.prayer-heading-lg .prayer-emoji {
    width: 3rem;
    height: 3rem;
}

.prayer-heading-lg .prayer-name-en {
    font-size: 1.35rem;
}

.list-group-item .prayer-name-row {
    gap: 0.65rem;
}

/* Time-of-day atmosphere (Family / Masjid). html[data-daypart] beats page :root. */
:root {
    --daypart-wash: rgba(0, 173, 181, 0.10);
    --daypart-wash-2: rgba(0, 173, 181, 0.06);
    --highlight-deep: #008b94;
    --daypart-border: rgba(0, 173, 181, 0.18);
}

html[data-daypart="fajr"] {
    --primary-bg: #ebe8f6;
    --secondary-bg: #f4f2fb;
    --row-bg: #e4dff3;
    --highlight: #7e57c2;
    --highlight-deep: #5e35b1;
    --daypart-wash: rgba(126, 87, 194, 0.14);
    --daypart-wash-2: rgba(126, 87, 194, 0.07);
    --daypart-border: rgba(126, 87, 194, 0.22);
}

html[data-daypart="sunrise"] {
    --primary-bg: #fff3e8;
    --secondary-bg: #fffaf4;
    --row-bg: #ffe8d0;
    --highlight: #ef6c00;
    --highlight-deep: #e65100;
    --daypart-wash: rgba(239, 108, 0, 0.14);
    --daypart-wash-2: rgba(239, 108, 0, 0.07);
    --daypart-border: rgba(239, 108, 0, 0.22);
}

html[data-daypart="dhuhr"] {
    --primary-bg: #eaf6f8;
    --secondary-bg: #f5fbfd;
    --row-bg: #e3f4f6;
    --highlight: #00adb5;
    --highlight-deep: #008b94;
    --daypart-wash: rgba(0, 173, 181, 0.12);
    --daypart-wash-2: rgba(0, 173, 181, 0.06);
    --daypart-border: rgba(0, 173, 181, 0.20);
}

html[data-daypart="asr"] {
    --primary-bg: #fbf6ea;
    --secondary-bg: #fdfaf3;
    --row-bg: #f3ead4;
    --highlight: #c9a227;
    --highlight-deep: #a68512;
    --daypart-wash: rgba(201, 162, 39, 0.16);
    --daypart-wash-2: rgba(201, 162, 39, 0.07);
    --daypart-border: rgba(201, 162, 39, 0.26);
}

html[data-daypart="maghrib"] {
    --primary-bg: #f8ecec;
    --secondary-bg: #fdf6f6;
    --row-bg: #f0dcdc;
    --highlight: #c45c5c;
    --highlight-deep: #a84848;
    --daypart-wash: rgba(196, 92, 92, 0.14);
    --daypart-wash-2: rgba(196, 92, 92, 0.07);
    --daypart-border: rgba(196, 92, 92, 0.22);
}

html[data-daypart="isha"] {
    --primary-bg: #e8eef6;
    --secondary-bg: #f3f6fa;
    --row-bg: #dce4f0;
    --highlight: #3949ab;
    --highlight-deep: #283593;
    --daypart-wash: rgba(57, 73, 171, 0.14);
    --daypart-wash-2: rgba(57, 73, 171, 0.07);
    --daypart-border: rgba(57, 73, 171, 0.22);
}

html[data-daypart],
html[data-daypart] body {
    transition: background 0.8s ease;
}

html[data-daypart] .next-prayer-banner {
    border-color: var(--daypart-border);
    background: var(--row-bg);
    transition: background 0.8s ease, border-color 0.8s ease;
}

html[data-daypart] .next-prayer-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--daypart-wash) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

html[data-daypart] .prayer-card,
html[data-daypart] .masjid-prayer-card {
    border-color: var(--daypart-border);
}

html[data-daypart] .prayer-card:not(.current)::after,
html[data-daypart] .masjid-prayer-card:not(.current)::after {
    background: var(--highlight);
    opacity: 0.35;
}

html[data-daypart] .prayer-card.current,
html[data-daypart] .masjid-prayer-card.current {
    background: linear-gradient(135deg, var(--highlight) 0%, var(--highlight-deep) 100%);
    box-shadow: 0 8px 22px var(--daypart-wash);
}

html[data-daypart] .prayer-card.current .prayer-card-kids {
    background: linear-gradient(160deg, var(--highlight) 0%, var(--highlight-deep) 100%);
}

html[data-daypart] .prayer-row.current,
html[data-daypart] .prayer-table tr.current td {
    background: linear-gradient(135deg, var(--highlight) 0%, var(--highlight-deep) 100%) !important;
}

html[data-daypart] .countdown-progress-track {
    background: var(--daypart-wash);
}

html[data-daypart] .countdown-progress:not(.urgent):not(.critical):not(.iqama) .countdown-progress-fill {
    background: linear-gradient(90deg, var(--highlight-deep) 0%, var(--highlight) 50%, var(--highlight) 100%);
    box-shadow: 0 0 10px var(--daypart-wash);
}

html[data-daypart] .countdown-live-dot:not(.urgent):not(.critical) {
    background: var(--highlight);
}

html[data-daypart] .countdown-display:not(.urgent):not(.critical) {
    color: var(--highlight);
}

@media (prefers-reduced-motion: reduce) {
    html[data-daypart],
    html[data-daypart] body,
    html[data-daypart] .next-prayer-banner {
        transition: none;
    }
}

/* Azan / countdown / iqama / dua stage — matches Family & Masjid cards */
.prayer-stage-overlay,
#azanOverlay,
#azan-overlay,
#iqamaOverlay,
#duaOverlay,
#azan-dua-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 1.25rem;
    overflow: hidden;
    color: var(--text-primary, #1a2b3c);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(ellipse 70% 45% at 100% 0%, var(--daypart-wash, rgba(0, 173, 181, 0.10)) 0%, transparent 55%),
        radial-gradient(ellipse 60% 40% at 0% 100%, var(--daypart-wash-2, rgba(0, 173, 181, 0.06)) 0%, transparent 50%),
        linear-gradient(180deg, var(--primary-bg, #eaf6f8) 0%, var(--secondary-bg, #f5fbfd) 100%);
}

.prayer-stage-overlay.active,
#azanOverlay.active,
#azan-overlay.active,
#iqamaOverlay.active,
#duaOverlay.active,
#azan-dua-overlay.active {
    display: flex;
}

.prayer-stage-overlay::before,
#azanOverlay::before,
#azan-overlay::before,
#iqamaOverlay::before,
#duaOverlay::before,
#azan-dua-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%2300adb5' stroke-width='1.1' opacity='0.13'%3E%3Crect x='24' y='24' width='32' height='32' rx='1.5'/%3E%3Crect x='24' y='24' width='32' height='32' rx='1.5' transform='rotate(45 40 40)'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 80px 80px;
}

.azan-effect-slideshow,
#azan-effect-slideshow {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.prayer-stage-card,
.azan-content,
.dua-content {
    position: relative;
    z-index: 2;
    width: min(34rem, 92vw);
    max-height: 92vh;
    overflow: auto;
    text-align: center;
    padding: 1.75rem 2rem 1.6rem;
    border-radius: 22px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--daypart-border, rgba(0, 173, 181, 0.18));
    box-shadow: 0 14px 40px var(--daypart-wash, rgba(0, 80, 100, 0.08));
}

.prayer-stage-card::before,
.azan-content::before,
.dua-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    border-radius: 22px 22px 0 0;
    background: linear-gradient(90deg, var(--highlight-deep, #008b94), var(--highlight, #00adb5));
}

.azan-calligraphy {
    font-family: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;
    font-weight: 700;
    font-size: clamp(2.1rem, 6.5vw, 3.3rem);
    line-height: 1.25;
    color: var(--highlight, #00adb5);
    margin: 0.15rem 0 0.35rem;
}

.azan-title-block {
    margin-bottom: 0.35rem;
}

.azan-title,
.dua-title {
    font-size: clamp(0.95rem, 2.2vw, 1.15rem);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary, #6b7c8a);
    text-shadow: none;
    margin: 0;
}

.azan-title-ar {
    font-family: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;
    font-weight: 700;
    font-size: clamp(1.35rem, 3.4vw, 1.85rem);
    color: var(--highlight, #00adb5);
    line-height: 1.2;
    margin-top: 0.15rem;
}

.azan-countdown-ring {
    --azan-left: 60;
    width: 8.6rem;
    height: 8.6rem;
    margin: 0.85rem auto 0.7rem;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    background:
        conic-gradient(var(--highlight, #00adb5) calc(var(--azan-left) * 6deg), var(--row-bg, #e3f4f6) 0);
    box-shadow: 0 0 0 8px var(--daypart-wash, rgba(0, 173, 181, 0.12));
}

.azan-countdown-ring::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6.7rem;
    height: 6.7rem;
    border-radius: 50%;
    background: var(--card-bg, #ffffff);
    z-index: 0;
}

.azan-countdown-ring {
    position: relative;
}

.azan-countdown {
    position: relative;
    z-index: 1;
    font-size: 2.85rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--highlight, #00adb5);
    line-height: 1;
    text-shadow: none;
    animation: none;
    margin: 0;
}

.azan-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    margin: 0.35rem 0 0.2rem;
}

.azan-prayer-icon.prayer-emoji,
.azan-identity .prayer-emoji {
    width: 3.4rem;
    height: 3.4rem;
}

.azan-prayer-name {
    font-size: clamp(1.7rem, 4.4vw, 2.4rem);
    font-weight: 800;
    color: var(--text-primary, #1a2b3c);
    text-shadow: none;
    margin: 0;
}

.azan-prayer-name .prayer-name-en {
    font-size: 1em;
}

.azan-prayer-name .prayer-name-ar {
    font-size: 1.18em;
}

.azan-time {
    font-size: clamp(1.15rem, 2.6vw, 1.55rem);
    font-weight: 700;
    color: var(--text-secondary, #6b7c8a);
    text-shadow: none;
    margin: 0.2rem 0 0.45rem;
    font-variant-numeric: tabular-nums;
}

.azan-subtitle {
    font-size: clamp(0.95rem, 2vw, 1.15rem);
    color: var(--text-secondary, #6b7c8a);
    opacity: 1;
    text-shadow: none;
    margin-top: 0.35rem;
}

.azan-waves {
    width: 100%;
    max-width: 220px;
    height: 52px;
    margin: 0.45rem auto 0.15rem;
    display: none;
    justify-content: center;
    align-items: flex-end;
    gap: 5px;
}

.azan-wave {
    width: 8px;
    background: var(--highlight, #00adb5);
    border-radius: 8px;
    animation: azanWave 1.2s ease-in-out infinite;
}

.azan-wave:nth-child(1) { animation-delay: 0s; }
.azan-wave:nth-child(2) { animation-delay: 0.1s; }
.azan-wave:nth-child(3) { animation-delay: 0.2s; }
.azan-wave:nth-child(4) { animation-delay: 0.3s; }
.azan-wave:nth-child(5) { animation-delay: 0.4s; }
.azan-wave:nth-child(6) { animation-delay: 0.3s; }
.azan-wave:nth-child(7) { animation-delay: 0.2s; }
.azan-wave:nth-child(8) { animation-delay: 0.1s; }

@keyframes azanWave {
    0%, 100% { height: 14px; }
    50% { height: 46px; }
}

#azanOverlay.is-countdown .azan-countdown-ring,
#azan-overlay.is-countdown .azan-countdown-ring,
#duaOverlay.active .dua-countdown-ring,
#azan-dua-overlay.active .dua-countdown-ring {
    display: flex;
}

#azanOverlay.is-playing .azan-waves,
#azan-overlay.is-playing .azan-waves,
#iqamaOverlay.active .azan-waves {
    display: flex;
}

#azanOverlay.has-photos .azan-content,
#azan-overlay.has-photos .azan-content {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
}

.azan-close-btn,
.dua-close-btn,
#azan-exit-btn,
#azan-dua-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 100001;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--daypart-border, rgba(0, 173, 181, 0.22));
    background: var(--card-bg, #ffffff);
    color: var(--text-secondary, #6b7c8a);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px var(--daypart-wash, rgba(0, 80, 100, 0.08));
}

.azan-close-btn:hover,
.dua-close-btn:hover,
#azan-exit-btn:hover,
#azan-dua-close:hover {
    background: #fff1f1;
    border-color: rgba(229, 57, 53, 0.35);
    color: #e53935;
    transform: none;
}

.dua-text,
#azan-dua-text {
    font-size: clamp(1.15rem, 2.4vw, 1.55rem);
    line-height: 1.75;
    color: var(--text-primary, #1a2b3c);
    background: var(--row-bg, #e3f4f6);
    border: 1px solid var(--daypart-border, rgba(0, 173, 181, 0.18));
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    margin: 0.75rem 0 0.35rem;
    white-space: pre-wrap;
    max-height: 38vh;
    overflow: auto;
}

.dua-text[dir="rtl"],
.dua-text.is-arabic,
#azan-dua-text[dir="rtl"],
#azan-dua-text.is-arabic {
    font-family: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;
    font-size: clamp(1.35rem, 2.8vw, 1.85rem);
}

.dua-countdown,
#azan-dua-countdown {
    font-size: 1rem;
    color: var(--text-secondary, #6b7c8a);
    margin-top: 0.65rem;
}

#duaSecondsLeft,
#azan-dua-seconds {
    font-weight: 800;
    color: var(--highlight, #00adb5);
}

[data-theme="dark"] .prayer-stage-card,
[data-theme="dark"] .azan-content,
[data-theme="dark"] .dua-content,
[data-theme="dark"] #azanOverlay.has-photos .azan-content,
[data-theme="dark"] #azan-overlay.has-photos .azan-content {
    background: var(--card-bg, #0f3460);
}

[data-theme="dark"] .azan-countdown-ring::after {
    background: var(--card-bg, #0f3460);
}

[data-theme="dark"] .azan-prayer-name,
[data-theme="dark"] .dua-text,
[data-theme="dark"] #azan-dua-text {
    color: var(--text-primary, #ffffff);
}

@media (prefers-reduced-motion: reduce) {
    .azan-wave { animation: none; height: 28px; }
}

