:root {
    --bg-main: #0f4f3d;
    --bg-deep: #0b3e31;
    --bg-card: #176448;
    --bg-card-soft: #2a7a5d;
    --bg-card-light: #3f8d6f;

    --text-main: #ffffff;
    --text-soft: #d9eee5;
    --text-muted: #b8d7ca;

    --gold: #deb046;
    --gold-soft: #ead79e;

    --line: rgba(255, 255, 255, 0.08);
    --shadow: 0 14px 30px rgba(0, 0, 0, 0.18);

    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 18px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg-deep);
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    min-height: 100dvh;
    background:
        radial-gradient(
            circle at top,
            rgba(255, 255, 255, 0.045),
            transparent 34%
        ),
        linear-gradient(
            180deg,
            var(--bg-main),
            var(--bg-deep)
        );

    color: var(--text-main);
    direction: rtl;

    font-family:
        "Noto Naskh Arabic",
        "Segoe UI",
        Tahoma,
        Arial,
        sans-serif;

    overflow-x: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

img,
svg {
    display: block;
}

.hidden {
    display: none !important;
}


/* =========================================
   APP SHELL
========================================= */

.app-container {
    width: 100%;
height: 100dvh;
min-height: 100dvh;
max-height: 100dvh;

    display: flex;
    justify-content: center;
    align-items: flex-start;

    padding:
        max(12px, env(safe-area-inset-top))
        12px
        max(20px, env(safe-area-inset-bottom));
}

.mosque-frame {
    width: calc(100% - 16px);
        max-width: 360px;
            min-width: 0;
                flex-direction: column;
                    gap: 12px;
                    }
.mosque-frame {
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;

    width: calc(100% - 16px);
    max-width: 360px;
    min-width: 0;
    flex-direction: column;
   gap: clamp(4px, 0.8dvh, 10px);
}

/* =========================================
   HEADER
========================================= */

.mosque-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: clamp(6px, 1dvh, 10px);
    padding: clamp(3px, 0.6dvh, 6px) 4px;
}

.mosque-logo-wrapper {
    flex: 0 0 auto;
}

.mosque-logo {
   width: clamp(42px, 6dvh, 60px);
height: clamp(42px, 6dvh, 60px);
    object-fit: cover;

    border-radius: 18px;
    border: 2px solid rgba(255, 255, 255, 0.12);

    background: rgba(255, 255, 255, 0.07);
}

.mosque-logo[src=""] {
    visibility: hidden;
}

.mosque-title-wrapper {
    flex: 1;
    min-width: 0;
}

.mosque-title-wrapper h1 {
    margin: 0;

    font-size: clamp(18px, 2.8dvh, 28px);
line-height: 1.15;

    font-weight: 800;
    color: var(--text-main);

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mosque-location {
   margin-top: clamp(1px, 0.3dvh, 3px);

    display: flex;
    align-items: center;
    gap: 6px;

    color: var(--text-soft);
    font-size: clamp(11px, 1.7dvh, 16px);
}


/* =========================================
   ICONS
========================================= */

.ui-icon {
    width: 18px;
    height: 18px;
    color: currentColor;
    flex: 0 0 auto;
}

.prayer-icon {
    width: 20px;
    height: 20px;
    color: currentColor;
    flex: 0 0 auto;
}

.button-icon {
    width: 22px;
    height: 22px;
    color: currentColor;
    flex: 0 0 auto;
}

.iqama-alert-icon {
    width: 48px;
    height: 48px;
    color: var(--gold);
}


/* =========================================
   DATE / TIME
========================================= */

.date-time-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.date-card,
.current-time-card {
    border-radius: var(--radius-lg);

    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);

    box-shadow: var(--shadow);
}

.date-card {
    padding: 13px 14px;
}

.date-card-title,
.current-time-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.date-card-title {
    color: var(--text-soft);
}

.date-card strong {
    display: block;

    margin-top: 4px;
    text-align: center;

    color: var(--text-main);
    font-size: 1rem;
}

.current-time-card {
    padding: 16px 14px;

    text-align: center;

    background:
        linear-gradient(
            145deg,
            var(--bg-card-soft),
            var(--bg-card)
        );
}

.current-time-title {
    color: var(--gold-soft);
    font-size: 0.9rem;
}

.current-time {
    direction: ltr;

    margin-top: 4px;

    font-size: clamp(2.7rem, 14vw, 4.5rem);
    line-height: 1;
    font-weight: 800;

    letter-spacing: -1px;
}


/* =========================================
   NEXT PRAYER
========================================= */

.next-prayer-card {
    position: relative;
    overflow: hidden;

    padding: clamp(8px, 1.2dvh, 12px) 12px;

    text-align: center;

    border-radius: var(--radius-xl);

    background:
        linear-gradient(
            145deg,
            #1d7355,
            #12543f
        );

    border: 1px solid rgba(255, 255, 255, 0.1);

    box-shadow: var(--shadow);
}

.next-prayer-card::after {
    content: "";
    position: absolute;

    width: 160px;
    height: 160px;

    border-radius: 50%;

    left: -65px;
    top: -70px;

    background:
        radial-gradient(
            circle,
            rgba(255, 255, 255, 0.08),
            transparent 70%
        );

    pointer-events: none;
}

.section-label {
    color: var(--text-soft);
    font-size: 0.95rem;
}
.next-prayer-card h2 {
    margin: 1px 0 0;

    color: var(--gold);
    font-size: clamp(1.5rem, 6vw, 2.2rem);
    line-height: 1.05;
}

.next-prayer-time {
    direction: ltr;

    margin-top: 1px;

    font-size: clamp(1.6rem, 7vw, 2.5rem);
    line-height: 1;

    font-weight: 800;
}

.countdown-wrapper {
    margin-top: 7px;
    padding-top: 6px;

    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.countdown-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;

    color: var(--text-soft);
    font-size: 0.75rem;
}

#nextPrayerCountdown {
    display: block;
    direction: ltr;

    margin-top: 2px;

    font-size: clamp(1.2rem, 5.5vw, 1.7rem);
    color: var(--gold-soft);
}

/* =========================================
   PRAYER TABLE
========================================= */

.prayers-section {
    width: 100%;

    overflow: hidden;

    border-radius: var(--radius-xl);

    background: rgba(255, 255, 255, 0.035);

    border: 1px solid var(--line);

    box-shadow: var(--shadow);
}

.prayer-table-header,
.prayer-row {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1.15fr)
        minmax(0, 1fr);

    align-items: center;

    text-align: center;
}

.prayer-table-header {
    min-height: 50px;

    padding: 8px 6px;

    background: var(--bg-card-soft);

    color: var(--text-main);

    font-size: 0.92rem;
    font-weight: 700;
}

.prayer-header-item {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.prayer-row {
   min-height: 0;
height: clamp(40px, 5.8dvh, 50px);
padding: clamp(2px, 0.35dvh, 4px) 6px;
box-sizing: border-box;

    background: rgba(255, 255, 255, 0.025);

    border-top: 1px solid var(--line);
}

.prayer-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.045);
}

.prayer-name {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    color: var(--text-main);

    font-size: 1rem;
    font-weight: 800;
}

.adhan-time,
.iqama-time {
    direction: ltr;

    color: var(--text-soft);

    font-size: clamp(0.9rem, 4.5vw, 1.05rem);
    font-weight: 700;
}

.sunrise-row {
    background:
        linear-gradient(
            90deg,
            rgba(215, 180, 99, 0.12),
            rgba(255, 255, 255, 0.03)
        ) !important;
}

.sunrise-row .prayer-name {
    color: var(--gold-soft);
}


/* =========================================
   NEXT PRAYER ROW
========================================= */

.prayer-row.next-prayer {
    position: relative;

    background:
        linear-gradient(
            90deg,
            var(--bg-card-light),
            var(--bg-card-soft)
        ) !important;

    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.prayer-row.next-prayer .prayer-name,
.prayer-row.next-prayer .adhan-time,
.prayer-row.next-prayer .iqama-time {
    color: var(--text-main);
}

.prayer-row.next-prayer::before {
    content: "";

    position: absolute;

    right: 0;
    top: 8px;
    bottom: 8px;

    width: 4px;

    border-radius: 4px;

    background: var(--gold);
}


/* =========================================
   ADHKAR BUTTONS
========================================= */

.adhkar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.adhkar-button {
    min-height: 58px;

    border: 0;

    border-radius: var(--radius-lg);

    padding: 10px 8px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    background: var(--bg-card);

    color: var(--text-main);

    font-weight: 700;

    box-shadow: var(--shadow);

    transition:
        transform 0.16s ease,
        background 0.16s ease;
}

.adhkar-button:active {
    transform: scale(0.98);
    background: var(--bg-card-soft);
}


/* =========================================
   DHIKR
========================================= */

.dhikr-reel {
    width: 100%;

    overflow: hidden;

    border-radius: var(--radius-lg);

    background: rgba(255, 255, 255, 0.06);

    border: 1px solid var(--line);
}

#dhikrText {
    padding: 12px 14px;

    white-space: nowrap;

    text-align: center;

    color: var(--gold-soft);

    font-size: 0.96rem;
    font-weight: 700;
}


/* =========================================
   MOSQUE NOTICES
========================================= */

.announcement-card {
    padding: 14px;

    border-radius: var(--radius-lg);

    background: rgba(255, 255, 255, 0.05);

    border: 1px solid var(--line);

    box-shadow: var(--shadow);
}

.announcement-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    color: var(--gold-soft);
}

.announcement-title h3 {
    margin: 0;
    font-size: 1rem;
}

#announcementText {
    margin: 7px 0 0;

    text-align: center;

    color: var(--text-muted);

    font-size: 0.92rem;
}


/* =========================================
   IQAMA ALERT
========================================= */

.iqama-alert {
    position: fixed;

    inset: 0;

    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding:
        max(20px, env(safe-area-inset-top))
        20px
        max(20px, env(safe-area-inset-bottom));

    background:
        radial-gradient(
            circle at center,
            #176448,
            #082f26 72%
        );
}

.iqama-alert-card {
    width: min(100%, 430px);

    padding: 30px 22px;

    text-align: center;

    border-radius: 30px;

    background: rgba(255, 255, 255, 0.06);

    border: 1px solid rgba(255, 255, 255, 0.13);

    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.34);
}

.iqama-alert-icon {
    margin: 0 auto 8px;
}

.iqama-alert-label {
    display: block;

    color: var(--gold-soft);

    font-size: 1rem;
}

.iqama-alert-card h2 {
    margin: 6px 0;

    color: var(--gold);

    font-size: clamp(2.3rem, 12vw, 3.6rem);
}

.iqama-alert-card p {
    margin: 8px 0;

    color: var(--text-soft);
}

#iqamaAlertCountdown {
    display: block;
    direction: ltr;

    margin: 12px 0;

    color: var(--text-main);

    font-size: clamp(3.5rem, 20vw, 6rem);

    line-height: 0.95;
    font-weight: 800;
}

.iqama-message {
    font-size: 1.05rem;
}


/* =========================================
   SMALL PHONES
========================================= */
/* =========================================
   SMALL PHONES
========================================= */
@media (max-width: 600px) {
    .app-container {
        padding-left: 6px;
        padding-right: 6px;
    }

    .mosque-frame {
        gap: 6px;
    }

    .mosque-title-wrapper h1 {
        font-size: 1.15rem;
    }

    .mosque-location {
        font-size: 0.75rem;
    }

    .date-card {
        padding: 4px 6px !important;
    }

    .current-time-card {
        padding: 5px 8px !important;
    }

    .current-time {
        font-size: clamp(24px, 3.7dvh, 34px) !important;
    }

    .next-prayer-card {
        padding: 5px 10px !important;
    }

    .next-prayer-card .next-prayer-name {
        font-size: clamp(18px, 2.5dvh, 24px) !important;
    }

    .next-prayer-card .next-prayer-time {
        font-size: clamp(16px, 2.2dvh, 22px) !important;
    }

    .next-prayer-card .countdown,
    .next-prayer-card .countdown-time {
        font-size: clamp(17px, 2.5dvh, 24px) !important;
    }

    .prayer-table-header {
        font-size: 0.78rem;
    }

    .prayer-row {
        min-height: 0;
        height: clamp(38px, 5.2dvh, 46px);
        padding: 2px 5px;
    }

    .prayer-name {
        font-size: 0.86rem;
        gap: 3px;
    }

    .prayer-icon {
        width: 16px;
        height: 16px;
    }

    .adhan-time,
    .iqama-time {
        font-size: 0.79rem;
    }

    .adhkar-button {
        font-size: 0.82rem;
        min-height: 44px;
        padding-top: 5px;
        padding-bottom: 5px;
    }
}
/* =========================================
   TABLET
========================================= */

@media (min-width: 700px) {

    .app-container {
        padding: 24px;
    }

    .mosque-frame {
        max-width: 820px;
        gap: 16px;
    }

    .date-time-section {
        grid-template-columns: 1fr 1.35fr 1fr;
    }

    .date-card,
    .current-time-card {
        min-height: 118px;

        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .prayer-row {
        min-height: 64px;
    }

    .prayer-name {
        font-size: 1.1rem;
    }

}


/* =========================================
   DESKTOP / TV
========================================= */

@media (min-width: 1100px) {

    body {
        background:
            radial-gradient(
                circle at top,
                #176448,
                #082f26 65%
            );
    }

    .app-container {
        align-items: center;

        padding: 24px;
    }

    .mosque-frame {
        width: min(96vw, 1450px);
        max-width: none;

        display: grid;

        grid-template-columns:
            minmax(320px, 0.8fr)
            minmax(500px, 1.25fr);

        grid-template-areas:
            "header header"
            "dates dates"
            "next prayers"
            "adhkar prayers"
            "dhikr prayers"
            "notice notice";

        gap: 16px;
    }

    .mosque-header {
        grid-area: header;
    }

    .date-time-section {
        grid-area: dates;
    }

    .next-prayer-card {
        grid-area: next;
        min-height: 260px;

        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .prayers-section {
        grid-area: prayers;
    }

    .adhkar-actions {
        grid-area: adhkar;
        align-self: start;
    }

    .dhikr-reel {
        grid-area: dhikr;
        align-self: start;
    }

    .announcement-card {
        grid-area: notice;
    }

    .prayer-row {
        min-height: 74px;
    }

    .prayer-table-header {
        min-height: 58px;
        font-size: 1rem;
    }

    .prayer-name {
        font-size: 1.25rem;
    }

    .adhan-time,
    .iqama-time {
        font-size: 1.12rem;
    }

}


/* =========================================
   VERY LARGE TV
========================================= */

@media (min-width: 1600px) {

    .mosque-frame {
        width: min(94vw, 1800px);
    }

    .mosque-title-wrapper h1 {
        font-size: 2.4rem;
    }

    .current-time {
        font-size: 5.2rem;
    }

    .next-prayer-card h2 {
        font-size: 3.1rem;
    }

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

    .prayer-row {
        min-height: 82px;
    }

}
/* ========================================
   ADHKAR MODAL
======================================== */

.adhkar-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding:
        max(16px, env(safe-area-inset-top))
        max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom))
        max(16px, env(safe-area-inset-left));

    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
}

.adhkar-modal.hidden {
    display: none;
}

.adhkar-modal-card {
    width: min(100%, 720px);
    max-height: 88dvh;

    display: flex;
    flex-direction: column;

    background: #0b4f3a;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 24px;

    overflow: hidden;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.35);
}

.adhkar-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    padding: 16px 18px;

    background: #083b2c;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.adhkar-modal-header h2 {
    margin: 0;

    color: #ffffff;

    font-size: clamp(18px, 4vw, 24px);
    font-weight: 700;
}

.adhkar-close-button {
    width: 42px;
    height: 42px;

    flex: 0 0 auto;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;

    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;

    font-size: 28px;
    line-height: 1;

    cursor: pointer;
}

.adhkar-close-button:hover,
.adhkar-close-button:focus-visible {
    background: rgba(255, 255, 255, 0.14);
}

.adhkar-modal-content {
    flex: 1;

    overflow-y: auto;
    overscroll-behavior: contain;

    padding: 18px;

    color: #ffffff;

    font-size: clamp(16px, 3.8vw, 20px);
    line-height: 2;

    text-align: right;
}

.adhkar-modal-content p {
    margin: 0 0 18px;
}

@media (max-width: 600px) {
    .adhkar-modal {
        align-items: flex-end;
        padding: 10px;
    }

    .adhkar-modal-card {
        width: 100%;
        max-height: 92dvh;
        border-radius: 22px 22px 16px 16px;
    }

    .adhkar-modal-content {
        padding: 16px;
    }
}
/* ========================================
   RESPONSIVE DHIKR REEL
======================================== */

.dhikr-reel {
    width: 100%;
    min-width: 0;

    overflow: hidden;

    padding: clamp(8px, 2vw, 12px) 0;

    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: clamp(12px, 3vw, 18px);
}

#dhikrText {
    display: inline-block;

    width: max-content;
    min-width: 100%;

    padding-inline: clamp(18px, 6vw, 60px);

    white-space: nowrap;

    color: #ffffff;

    font-size: clamp(14px, 3.6vw, 20px);
    font-weight: 600;
    line-height: 1.6;

    text-align: center;

    animation: dhikrReelMove 22s linear infinite;
}

@keyframes dhikrReelMove {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(-100%);
    }
}

@media (max-width: 480px) {
    #dhikrText {
        font-size: clamp(13px, 4vw, 16px);
        animation-duration: 18s;
    }
}

@media (min-width: 768px) {
    #dhikrText {
        animation-duration: 24s;
    }
}

@media (min-width: 1400px) {
    #dhikrText {
        font-size: clamp(20px, 1.5vw, 28px);
        animation-duration: 28s;
    }
}

@media (prefers-reduced-motion: reduce) {
    #dhikrText {
        animation: none;
        transform: none;
        width: 100%;
        white-space: normal;
    }
}
/* ========================================
   IQAMA PHONE REMINDER
======================================== */

.iqama-phone-reminder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 8px;
    margin-top: 16px;

    text-align: center;
}

.iqama-phone-image {
    display: block;

    width: 200px;
    height: 200px;

    object-fit: contain;
    object-position: center;

    background: transparent;
}

.iqama-phone-reminder strong {
    color: #ffffff;
    font-size: clamp(14px, 3.5vw, 18px);
    font-weight: 700;
}
/* ========================================
   PHONE VIEW
======================================== */

@media (max-width: 600px) {

    html,
    body {
        width: 100%;
        max-width: 100%;
        margin: 0;
        overflow-x: hidden;
    }

    body {
        padding: 0;
    }

    .app-container {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    .mosque-frame {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 12px;

        border-radius: 0;
        box-sizing: border-box;
    }

    /* Mosque header */

    .mosque-header {
        display: flex;
        align-items: center;
        justify-content: center;

        gap: 10px;
        padding: 8px 4px 14px;

        text-align: center;
    }

    .mosque-logo-wrapper {
        flex: 0 0 auto;
    }

    .mosque-logo {
        width: 48px;
        height: 48px;
        object-fit: contain;
    }

    .mosque-title-wrapper {
        min-width: 0;
    }

    .mosque-title-wrapper h1 {
        margin: 0;

        font-size: clamp(20px, 6vw, 26px);
        line-height: 1.3;
    }

    .mosque-location {
        justify-content: center;

        margin-top: 4px;

        font-size: 13px;
    }

    /* Date / clock */

    .date-time-section {
        display: grid;
        grid-template-columns: 1fr 1fr;

        gap: 8px;
    }

    .current-time-card {
        grid-column: 1 / -1;
        grid-row: 1;

        padding: 12px;
    }

    .date-card {
        min-width: 0;

        padding: 10px 8px;
    }

    .current-time {
        font-size: clamp(30px, 10vw, 44px);
        white-space: nowrap;
    }

    .date-card-title,
    .current-time-title {
        font-size: 12px;
    }

    #gregorianDate,
    #hijriDate {
        font-size: 13px;
        line-height: 1.6;
    }

    /* Next prayer */

    .next-prayer-card {
        margin-top: 10px;
        padding: 14px 10px;

        border-radius: 18px;
    }

    #nextPrayerName {
        margin: 4px 0;

        font-size: clamp(28px, 9vw, 38px);
    }

    .next-prayer-time {
        font-size: clamp(24px, 8vw, 34px);
    }

    #nextPrayerCountdown {
        font-size: clamp(24px, 8vw, 34px);
    }

    /* Prayer table */

    .prayers-section {
        margin-top: 10px;

        width: 100%;
        min-width: 0;

        overflow: hidden;

        border-radius: 18px;
    }

    .prayer-table-header,
    .prayer-row {
        grid-template-columns:
            minmax(72px, 1fr)
            minmax(90px, 1.25fr)
            minmax(72px, 1fr);

        width: 100%;
    }

    .prayer-table-header {
        font-size: 13px;
    }

    .prayer-row {
        min-height: 54px;
    }

    .adhan-time,
    .iqama-time {
        font-size: clamp(12px, 3.6vw, 15px);
        white-space: nowrap;
    }

    .prayer-name {
        font-size: clamp(15px, 4.5vw, 18px);

        gap: 5px;
    }

    .prayer-icon {
        width: 18px;
        height: 18px;

        flex: 0 0 auto;
    }

    /* Adhkar */

    .adhkar-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;

        gap: 8px;

        margin-top: 10px;
    }

    .adhkar-button {
        min-width: 0;

        padding: 12px 6px;

        font-size: 13px;
        line-height: 1.5;
    }

    .button-icon {
        width: 20px;
        height: 20px;
    }

    /* Dhikr */

    .dhikr-reel {
        margin-top: 10px;
        max-width: 100%;
    }

    /* Iqama alert */

    .iqama-alert-card {
        width: calc(100% - 24px);
        max-width: 420px;

        padding: 24px 14px;

        box-sizing: border-box;
    }

    #iqamaAlertPrayer {
        font-size: clamp(38px, 12vw, 56px);
    }

    #iqamaAlertCountdown {
        font-size: clamp(54px, 18vw, 82px);
    }

    .iqama-phone-image {
        width: 60px;
        height: 60px;
    }

    .iqama-phone-reminder strong {
        font-size: 15px;
    }

    .iqama-message {
        font-size: 14px;
    }
}
/*/* ========================================
   PHONE VIEW - COMPACT MOSQUE FRAME
======================================== */

@media (max-width: 600px) {

    html,
    body {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }

    body {
        min-height: 100dvh;
    }

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

    /* Main narrow phone frame */

    .app-container {
        width: 100%;
        min-height: 100dvh;

        display: flex;
        justify-content: center;
        align-items: flex-start;

        padding:
            max(8px, env(safe-area-inset-top))
            8px
            max(12px, env(safe-area-inset-bottom));
    }

    .mosque-frame {
        width: 100%;
        max-width: 430px;
        min-width: 0;

        display: flex;
        flex-direction: column;
        gap: 8px;

        margin: 0 auto;
        padding: 10px;

        border-radius: 26px;

        background: rgba(5, 57, 43, 0.55);

        border: 2px solid rgba(215, 180, 99, 0.25);

        overflow: hidden;
    }


    /* ========================================
       HEADER
    ======================================== */

    .mosque-header {
        width: 100%;

        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;

        gap: 4px;

        padding: 4px 6px 6px;

        text-align: center;
    }

    .mosque-logo-wrapper {
        display: flex;
        justify-content: center;
    }

    .mosque-logo {
        width: 52px;
        height: 52px;

        object-fit: cover;

        border-radius: 14px;
    }

    .mosque-title-wrapper {
        width: 100%;
        min-width: 0;

        text-align: center;
    }

    .mosque-title-wrapper h1 {
        margin: 0;

        font-size: clamp(20px, 6vw, 25px);
        line-height: 1.25;

        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    .mosque-location {
        width: 100%;

        display: flex;
        justify-content: center;
        align-items: center;

        gap: 4px;

        margin-top: 2px;

        font-size: 12px;
        line-height: 1.4;

        text-align: center;
    }

    .mosque-location .ui-icon {
        width: 14px;
        height: 14px;
    }


    /* ========================================
       DATE + CLOCK
    ======================================== */

    .date-time-section {
        width: 100%;
        min-width: 0;

        display: grid;
        grid-template-columns: 1fr 1fr;

        gap: 6px;
    }

    .current-time-card {
        grid-column: 1 / -1;
        grid-row: 2;

        width: 100%;

        padding: 10px 8px;

        border-radius: 18px;
    }

    .date-card {
        width: 100%;
        min-width: 0;

        padding: 8px 6px;

        border-radius: 16px;
    }

    .date-card-title,
    .current-time-title {
        gap: 4px;

        font-size: 11px;
    }

    .date-card-title .ui-icon,
    .current-time-title .ui-icon {
        width: 14px;
        height: 14px;
    }

    .date-card strong {
        margin-top: 2px;

        font-size: 12px;
        line-height: 1.5;
    }

    .current-time {
        margin-top: 2px;

        font-size: clamp(30px, 10vw, 42px);
        line-height: 1.1;

        white-space: nowrap;
    }


    /* ========================================
       NEXT PRAYER
    ======================================== */

    .next-prayer-card {
        width: 100%;

        padding: 10px 8px;

        border-radius: 18px;
    }

    .section-label {
        font-size: 11px;
    }

    .next-prayer-card h2 {
        margin: 1px 0;

        font-size: clamp(23px, 7vw, 30px);
    }

    .next-prayer-time {
        margin-top: 1px;

        font-size: clamp(21px, 7vw, 28px);
    }

    .countdown-wrapper {
        margin-top: 7px;
        padding-top: 7px;
    }

    .countdown-label {
        font-size: 11px;
    }

    #nextPrayerCountdown {
        margin-top: 1px;

        font-size: clamp(20px, 6.5vw, 27px);
    }


    /* ========================================
       PRAYER TABLE
    ======================================== */

    .prayers-section {
        width: 100%;
        min-width: 0;

        border-radius: 18px;

        overflow: hidden;
    }

    .prayer-table-header,
    .prayer-row {
        width: 100%;
        min-width: 0;

        grid-template-columns:
            minmax(0, 1fr)
            minmax(0, 1.1fr)
            minmax(0, 1fr);
    }

    .prayer-table-header {
        min-height: 38px;

        padding: 5px 2px;

        font-size: 12px;
    }

    .prayer-header-item {
        gap: 3px;
    }

    .prayer-header-item .ui-icon {
        width: 13px;
        height: 13px;
    }

    .prayer-row {
        min-height: 48px;

        padding: 5px 2px;
    }

    .adhan-time,
    .iqama-time {
        min-width: 0;

        font-size: clamp(11px, 3.5vw, 14px);
        font-weight: 700;

        white-space: nowrap;
    }

    .prayer-name {
        min-width: 0;

        gap: 3px;

        font-size: clamp(14px, 4vw, 17px);

        white-space: nowrap;
    }

    .prayer-icon {
        width: 16px;
        height: 16px;
    }

    .prayer-row.next-prayer::before {
        top: 5px;
        bottom: 5px;

        width: 3px;
    }


    /* ========================================
       ADHKAR
    ======================================== */

    .adhkar-actions {
        width: 100%;

        display: grid;
        grid-template-columns: 1fr 1fr;

        gap: 6px;
    }

    .adhkar-button {
        width: 100%;
        min-width: 0;
        min-height: 44px;

        padding: 6px 5px;

        gap: 4px;

        border-radius: 14px;

        font-size: 11px;
        line-height: 1.3;
    }

    .button-icon {
        width: 16px;
        height: 16px;
    }


    /* ========================================
       DHIKR REEL
    ======================================== */

    .dhikr-reel {
        width: 100%;
        min-width: 0;

        margin: 0;

        padding: 6px 0;

        border-radius: 14px;
    }

    #dhikrText {
        min-width: 100%;

        padding-inline: 18px;

        font-size: 13px;
        line-height: 1.5;

        animation-duration: 18s;
    }


    /* ========================================
       ADHKAR MODAL
    ======================================== */

    .adhkar-modal {
        align-items: flex-end;

        padding: 8px;
    }

    .adhkar-modal-card {
        width: 100%;
        max-height: 90dvh;

        border-radius: 20px 20px 14px 14px;
    }

    .adhkar-modal-header {
        padding: 12px 14px;
    }

    .adhkar-modal-header h2 {
        font-size: 18px;
    }

    .adhkar-close-button {
        width: 38px;
        height: 38px;
    }

    .adhkar-modal-content {
        padding: 14px;

        font-size: 16px;
        line-height: 1.9;
    }


    /* ========================================
       IQAMA ALERT
    ======================================== */

    .iqama-alert {
        padding:
            max(8px, env(safe-area-inset-top))
            8px
            max(8px, env(safe-area-inset-bottom));
    }

    .iqama-alert-card {
        width: 100%;
        max-width: 390px;

        padding: 22px 14px;

        border-radius: 24px;
    }

    .iqama-alert-card h2 {
        font-size: clamp(34px, 11vw, 48px);
    }

    #iqamaAlertCountdown {
        font-size: clamp(52px, 17vw, 74px);
    }

    .iqama-phone-image {
        width: 60px;
        height: 60px;
    }

    .iqama-phone-reminder {
        gap: 5px;
        margin-top: 10px;
    }

    .iqama-phone-reminder strong {
        font-size: 14px;
    }

    .iqama-message {
        font-size: 13px;
    }
}


/* ========================================
   EXTRA SMALL PHONES
======================================== */

@media (max-width: 360px) {

    .app-container {
        padding-left: 5px;
        padding-right: 5px;
    }

    .mosque-frame {
        padding: 7px;
        gap: 6px;
    }

    .current-time {
        font-size: 29px;
    }

    .adhan-time,
    .iqama-time {
        font-size: 10.5px;
    }

    .prayer-name {
        font-size: 13px;
    }

    .adhkar-button {
        font-size: 10.5px;
    }
}
/* ========================================
   FINAL MOBILE OVERFLOW FIX
======================================== */

html,
body {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

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

.app-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
    overflow-x: hidden;
}

.mosque-frame {
    width: calc(100% - 12px);
    max-width: 492px;
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
    overflow-x: hidden;
}

.mosque-frame > * {
    max-width: 100%;
    min-width: 0;
}

img,
svg {
    max-width: 100%;
}
@media (max-width: 600px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        position: relative;
    }

    .app-container {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding-left: 6px;
        padding-right: 6px;
        overflow-x: hidden;
    }

    .mosque-frame {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 0;
        padding-left: 6px;
        padding-right: 6px;
        overflow-x: hidden;
    }

    .mosque-frame > *,
    .date-time-section,
    .next-prayer-card,
    .prayers-section,
    .adhkar-actions,
    .dhikr-reel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .prayer-table-header,
    .prayer-row {
        width: 100%;
        min-width: 0;
        grid-template-columns:
            minmax(0, 1fr)
            minmax(0, 1.1fr)
            minmax(0, 1fr);
    }

    img,
    svg {
        max-width: 100%;
    }
}
/* Prevent horizontal scrolling only */
html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.app-container,
.mosque-frame {
    max-width: 100%;
    box-sizing: border-box;
}
/* Prayer table fixed RTL column order:
   Right = Adhan | Center = Prayer | Left = Iqama
*/.prayer-table-header,
.prayer-row {
    direction: rtl;
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    align-items: center;
    text-align: center;
}
.prayer-table-header,
.prayer-row {
    direction: rtl;
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    align-items: center;
    text-align: center;
}

.prayer-table-header > *:nth-child(1),
.prayer-row > *:nth-child(1) {
    grid-column: 1; /* Right */
}

.prayer-table-header > *:nth-child(2),
.prayer-row > *:nth-child(2) {
    grid-column: 2; /* Center */
}

.prayer-table-header > *:nth-child(3),
.prayer-row > *:nth-child(3) {
    grid-column: 3; /* Left */
}
/* =========================================
   COMPACT TOP VIEWER
      Header + Dates + Clock + Next Prayer
      ========================================= */

      /* Header */
      .mosque-header {
          padding: 2px 4px !important;
              gap: 5px !important;
              }

              .mosque-logo {
                  width: clamp(38px, 5dvh, 52px) !important;
                      height: clamp(38px, 5dvh, 52px) !important;
                      }

                      .mosque-title-wrapper h1 {
                          font-size: clamp(17px, 2.4dvh, 23px) !important;
                              line-height: 1.05 !important;
                              }

                              .mosque-location {
                                  margin-top: 1px !important;
                                      font-size: clamp(10px, 1.4dvh, 13px) !important;
                                      }

                                      /* Date cards */
                                      .date-card {
                                          min-height: 0 !important;
                                              padding: clamp(4px, 0.6dvh, 7px) 8px !important;
                                              }

                                              .date-label,
                                              .day-name {
                                                  font-size: clamp(10px, 1.4dvh, 13px) !important;
                                                  }

                                                  .gregorian-date,
                                                  .hijri-date,
                                                  .date-value {
                                                      font-size: clamp(11px, 1.7dvh, 15px) !important;
                                                          line-height: 1.15 !important;
                                                          }

                                                          /* Current time */
                                                          .current-time-card {
                                                              min-height: 0 !important;
                                                                  padding: clamp(5px, 0.7dvh, 8px) !important;
                                                                  }

                                                                  .current-time {
                                                                      font-size: clamp(26px, 4dvh, 38px) !important;
                                                                          line-height: 1 !important;
                                                                          }

                                                                          /* Next prayer card */
                                                                          .next-prayer-card {
                                                                              min-height: 0 !important;
                                                                                  padding: clamp(6px, 0.9dvh, 10px) 12px !important;
                                                                                  }

                                                                                  .next-prayer-card .next-prayer-label {
                                                                                      font-size: clamp(10px, 1.4dvh, 13px) !important;
                                                                                      }

                                                                                      .next-prayer-card .next-prayer-name {
                                                                                          font-size: clamp(20px, 2.8dvh, 27px) !important;
                                                                                              line-height: 1 !important;
                                                                                              }

                                                                                              .next-prayer-card .next-prayer-time {
                                                                                                  font-size: clamp(18px, 2.6dvh, 25px) !important;
                                                                                                      line-height: 1 !important;
                                                                                                      }

                                                                                                      .next-prayer-card .countdown,
                                                                                                      .next-prayer-card .countdown-time {
                                                                                                          font-size: clamp(18px, 2.8dvh, 27px) !important;
                                                                                                              line-height: 1 !important;
                                                                                                              }
                                                                                                              /* =========================================
   FINAL PHONE FIT FIX
   Keeps complete viewer inside one screen
========================================= */
@media (max-width: 600px) {

    html,
    body {
        width: 100%;
        height: 100dvh;
        min-height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
        overflow-y: hidden;
    }

    .app-container {
        width: 100%;
        height: 100dvh;
        min-height: 100dvh;
        max-height: 100dvh;
        padding: 6px !important;
        margin: 0;
        overflow: hidden;
    }

    .mosque-frame {
        width: 100% !important;
        height: calc(100dvh - 12px) !important;
        min-height: 0 !important;
        max-height: calc(100dvh - 12px) !important;

        display: flex !important;
        flex-direction: column !important;

        gap: 4px !important;
        padding: 6px !important;
        margin: 0 !important;

        overflow: hidden !important;
        box-sizing: border-box;
    }

    /* HEADER */
    .mosque-header {
        flex: 0 0 auto;
        gap: 2px !important;
        padding: 2px 4px !important;
    }

    .mosque-logo {
        width: 42px !important;
        height: 42px !important;
    }

    .mosque-title-wrapper h1 {
        font-size: 18px !important;
        line-height: 1.05 !important;
    }

    .mosque-location {
        margin-top: 0 !important;
        font-size: 10px !important;
        line-height: 1.1 !important;
    }

    /* DATE + TIME */
    .date-time-section {
        flex: 0 0 auto;
        gap: 4px !important;
    }

    .date-card {
        padding: 4px 5px !important;
        min-height: 42px !important;
    }

    .date-card-title,
    .current-time-title {
        font-size: 10px !important;
        line-height: 1 !important;
    }

    .date-card strong {
        margin-top: 1px !important;
        font-size: 11px !important;
        line-height: 1.2 !important;
    }

    .current-time-card {
        padding: 4px 6px !important;
        min-height: 56px !important;
    }

    .current-time {
        margin-top: 1px !important;
        font-size: clamp(27px, 4dvh, 34px) !important;
        line-height: 1 !important;
    }

    /* NEXT PRAYER */
    .next-prayer-card {
        flex: 0 0 auto;
        min-height: 0 !important;
        height: auto !important;
        padding: 5px 8px !important;
        margin: 0 !important;
        border-radius: 16px !important;
    }

    .section-label {
        font-size: 10px !important;
        line-height: 1 !important;
    }

    .next-prayer-card h2,
    #nextPrayerName {
        margin: 1px 0 !important;
        font-size: 24px !important;
        line-height: 1 !important;
    }

    .next-prayer-time {
        margin-top: 1px !important;
        font-size: 21px !important;
        line-height: 1 !important;
    }

    .countdown-wrapper {
        margin-top: 3px !important;
        padding-top: 3px !important;
    }

    .countdown-label {
        font-size: 9px !important;
        line-height: 1 !important;
    }

    #nextPrayerCountdown {
        margin-top: 1px !important;
        font-size: 20px !important;
        line-height: 1 !important;
    }

    /* PRAYER TABLE */
    .prayers-section {
        flex: 1 1 auto;
        min-height: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        border-radius: 16px !important;
    }

    .prayer-table-header {
        min-height: 30px !important;
        height: 30px !important;
        padding: 2px !important;
        font-size: 11px !important;
    }

    .prayer-row {
        min-height: 0 !important;
        height: clamp(35px, 4.7dvh, 42px) !important;
        padding: 1px 3px !important;
    }

    .prayer-name {
        font-size: clamp(13px, 3.6vw, 16px) !important;
        line-height: 1 !important;
        gap: 2px !important;
    }

    .adhan-time,
    .iqama-time {
        font-size: clamp(11px, 3.1vw, 13px) !important;
        line-height: 1 !important;
        white-space: nowrap;
    }

    .prayer-icon {
        width: 14px !important;
        height: 14px !important;
    }

    /* ADHKAR BUTTONS */
    .adhkar-actions {
        flex: 0 0 auto;
        gap: 5px !important;
        margin: 0 !important;
    }

    .adhkar-button {
        min-height: 38px !important;
        height: 38px !important;
        padding: 3px 4px !important;
        font-size: 11px !important;
        line-height: 1.1 !important;
    }

    .button-icon {
        width: 14px !important;
        height: 14px !important;
    }

    /* DHIKR */
    .dhikr-reel {
        flex: 0 0 auto;
        height: 32px !important;
        min-height: 32px !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    #dhikrText {
        height: 32px !important;
        padding: 5px 14px !important;
        font-size: 12px !important;
        line-height: 22px !important;
        white-space: nowrap;
    }
}
@media (max-width: 600px) {
    .prayers-section {
        flex: 0 0 auto !important;
        height: auto !important;
        min-height: 0 !important;
    }
}
/* ========================================
   MOSQUE PHOTO SLIDESHOW
========================================= */

.mosque-slideshow {
    position: relative;
    width: 100%;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    background: #062f25;
}

.slideshow-track {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.mosque-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.8s ease,
        visibility 0.8s ease;
}

.mosque-slide.active {
    opacity: 1;
    visibility: visible;
}

/* Navigation dots */
.slideshow-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);

    display: flex;
    gap: 5px;

    z-index: 5;
}
/* ========================================
   SLIDESHOW DOTS
========================================= */

.slideshow-dot {
    width: 8px;
    height: 8px;

    padding: 0;
    border: none;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.45);

    cursor: pointer;

    transition:
        transform 0.25s ease,
        background 0.25s ease;
}

.slideshow-dot.active {
    background: #d4af37;
    transform: scale(1.3);
}
/* ========================================
   MOBILE SLIDESHOW - SAME SCREEN
========================================= */

@media (max-width: 600px) {

    .mosque-slideshow {
        width: 100%;
        height: clamp(90px, 14dvh, 125px);
        margin-top: 4px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .slideshow-track {
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
    }

    .mosque-slide {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}
.sunrise-row .prayer-name {
    color: #ffffff !important;
}
/* ========================================
   FINAL PRAYER TABLE COLUMN ORDER
   Left: Iqama | Center: Prayer | Right: Adhan
======================================== */

.prayer-table-header,
.prayer-row {
    direction: ltr !important;
    display: grid !important;
    grid-template-columns: 1fr 1.2fr 1fr !important;
    align-items: center;
    text-align: center;
}

/* LEFT = IQAMA */
.prayer-table-header > *:nth-child(1),
.prayer-row > *:nth-child(1),
.iqama-time {
    grid-column: 1 !important;
}

/* CENTER = PRAYER */
.prayer-table-header > *:nth-child(2),
.prayer-row > *:nth-child(2),
.prayer-name {
    grid-column: 2 !important;
}

/* RIGHT = ADHAN */
.prayer-table-header > *:nth-child(3),
.prayer-row > *:nth-child(3),
.adhan-time {
    grid-column: 3 !important;
}

/* Keep Arabic text correct */
.prayer-table-header > *,
.prayer-name {
    direction: rtl;
}

/* Keep times in one line */
.adhan-time,
.iqama-time {
    direction: ltr;
    white-space: nowrap;
}

/* Sunrise / Duha name */
.sunrise-row .prayer-name {
    color: #ffffff !important;
}
/* Next prayer labels - slightly larger */
.next-prayer-card .section-label {
    font-size: 14px !important;
    font-weight: 700;
}

.next-prayer-card .countdown-label {
    font-size: 14px !important;
    font-weight: 700;
}
/* =========================================
   Local Arabic Font — Noto Kufi Arabic
   ========================================= */
@font-face {
    font-family: "Noto Kufi Arabic";
    src: url("../assets/fonts/NotoKufiArabic-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
html[lang="ar"] body {
    font-family: "Noto Kufi Arabic", sans-serif;
}
/* =========================================
   Viewer Typography Balance
   ========================================= */

/* Mosque header */
#mosqueName {
    font-size: clamp(16px, 2.1vw, 20px);
    line-height: 1.35;
}

#mosqueLocation {
    font-size: clamp(10px, 1.3vw, 13px);
}

/* Date cards */
.date-card-title,
.current-time-title {
    font-size: clamp(10px, 1.25vw, 12px);
}

#gregorianDate,
#hijriDate {
    font-size: clamp(11px, 1.45vw, 14px);
}

/* Main clock */
.current-time {
    font-size: clamp(26px, 4vw, 36px);
    line-height: 1.2;
}

/* Next prayer */
.next-prayer-card .section-label,
.next-prayer-card .countdown-label {
    font-size: clamp(11px, 1.4vw, 14px) !important;
}

#nextPrayerName {
    font-size: clamp(20px, 3vw, 28px);
    line-height: 1.3;
}

.next-prayer-time {
    font-size: clamp(16px, 2.2vw, 21px);
}

#nextPrayerCountdown {
    font-size: clamp(15px, 2vw, 19px);
}

/* Prayer table */
.prayer-table-header {
    font-size: clamp(11px, 1.45vw, 14px);
}

.prayer-name {
    font-size: clamp(13px, 1.8vw, 17px);
    line-height: 1.35;
}

.adhan-time,
.iqama-time {
    font-size: clamp(13px, 1.8vw, 17px);
}

/* Adhkar buttons */
.adhkar-button {
    font-size: clamp(11px, 1.45vw, 14px);
}

/* Dhikr reel */
#dhikrText {
    font-size: clamp(11px, 1.45vw, 14px);
}