/* Prayer Times & Weather — سطح فاتح (زجاجي هادئ) — مزج رمادي خفيف (~8% من درجة «فاتح +7%») */

.prayer-widget-container {
    --pr-mid: #64748b; /* color-mix: ~92% سطح + 8% — أخف من نسخة 85/15 */
    width: 100%;
    margin-bottom: 0;
}

.prayer-widget-card {
    position: relative;
    overflow: hidden;
    border-radius: 1.15rem;
    padding: 1.05rem 1.1rem 1.15rem;
    border: 1px solid rgba(148, 163, 184, 0.36);
    background: linear-gradient(
        155deg,
        color-mix(in srgb, #ffffff 92%, var(--pr-mid) 8%) 0%,
        color-mix(in srgb, #f1f5f9 92%, var(--pr-mid) 8%) 40%,
        color-mix(in srgb, #e8eef5 92%, var(--pr-mid) 8%) 100%
    );
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.75) inset,
        0 12px 32px -16px rgba(15, 23, 42, 0.12),
        0 4px 12px -4px rgba(15, 23, 42, 0.06),
        0 0 0 1px color-mix(in srgb, #e2e8f0 87%, var(--pr-mid) 13%);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.prayer-widget-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    opacity: 0.45;
    -webkit-mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 35%, transparent 100%);
    mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 35%, transparent 100%);
}

.prayer-widget-card::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background:
        radial-gradient(ellipse 120% 80% at 100% 0%, rgba(251, 191, 36, 0.1) 0%, transparent 52%),
        radial-gradient(ellipse 100% 60% at 0% 100%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
    pointer-events: none;
    opacity: 0.9;
}

.prayer-widget-header {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.prayer-widget-title {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #9a3412;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: none;
    flex: 0 0 auto;
    max-width: 100%;
}

/* Box sits opposite the title (flex); text is centered inside the box */
.prayer-widget-header__dhikr {
    flex: 1 1 10rem;
    min-width: 0;
    margin: 0;
    text-align: center;
    line-height: 1.55;
    font-size: calc(0.72rem * 1.15);
    font-weight: 600;
    letter-spacing: 0.02em;
    min-height: 1.2rem;
    padding: 0.38rem 0.7rem;
    border-radius: 0.6rem;
    color: #422006;
    background: linear-gradient(
        120deg,
        color-mix(in srgb, #fffbeb 92%, var(--pr-mid) 8%) 0%,
        color-mix(in srgb, #fef3c7 92%, var(--pr-mid) 8%) 50%,
        color-mix(in srgb, #fffbeb 92%, var(--pr-mid) 8%) 100%
    );
    background-size: 200% 100%;
    border: 1px solid rgba(251, 191, 36, 0.45);
    text-shadow: none;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7) inset, 0 1px 4px rgba(120, 53, 15, 0.08);
    transition: opacity 0.3s ease;
    animation: prayer-dhikr-shimmer 4.2s ease-in-out infinite,
        prayer-dhikr-ambient 2.6s ease-in-out infinite;
}

:lang(ar) .prayer-widget-title {
    letter-spacing: 0.04em;
    text-transform: none;
    font-size: 0.95rem;
}

.prayer-widget-title i {
    color: #d97706;
    filter: none;
    font-size: 1.05rem;
}

.prayer-widget-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    width: 100%;
}

/* Center: clock + countdown */
.center-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 180px;
    padding: 0.65rem 0.75rem 0.7rem;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, #ffffff 92%, var(--pr-mid) 8%) 0%,
        color-mix(in srgb, #f8fafc 95%, var(--pr-mid) 5%) 100%
    );
    border-radius: 0.6rem;
    border: 1px solid rgba(203, 213, 225, 0.86);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.center-block-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
}

.center-left {
    flex-shrink: 0;
    text-align: left;
}

.center-center {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.center-right {
    flex-shrink: 0;
    text-align: right;
}

.clock-time {
    font-size: 1.65rem;
    font-weight: 800;
    font-family: ui-monospace, "Courier New", monospace;
    letter-spacing: 0.12em;
    line-height: 1.2;
    white-space: nowrap;
    background: linear-gradient(100deg, #1d4ed8 0%, #0e7490 40%, #7c3aed 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.clock-date {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
}

.countdown-section {
    width: 100%;
}

.countdown-label {
    font-size: 0.6rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.2rem;
    font-weight: 600;
}

:lang(ar) .countdown-label {
    letter-spacing: 0.05em;
    text-transform: none;
    font-size: 0.68rem;
}

.countdown-text {
    font-size: 1rem;
    line-height: 1.45;
    letter-spacing: 0.04em;
    font-weight: 700;
    color: #1e293b;
}

.countdown-text .prayer-name {
    color: #0284c7;
    margin-inline-end: 0.3rem;
    font-weight: 800;
}

.countdown-text .countdown-time {
    color: #0f172a;
    font-weight: 800;
    font-family: ui-monospace, "Courier New", monospace;
}

.countdown-text.soon {
    color: #fecaca;
    animation: prayer-pulse-countdown 2s ease-in-out infinite;
}

.countdown-text.soon .prayer-name {
    color: #f87171;
}

@keyframes prayer-pulse-countdown {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.78;
    }
}

/* Prayer strip */
.prayer-section {
    flex: 1;
    min-width: 0;
}

.prayer-items-wrapper {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.15rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.42) color-mix(in srgb, #e2e8f0 87%, var(--pr-mid) 13%);
}

.prayer-items-wrapper::-webkit-scrollbar {
    height: 4px;
}

.prayer-items-wrapper::-webkit-scrollbar-track {
    background: color-mix(in srgb, #e2e8f0 95%, #64748b 5%);
    border-radius: 2px;
}

.prayer-items-wrapper::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.4);
    border-radius: 2px;
}

.prayer-item {
    min-width: 4.7rem;
    flex: 0 0 auto;
    background: linear-gradient(
        175deg,
        color-mix(in srgb, #ffffff 92%, var(--pr-mid) 8%) 0%,
        color-mix(in srgb, #f8fafc 92%, var(--pr-mid) 8%) 100%
    );
    border: 1px solid rgba(203, 213, 225, 0.86);
    border-radius: 0.5rem;
    padding: 0.45rem 0.5rem 0.55rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    position: relative;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.prayer-item::after {
    content: "";
    position: absolute;
    inset-block: 0.4rem 0.4rem;
    inset-inline-start: 0;
    width: 2px;
    border-radius: 1px;
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.5), rgba(148, 163, 184, 0.15));
    opacity: 0.6;
}

.prayer-item:hover {
    transform: translateY(-2px);
    border-color: rgba(148, 163, 184, 0.65);
    box-shadow: 0 8px 20px -8px rgba(15, 23, 42, 0.12);
}

.prayer-item.next-prayer {
    background: linear-gradient(
        175deg,
        color-mix(in srgb, #e0f2fe 93%, var(--pr-mid) 7%) 0%,
        color-mix(in srgb, #f0f9ff 93%, var(--pr-mid) 7%) 100%
    );
    border-color: rgba(14, 165, 233, 0.52);
    box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.18), 0 6px 16px -6px rgba(14, 165, 233, 0.22);
}

.prayer-item.next-prayer::after {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.9), rgba(56, 189, 248, 0.25));
    opacity: 1;
}

.prayer-item.next-prayer-soon {
    background: linear-gradient(
        175deg,
        color-mix(in srgb, #fee2e2 93%, var(--pr-mid) 7%) 0%,
        color-mix(in srgb, #fff1f2 93%, var(--pr-mid) 7%) 100%
    );
    border-color: rgba(239, 68, 68, 0.48);
    animation: prayer-urgent 2s ease-in-out infinite;
}

.prayer-item.next-prayer-soon::after {
    background: linear-gradient(180deg, rgba(248, 113, 113, 0.95), rgba(248, 113, 113, 0.3));
    opacity: 1;
}

@keyframes prayer-urgent {
    0%,
    100% {
        box-shadow: 0 0 16px -4px rgba(248, 113, 113, 0.4);
    }
    50% {
        box-shadow: 0 0 28px -2px rgba(248, 113, 113, 0.6);
    }
}

.prayer-icon {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 0;
}

.prayer-item.next-prayer .prayer-icon {
    color: #38bdf8;
}

.prayer-item.next-prayer-soon .prayer-icon {
    color: #f87171;
}

.prayer-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    width: 100%;
}

.prayer-item .prayer-info .prayer-name {
    font-size: 0.65rem;
    font-weight: 600;
    color: #475569;
    line-height: 1.3;
    margin-bottom: 0;
}

.prayer-item.next-prayer .prayer-info .prayer-name {
    color: #0369a1;
}

.prayer-item.next-prayer-soon .prayer-info .prayer-name {
    color: #fecaca;
    font-weight: 800;
}

.prayer-time {
    font-size: 0.78rem;
    font-weight: 800;
    color: #0f172a;
    font-family: ui-monospace, "Courier New", monospace;
    letter-spacing: 0.04em;
}

.prayer-item.next-prayer .prayer-time {
    color: #0c4a6e;
}

.prayer-item.next-prayer-soon .prayer-time {
    color: #fecdd3;
}

/* RTL */
[dir="rtl"] .prayer-widget-content {
    flex-direction: row-reverse;
}

[dir="rtl"] .prayer-items-wrapper {
    direction: rtl;
}

[dir="rtl"] .center-block-content {
    flex-direction: row-reverse;
}

[dir="rtl"] .center-left {
    text-align: right;
}

[dir="rtl"] .center-right {
    text-align: left;
}

[dir="rtl"] .countdown-text .prayer-name {
    margin-right: 0;
    margin-left: 0.3rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .clock-time {
        font-size: 1.4rem;
    }
    .center-block {
        min-width: 160px;
        padding: 0.55rem 0.6rem 0.6rem;
    }
    .clock-date {
        font-size: 0.7rem;
    }
    .countdown-text {
        font-size: 0.9rem;
    }
    .prayer-item {
        min-width: 4.4rem;
        padding: 0.4rem 0.45rem 0.5rem;
    }
    .prayer-icon {
        font-size: 0.9rem;
    }
    .prayer-item .prayer-info .prayer-name {
        font-size: 0.6rem;
    }
    .prayer-time {
        font-size: 0.72rem;
    }
}

@media (max-width: 768px) {
    .prayer-widget-card {
        padding: 0.9rem 0.85rem 1rem;
    }
    .prayer-widget-header {
        flex-direction: column;
        align-items: stretch;
    }
    .prayer-widget-header__dhikr {
        text-align: center;
        flex: 1 1 auto;
        font-size: calc(0.7rem * 1.15);
        animation: none;
    }
    .prayer-widget-content {
        flex-direction: column;
        gap: 0.75rem;
    }
    .center-block {
        width: 100%;
        min-width: auto;
    }
    .prayer-section {
        display: none;
    }
    .clock-time {
        font-size: 1.4rem;
    }
}

@media (max-width: 640px) {
    .prayer-widget-content {
        flex-direction: column;
        align-items: stretch;
    }
    .center-block {
        width: 100%;
    }
    .prayer-section {
        display: none;
    }
}

@media (max-width: 480px) {
    .prayer-widget-card {
        padding: 0.8rem 0.7rem 0.9rem;
    }
    .clock-time {
        font-size: 1.2rem;
    }
    .prayer-section {
        display: none;
    }
}

/* Prayer widget — dhikr (ambient + subtle shimmer) */
@keyframes prayer-dhikr-ambient {
    0%,
    100% {
        text-shadow: 0 0 1px rgba(66, 32, 6, 0.06);
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7) inset, 0 0 10px rgba(251, 191, 36, 0.15);
    }
    50% {
        text-shadow: 0 0 6px rgba(245, 158, 11, 0.2);
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9) inset, 0 0 16px rgba(251, 191, 36, 0.22);
    }
}

@keyframes prayer-dhikr-shimmer {
    0%,
    100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .prayer-widget-header__dhikr {
        animation: none;
    }
}
