/*
 * Ramadan Wellness Companion
 * Dark navy + gold palette, Islamic vibes, fun & cute
 */

/* ═══════════ RESET & BASE ═══════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-deep: #0a1628;
    --bg-card: #121e36;
    --bg-card-hover: #1a2a4a;
    --bg-surface: #0e1a30;
    --gold: #d4a44c;
    --gold-light: #f0cf8a;
    --gold-dim: #a07830;
    --green: #4ade80;
    --green-dim: #166534;
    --red: #f87171;
    --red-dim: #7f1d1d;
    --blue: #60a5fa;
    --purple: #a78bfa;
    --text-primary: #f0ead6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.2);
    --transition: 0.2s ease;
    --nav-height: 72px;
    --topbar-height: 56px;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-arabic: 'Amiri', 'Traditional Arabic', serif;
    --font: var(--font-body);
}

[x-cloak] { display: none !important; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Warm gradient atmosphere */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(212, 164, 76, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(167, 139, 250, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(96, 165, 250, 0.02) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* ═══════════ NIGHT SKY — STARS + MOON ═══════════ */
.sky {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Star layers — 3 layers with staggered twinkle timing */
.stars {
    position: absolute;
    inset: 0;
}

.stars-1 {
    background-image:
        radial-gradient(2px 2px at 7% 12%, rgba(240, 234, 214, 0.7) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 18% 42%, rgba(212, 164, 76, 0.6) 50%, transparent 50%),
        radial-gradient(2px 2px at 32% 8%, rgba(240, 234, 214, 0.55) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 45% 65%, rgba(167, 139, 250, 0.5) 50%, transparent 50%),
        radial-gradient(2px 2px at 58% 22%, rgba(212, 164, 76, 0.65) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 72% 78%, rgba(240, 234, 214, 0.5) 50%, transparent 50%),
        radial-gradient(2px 2px at 88% 35%, rgba(212, 164, 76, 0.6) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 95% 58%, rgba(167, 139, 250, 0.45) 50%, transparent 50%),
        radial-gradient(2px 2px at 14% 88%, rgba(240, 234, 214, 0.55) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 62% 5%, rgba(212, 164, 76, 0.5) 50%, transparent 50%);
    animation: twinkle-1 3s ease-in-out infinite alternate;
}

.stars-2 {
    background-image:
        radial-gradient(2.5px 2.5px at 5% 30%, rgba(212, 164, 76, 0.55) 50%, transparent 50%),
        radial-gradient(2px 2px at 22% 70%, rgba(240, 234, 214, 0.5) 50%, transparent 50%),
        radial-gradient(2.5px 2.5px at 38% 48%, rgba(167, 139, 250, 0.45) 50%, transparent 50%),
        radial-gradient(2px 2px at 52% 85%, rgba(212, 164, 76, 0.5) 50%, transparent 50%),
        radial-gradient(3px 3px at 68% 15%, rgba(240, 234, 214, 0.6) 50%, transparent 50%),
        radial-gradient(2px 2px at 82% 62%, rgba(212, 164, 76, 0.5) 50%, transparent 50%),
        radial-gradient(2.5px 2.5px at 92% 88%, rgba(240, 234, 214, 0.45) 50%, transparent 50%),
        radial-gradient(2px 2px at 15% 52%, rgba(96, 165, 250, 0.35) 50%, transparent 50%),
        radial-gradient(3px 3px at 48% 32%, rgba(212, 164, 76, 0.5) 50%, transparent 50%),
        radial-gradient(2px 2px at 78% 45%, rgba(167, 139, 250, 0.4) 50%, transparent 50%);
    animation: twinkle-2 5s ease-in-out infinite alternate;
}

.stars-3 {
    background-image:
        radial-gradient(3px 3px at 12% 55%, rgba(240, 234, 214, 0.65) 50%, transparent 50%),
        radial-gradient(2.5px 2.5px at 28% 18%, rgba(212, 164, 76, 0.5) 50%, transparent 50%),
        radial-gradient(3px 3px at 42% 82%, rgba(167, 139, 250, 0.55) 50%, transparent 50%),
        radial-gradient(2.5px 2.5px at 55% 40%, rgba(240, 234, 214, 0.5) 50%, transparent 50%),
        radial-gradient(3px 3px at 75% 25%, rgba(212, 164, 76, 0.6) 50%, transparent 50%),
        radial-gradient(2.5px 2.5px at 85% 72%, rgba(240, 234, 214, 0.55) 50%, transparent 50%),
        radial-gradient(3px 3px at 8% 92%, rgba(96, 165, 250, 0.4) 50%, transparent 50%),
        radial-gradient(2.5px 2.5px at 65% 60%, rgba(212, 164, 76, 0.45) 50%, transparent 50%);
    animation: twinkle-3 7s ease-in-out infinite alternate;
}

@keyframes twinkle-1 {
    0%   { opacity: 0.35; }
    100% { opacity: 1; }
}
@keyframes twinkle-2 {
    0%   { opacity: 0.5; }
    100% { opacity: 0.85; }
}
@keyframes twinkle-3 {
    0%   { opacity: 0.25; }
    100% { opacity: 0.9; }
}


/* Light mode: hide entire sky */
[data-theme="light"] .sky {
    display: none;
}

/* ═══════════ TYPOGRAPHY ═══════════ */
h1 { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

/* ═══════════ LOADING SCREEN ═══════════ */
.loading-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-deep);
    z-index: 1000;
}

.loading-content {
    text-align: center;
}

.crescent-loader {
    font-size: 4rem;
    animation: float 2s ease-in-out infinite;
    position: relative;
    display: inline-block;
}

.crescent-loader::after {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--gold);
    border-right-color: var(--gold-dim);
    animation: spin 2s linear infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(10deg); }
}

.loading-content p {
    margin-top: 1rem;
    color: var(--gold);
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* ═══════════ AUTH SCREEN ═══════════ */
.auth-screen {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
    background:
        radial-gradient(1.5px 1.5px at 20% 30%, rgba(212, 164, 76, 0.2) 50%, transparent 50%),
        radial-gradient(1px 1px at 60% 15%, rgba(167, 139, 250, 0.15) 50%, transparent 50%),
        radial-gradient(1px 1px at 80% 60%, rgba(212, 164, 76, 0.15) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 35% 80%, rgba(240, 234, 214, 0.12) 50%, transparent 50%),
        radial-gradient(1px 1px at 90% 85%, rgba(167, 139, 250, 0.1) 50%, transparent 50%),
        radial-gradient(ellipse at 30% 50%, rgba(212, 164, 76, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(167, 139, 250, 0.03) 0%, transparent 50%);
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-crescent {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    animation: float 3s ease-in-out infinite;
}

.auth-header h1 {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-size: 0.95rem;
}

.auth-dua {
    color: var(--gold-dim);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    font-style: italic;
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-guest {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

/* ═══════════ FORMS ═══════════ */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--gold);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239ca3af' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ═══════════ TEXT INPUT (standalone) ═══════════ */
.text-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition);
}
.text-input:focus {
    outline: none;
    border-color: var(--gold);
}
.text-input::placeholder {
    color: var(--text-muted);
}

/* ═══════════ BUTTONS ═══════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    color: #0a1628;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(212, 164, 76, 0.3);
}

.btn-full { width: 100%; }

.btn-outline {
    background: transparent;
    border: 2px solid var(--gold-dim);
    color: var(--gold);
}

.btn-outline:hover {
    border-color: var(--gold);
    background: rgba(212, 164, 76, 0.1);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

.btn-danger {
    border-color: var(--red);
    color: var(--red);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.1);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.btn-icon:hover {
    color: var(--gold);
    background: rgba(212, 164, 76, 0.1);
}

/* ═══════════ TODAY AT-A-GLANCE ═══════════ */
.today-glance {
    text-align: center;
    padding: 1rem 1.25rem;
}

.glance-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.glance-items {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
}

.glance-item {
    opacity: 0.25;
    filter: grayscale(1);
    transition: all 0.2s;
}

.glance-item.done {
    opacity: 1;
    filter: none;
}

.glance-item.missed {
    opacity: 1;
    filter: hue-rotate(180deg);
}

.glance-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ═══════════ QUOTE CARD ═══════════ */
.quote-card {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.1), rgba(212, 164, 76, 0.08));
    border-color: rgba(167, 139, 250, 0.15);
    text-align: center;
    padding: 1.5rem;
}

.quote-card::before {
    background: linear-gradient(90deg, transparent, var(--purple), var(--gold-dim), transparent);
    height: 2px;
    animation: shimmer-slide 3s ease-in-out infinite;
}

@keyframes shimmer-slide {
    0% { opacity: 0.3; }
    50% { opacity: 0.8; }
    100% { opacity: 0.3; }
}

.quote-text {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.7;
    color: var(--text-primary);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.quote-text::before { content: '\201C'; }
.quote-text::after { content: '\201D'; }

.quote-source {
    font-size: 0.75rem;
    color: var(--purple);
    font-weight: 600;
    letter-spacing: 0.03em;
}

.quote-source::before { content: '\2014 '; }

/* ═══════════ SPINNER ═══════════ */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-center {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ═══════════ ALERTS ═══════════ */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(248, 113, 113, 0.15);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.alert-success {
    background: rgba(74, 222, 128, 0.12);
    color: var(--green);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

/* Remember me / Forgot password row */
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--gold);
    cursor: pointer;
}

.forgot-link {
    color: var(--gold-dim);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color var(--transition);
}

.forgot-link:hover {
    color: var(--gold);
}

/* ═══════════ CARDS ═══════════ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 164, 76, 0.08);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
    opacity: 0.5;
}

.card-title {
    margin-bottom: 0.75rem;
    color: var(--gold-light);
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ═══════════ APP SHELL ═══════════ */
.app-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
}

/* ═══════════ TOP BAR ═══════════ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    height: var(--topbar-height);
    background: rgba(10, 22, 40, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(212, 164, 76, 0.12);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-crescent {
    font-size: 1.3rem;
    animation: float 3s ease-in-out infinite;
    display: inline-block;
}

.topbar-title {
    font-weight: 700;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-user {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ═══════════ BOTTOM NAV ═══════════ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: var(--nav-height);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(212, 164, 76, 0.12);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-item.active {
    color: var(--gold);
}

.nav-item.active::after {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 6px rgba(212, 164, 76, 0.5);
    margin-top: 0.1rem;
}

.nav-item.active svg {
    filter: drop-shadow(0 0 6px rgba(212, 164, 76, 0.4));
}

.nav-item:hover:not(.active) {
    color: var(--text-secondary);
}

/* ═══════════ VIEWS ═══════════ */
.view {
    padding: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.view-header {
    margin-bottom: 1rem;
}

.view-header h2 {
    color: var(--gold-light);
}

.view-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* ═══════════ LOCATION PROMPT ═══════════ */
.location-prompt {
    padding: 1rem;
    max-width: 500px;
    margin: 2rem auto;
}

.location-card {
    text-align: center;
}

.location-card h2 {
    color: var(--gold-light);
    margin-bottom: 0.5rem;
}

.location-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.divider span {
    padding: 0 1rem;
}

.search-results {
    max-height: 200px;
    overflow-y: auto;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
}

.search-result-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background var(--transition);
}

.search-result-item:hover {
    background: var(--bg-card-hover);
}

/* ═══════════ RAMADAN PROGRESS RING ═══════════ */
.ramadan-progress {
    background: linear-gradient(135deg, var(--bg-card), rgba(212, 164, 76, 0.08));
    text-align: center;
    padding: 1.5rem 1.25rem;
}

.progress-ring-container {
    position: relative;
    width: 130px;
    height: 130px;
    margin: 0 auto 0.75rem;
}

.progress-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    filter: drop-shadow(0 0 8px rgba(212, 164, 76, 0.2));
}

.progress-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: url(#ring-gradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 326.7;
    stroke-dashoffset: 326.7;
    transition: stroke-dashoffset 1s ease;
}

.progress-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.progress-ring-day {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--gold);
    line-height: 1;
}

.progress-ring-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 0.15rem;
}

.progress-ring-caption {
    font-size: 0.85rem;
    color: var(--gold-light);
    font-weight: 600;
}

/* ═══════════ STREAK BADGE ═══════════ */
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.75rem;
    padding: 0.4rem 1rem;
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.12), rgba(212, 164, 76, 0.12));
    border: 1px solid rgba(212, 164, 76, 0.2);
    border-radius: 99px;
    animation: streak-glow 2s ease-in-out infinite alternate;
}

.streak-fire {
    font-size: 1.1rem;
    animation: fire-flicker 0.6s ease-in-out infinite alternate;
}

.streak-count {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gold);
}

.streak-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

@keyframes fire-flicker {
    0% { transform: scale(1) rotate(-3deg); }
    100% { transform: scale(1.1) rotate(3deg); }
}

@keyframes streak-glow {
    0% { box-shadow: 0 0 8px rgba(212, 164, 76, 0.1); }
    100% { box-shadow: 0 0 16px rgba(212, 164, 76, 0.2); }
}

@keyframes shimmer {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* ═══════════ COUNTDOWN CARDS ═══════════ */
.countdown-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.countdown-card {
    text-align: center;
    margin-bottom: 0;
    padding: 1rem;
    position: relative;
    overflow: visible;
}

.countdown-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, transparent 30%, var(--gold-dim) 50%, transparent 70%);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    animation: border-glow 3s ease-in-out infinite;
}

@keyframes border-glow {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.6; }
}

.sehri-card {
    background: linear-gradient(135deg, var(--bg-card), rgba(96, 165, 250, 0.1));
    border-color: rgba(96, 165, 250, 0.2);
}

.sehri-card::after {
    background: linear-gradient(135deg, transparent 30%, var(--blue) 50%, transparent 70%);
}

.iftaar-card {
    background: linear-gradient(135deg, var(--bg-card), rgba(212, 164, 76, 0.1));
    border-color: rgba(212, 164, 76, 0.2);
}

.countdown-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.countdown-time {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gold-light);
    font-variant-numeric: tabular-nums;
}

.countdown-remaining {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    margin-top: 0.25rem;
    animation: pulse-soft 2s ease-in-out infinite;
}

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ═══════════ DUA CARDS ═══════════ */
.dua-hint {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gold-dim);
    margin-top: 0.35rem;
    opacity: 0.7;
}

.dua-card {
    text-align: center;
    background: linear-gradient(135deg, rgba(212, 164, 76, 0.06), rgba(167, 139, 250, 0.06));
    border-color: rgba(212, 164, 76, 0.15);
}

.dua-arabic {
    font-size: 1.4rem;
    line-height: 2;
    color: var(--gold-light);
    font-family: var(--font-arabic);
    direction: rtl;
    margin: 0.75rem 0;
}

.dua-transliteration {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.dua-translation {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ═══════════ PRAYER LIST ═══════════ */
.prayer-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.prayer-row {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-xs);
    transition: background var(--transition);
}

.prayer-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.prayer-next {
    background: rgba(212, 164, 76, 0.1) !important;
    border: 1px solid rgba(212, 164, 76, 0.2);
}

.prayer-icon {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
    margin-right: 0.5rem;
}

.prayer-name {
    flex: 1;
    font-weight: 500;
    font-size: 0.95rem;
}

.prayer-time {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--gold-light);
    margin-right: 0.5rem;
}

.prayer-badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--bg-deep);
    background: var(--gold);
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
}

/* ═══════════ NEXT PRAYER CARD ═══════════ */
.next-prayer-card {
    text-align: center;
    background: linear-gradient(135deg, rgba(212, 164, 76, 0.08), rgba(167, 139, 250, 0.08));
    position: relative;
    overflow: visible;
}

.next-prayer-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, var(--gold-dim), transparent, var(--purple), transparent, var(--gold-dim));
    background-size: 300% 300%;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: gradient-rotate 4s ease-in-out infinite;
}

@keyframes gradient-rotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.next-prayer-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
}

.next-prayer-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gold-light);
    margin: 0.25rem 0;
}

.next-prayer-countdown {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* ═══════════ QUICK CHECK-IN ═══════════ */
.quick-checkin {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.checkin-row > span {
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
}

/* ═══════════ TOGGLE BUTTONS ═══════════ */
.toggle-group {
    display: flex;
    gap: 0.5rem;
}

.toggle-btn {
    padding: 0.4rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}

.toggle-btn.active {
    background: var(--green);
    border-color: var(--green);
    color: #0a1628;
    transform: scale(1.05);
    animation: toggle-pop-sm 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toggle-pop-sm {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1.05); }
}

.toggle-btn.toggle-no.active {
    background: var(--red);
    border-color: var(--red);
}

.toggle-group-lg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.toggle-group-lg.three-col {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}
.toggle-group-lg.three-col .toggle-lg {
    padding: 1rem 0.5rem;
    font-size: 0.8rem;
}

.toggle-lg {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-lg .toggle-icon {
    font-size: 1.8rem;
}

.toggle-lg:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: var(--bg-card-hover);
}

.toggle-lg.active {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.15), rgba(74, 222, 128, 0.05));
    border-color: var(--green);
    color: var(--green);
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.1);
    animation: toggle-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toggle-lg.toggle-no.active {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.15), rgba(248, 113, 113, 0.05));
    border-color: var(--red);
    color: var(--red);
    box-shadow: 0 0 20px rgba(248, 113, 113, 0.1);
    animation: toggle-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toggle-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.08); }
    100% { transform: scale(1.02); }
}

/* ═══════════ MOOD GRID ═══════════ */
.mood-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.mood-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.75rem 0.25rem;
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mood-emoji {
    font-size: 1.6rem;
    transition: transform 0.3s ease;
}

.mood-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mood-btn:hover {
    border-color: rgba(212, 164, 76, 0.3);
    background: var(--bg-card-hover);
}

.mood-btn:hover .mood-emoji {
    transform: scale(1.2);
}

.mood-btn.active {
    border-color: var(--gold);
    background: rgba(212, 164, 76, 0.1);
    color: var(--gold-light);
    transform: scale(1.05);
    box-shadow: 0 0 16px rgba(212, 164, 76, 0.15);
}

.mood-btn.active .mood-emoji {
    transform: scale(1.3);
}

/* Mood mini (dashboard) */
.mood-mini {
    display: flex;
    gap: 0.25rem;
    flex-wrap: nowrap;
}

.mood-btn-mini {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    border-radius: 50%;
    background: var(--bg-surface);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition);
}

.mood-btn-mini.active {
    border-color: var(--gold);
    background: rgba(212, 164, 76, 0.15);
    transform: scale(1.15);
}

.mood-btn-mini:hover {
    transform: scale(1.15);
}

.mood-selected-label {
    color: var(--gold);
    font-weight: 500;
    margin-left: 0.25rem;
}

/* ═══════════ DATE NAV ═══════════ */
.date-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-card);
    border-radius: var(--radius);
}

.date-display {
    text-align: center;
}

.date-main {
    display: block;
    font-weight: 700;
    font-size: 1rem;
}

.date-ramadan {
    display: block;
    font-size: 0.75rem;
    color: var(--gold);
    font-weight: 600;
}

/* ═══════════ TRACKER SECTIONS ═══════════ */
.tracker-sections {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tracker-card {
    transition: transform var(--transition);
}

.missed-reason-wrap {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.missed-reason-wrap .field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

/* ═══════════ DAILY REFLECTION ═══════════ */
.form-group textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
}

.form-group textarea::placeholder {
    color: var(--text-muted);
}

.reflection-meta {
    display: flex;
    justify-content: space-between;
    margin-top: -0.5rem;
}

/* ═══════════ SAVE INDICATOR ═══════════ */
.save-indicator {
    position: fixed;
    bottom: calc(var(--nav-height) + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold);
    color: var(--bg-deep);
    padding: 0.4rem 1.25rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(212, 164, 76, 0.3);
    z-index: 99;
    animation: slide-up 0.3s ease;
}

@keyframes slide-up {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ═══════════ STATS GRID ═══════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    border: 1px solid rgba(212, 164, 76, 0.08);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gold);
    line-height: 1;
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 0.35rem;
}

/* ═══════════ CALENDAR — 7-COL WEEKLY GRID ═══════════ */
.calendar-container {
    margin: 1rem -1rem 0;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 0.6rem 0.25rem;
    border: 1px solid rgba(212, 164, 76, 0.06);
}

.cal-weekday-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0.5rem;
}

.cal-weekday {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0.2rem 0;
}

.cal-weekday-fri {
    color: var(--gold);
}

/* Phase markers */
.cal-phase {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.6rem;
    margin: 0.6rem 0 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.cal-phase-name { letter-spacing: 0.02em; }
.cal-phase-range { font-weight: 500; opacity: 0.6; font-size: 0.65rem; }

.cal-phase-mercy {
    background: rgba(74, 222, 128, 0.08);
    color: var(--green);
    border-left: 2px solid var(--green);
}

.cal-phase-forgiveness {
    background: rgba(212, 164, 76, 0.08);
    color: var(--gold);
    border-left: 2px solid var(--gold);
}

.cal-phase-freedom {
    background: rgba(124, 58, 237, 0.08);
    color: var(--purple);
    border-left: 2px solid var(--purple);
}

/* Week row */
.cal-week-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 2px;
}

/* Ensure button cells stretch to fill their grid slot */
.cal-week-row > div {
    display: flex;
}

/* Individual cell */
.cal-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    width: 100%;
    padding: 0.35rem 0;
    aspect-ratio: 0.75;
    border: 1.5px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    background: var(--bg-surface);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
    font-family: inherit;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.cal-cell:hover:not(.cal-empty):not(.cal-future) {
    border-color: rgba(212, 164, 76, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.cal-empty {
    border-color: transparent;
    background: transparent;
    cursor: default;
}

/* Day numbers */
.cal-rday {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.1;
}

.cal-gdate {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 500;
    opacity: 0.7;
}

.cal-mood {
    font-size: 1.15rem;
    min-height: 1.15em;
    line-height: 1;
}

.cal-icons {
    font-size: 1rem;
    display: flex;
    gap: 2px;
}

/* Status colors */
.cal-fasted {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.25);
}

.cal-missed {
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.2);
}

.cal-unlogged {
    opacity: 0.5;
    border-style: dashed;
}

.cal-future {
    opacity: 0.35;
    cursor: default;
    border-color: rgba(255, 255, 255, 0.03);
}

/* Today spotlight */
.cal-today {
    border-color: var(--gold) !important;
    box-shadow: inset 0 0 0 1px rgba(212, 164, 76, 0.2), 0 0 10px rgba(212, 164, 76, 0.12);
    opacity: 1 !important;
    background: rgba(212, 164, 76, 0.06);
    animation: today-pulse 3s ease-in-out infinite;
}

@keyframes today-pulse {
    0%, 100% { box-shadow: inset 0 0 0 1px rgba(212, 164, 76, 0.2), 0 0 10px rgba(212, 164, 76, 0.1); }
    50% { box-shadow: inset 0 0 0 1px rgba(212, 164, 76, 0.35), 0 0 16px rgba(212, 164, 76, 0.2); }
}

/* Legend */
.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    justify-content: center;
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.cal-legend-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.cal-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    border: 1px solid transparent;
}

.cal-legend-fasted {
    background: rgba(74, 222, 128, 0.35);
    border-color: rgba(74, 222, 128, 0.5);
}

.cal-legend-missed {
    background: rgba(248, 113, 113, 0.35);
    border-color: rgba(248, 113, 113, 0.5);
}

.cal-legend-unlogged {
    background: var(--bg-surface);
    opacity: 0.5;
}

.cal-legend-today {
    background: rgba(212, 164, 76, 0.1);
    border-color: var(--gold);
    border-width: 1.5px;
}

/* Encouragement */
.cal-encouragement {
    text-align: center;
    color: var(--gold-dim);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.6rem;
    font-style: italic;
}

/* ═══════════ ABOUT PAGE ═══════════ */
.about-header {
    text-align: center;
    padding: 1.5rem 0 0.5rem;
}

.about-moon {
    font-size: 3rem;
    animation: float 3s ease-in-out infinite;
    display: inline-block;
}

.about-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--gold);
    margin: 0.25rem 0;
}

.about-tagline {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.about-view .card {
    margin-bottom: 0.75rem;
}

.about-view .card p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.about-view .card p:last-child {
    margin-bottom: 0;
}

.about-arabic {
    font-size: 1.3rem;
    color: var(--gold);
    font-weight: 600;
}

.about-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.about-features li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.about-features li:last-child {
    border-bottom: none;
}

.about-dua {
    font-style: italic;
    color: var(--gold-dim) !important;
    text-align: center;
    margin-top: 0.5rem;
}

.auth-about {
    text-align: center;
    margin-top: 1rem;
}

.auth-about a {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-about a:hover {
    color: var(--gold);
}

/* ═══════════ QIBLA COMPASS ═══════════ */
.qibla-card {
    text-align: center;
    padding: 2rem 1.5rem;
}

.compass-container {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 0 auto 1.5rem;
}

.compass {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--gold-dim);
    background: radial-gradient(circle, var(--bg-card), var(--bg-surface));
    position: relative;
    transition: transform 0.3s ease;
}

.compass-ring {
    position: absolute;
    inset: 0;
}

.compass-ring span {
    position: absolute;
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.compass-n {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--gold) !important;
    font-size: 1rem !important;
}

.compass-e {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.compass-s {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.compass-w {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.qibla-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 50%;
    transform-origin: bottom center;
    margin-left: -2px;
    margin-top: -50%;
}

.needle-point {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 60px solid var(--gold);
    margin-left: -8px;
    filter: drop-shadow(0 0 8px rgba(212, 164, 76, 0.4));
}

.needle-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 4px;
    margin-left: -14px;
}

.kaaba-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    z-index: 5;
}

.qibla-info {
    margin-bottom: 1.5rem;
}

.qibla-degrees {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gold);
}

.qibla-distance {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.compass-prompt {
    margin-top: 1rem;
}

.compass-prompt p {
    margin-top: 0.5rem;
}

.compass-status {
    font-size: 0.85rem;
    padding: 0.5rem;
    border-radius: var(--radius-xs);
    margin-top: 1rem;
}

/* ═══════════ SETTINGS ═══════════ */
.current-location {
    padding: 0.75rem;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
}

/* ═══════════ UTILITIES ═══════════ */
.text-center { text-align: center; }
.text-sm { font-size: 0.85rem; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--green); background: rgba(74, 222, 128, 0.1); }
.mt-1 { margin-top: 0.75rem; }
.mt-half { margin-top: 0.5rem; }
.mt-quarter { margin-top: 0.25rem; }
.mb-1 { margin-bottom: 0.75rem; }
.text-xs { font-size: 0.75rem; }

/* ═══════════ RESPONSIVE ═══════════ */
@media (min-width: 768px) {
    .view {
        max-width: 640px;
        padding: 1.5rem;
    }

    .mood-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.75rem;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .compass-container {
        width: 280px;
        height: 280px;
    }
}

@media (min-width: 1024px) {
    .bottom-nav {
        max-width: 640px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: var(--radius) var(--radius) 0 0;
    }

}

/* Calendar — tiny screens */
@media (max-width: 380px) {
    .calendar-container { padding: 0.5rem 0.15rem; }
    .cal-rday { font-size: 0.75rem; }
    .cal-gdate { display: none; }
    .cal-mood { font-size: 0.6rem; }
    .cal-icons { display: none; }
    .cal-phase { font-size: 0.6rem; padding: 0.25rem 0.4rem; }
}

/* ═══════════ SCROLLBAR ═══════════ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gold-dim);
    border-radius: 99px;
}

/* ═══════════ SELECTION ═══════════ */
::selection {
    background: rgba(212, 164, 76, 0.3);
    color: var(--text-primary);
}

/* ═══════════ CELEBRATION CONFETTI ═══════════ */
.celebration {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 200;
    overflow: hidden;
}

.celebration .particle {
    position: absolute;
    top: -12px;
    animation: confetti-fall 1.8s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg) scale(0.3);
        opacity: 0;
    }
}

/* ═══════════ MILESTONE BANNER ═══════════ */
.milestone-banner {
    background: linear-gradient(135deg, rgba(212, 164, 76, 0.15), rgba(167, 139, 250, 0.1));
    border: 1px solid rgba(212, 164, 76, 0.3);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: milestone-in 0.5s ease-out;
}

.milestone-emoji {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.milestone-text {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-light);
    flex: 1;
}

.milestone-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    line-height: 1;
    transition: color var(--transition);
}

.milestone-dismiss:hover {
    color: var(--text-primary);
}

@keyframes milestone-in {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ═══════════ NOTIFICATION SETTINGS ═══════════ */
.notif-toggles {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notif-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-xs);
    background: var(--bg-surface);
}

.notif-row span {
    font-size: 0.9rem;
    font-weight: 500;
}

.notif-row select {
    padding: 0.35rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid rgba(212, 164, 76, 0.2);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

/* ═══════════ THEME TOGGLE ═══════════ */
.theme-toggle-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.theme-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-opt-icon { font-size: 1.5rem; }

.theme-opt:hover {
    border-color: rgba(212, 164, 76, 0.3);
    background: var(--bg-card-hover);
}

.theme-opt.active {
    border-color: var(--gold);
    background: rgba(212, 164, 76, 0.1);
    color: var(--gold);
    animation: toggle-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ═══════════ LIGHT THEME ═══════════ */
[data-theme="light"] {
    --bg-deep: #f5f0e8;
    --bg-card: #ffffff;
    --bg-card-hover: #f9f6f0;
    --bg-surface: #ede8dd;
    --gold: #b8860b;
    --gold-light: #8b6508;
    --gold-dim: #d4a44c;
    --green: #16a34a;
    --green-dim: #bbf7d0;
    --red: #dc2626;
    --red-dim: #fecaca;
    --blue: #2563eb;
    --purple: #7c3aed;
    --text-primary: #1a1a2e;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] body::before {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(184, 134, 11, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(124, 58, 237, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(37, 99, 235, 0.03) 0%, transparent 40%);
}


[data-theme="light"] .topbar {
    background: rgba(245, 240, 232, 0.92);
    border-bottom-color: rgba(184, 134, 11, 0.15);
}

[data-theme="light"] .bottom-nav {
    background: rgba(245, 240, 232, 0.95);
    border-top-color: rgba(184, 134, 11, 0.15);
}

[data-theme="light"] .auth-header h1,
[data-theme="light"] .topbar-title {
    -webkit-text-fill-color: var(--gold);
}

[data-theme="light"] .card {
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border-color: rgba(184, 134, 11, 0.1);
}

[data-theme="light"] .card::before {
    background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select,
[data-theme="light"] .form-group textarea {
    background: var(--bg-surface);
    color: var(--text-primary);
}

[data-theme="light"] .btn-primary {
    color: #fff;
}

[data-theme="light"] .sehri-card {
    background: linear-gradient(135deg, #ffffff, rgba(37, 99, 235, 0.08));
}

[data-theme="light"] .iftaar-card {
    background: linear-gradient(135deg, #ffffff, rgba(184, 134, 11, 0.08));
}

[data-theme="light"] .quote-card {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.06), rgba(184, 134, 11, 0.04));
}

[data-theme="light"] .toggle-btn {
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .toggle-btn.active {
    color: #fff;
}

[data-theme="light"] .toggle-btn.toggle-no.active {
    color: #fff;
}

[data-theme="light"] .toggle-lg {
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .mood-btn {
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .calendar-container {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .cal-weekday-header {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .cal-cell {
    background: #f8f8f6;
    border-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .cal-empty {
    border-color: transparent;
    background: transparent;
}

[data-theme="light"] .cal-today {
    border-color: var(--gold) !important;
    background: rgba(212, 164, 76, 0.06);
    box-shadow: inset 0 0 0 1px rgba(184, 134, 11, 0.15), 0 0 10px rgba(184, 134, 11, 0.1);
}

[data-theme="light"] .cal-legend {
    border-top-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .prayer-badge {
    color: #fff;
}

[data-theme="light"] .prayer-next {
    background: rgba(184, 134, 11, 0.08) !important;
    border-color: rgba(184, 134, 11, 0.2);
}

[data-theme="light"] .auth-screen {
    background:
        radial-gradient(1.5px 1.5px at 20% 30%, rgba(184, 134, 11, 0.15) 50%, transparent 50%),
        radial-gradient(1px 1px at 60% 15%, rgba(124, 58, 237, 0.1) 50%, transparent 50%),
        radial-gradient(1px 1px at 80% 60%, rgba(184, 134, 11, 0.1) 50%, transparent 50%),
        radial-gradient(ellipse at 30% 50%, rgba(184, 134, 11, 0.04) 0%, transparent 50%);
}

[data-theme="light"] .auth-guest {
    border-top-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .divider::before,
[data-theme="light"] .divider::after {
    background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .search-result-item {
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .notif-row select {
    background: var(--bg-surface);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
}

[data-theme="light"] .loading-screen {
    background: var(--bg-deep);
}

[data-theme="light"] .spinner {
    border-color: rgba(0, 0, 0, 0.15);
    border-top-color: currentColor;
}

[data-theme="light"] .theme-opt {
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .date-nav {
    background: var(--bg-card);
}

[data-theme="light"] .ramadan-progress {
    background: linear-gradient(135deg, var(--bg-card), rgba(184, 134, 11, 0.06));
}

[data-theme="light"] .progress-ring-bg {
    stroke: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .next-prayer-card {
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.06), rgba(124, 58, 237, 0.06));
}

[data-theme="light"] .dua-card {
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.04), rgba(124, 58, 237, 0.04));
}

[data-theme="light"] .compass {
    background: radial-gradient(circle, var(--bg-card), var(--bg-surface));
    border-color: var(--gold);
}

[data-theme="light"] .milestone-banner {
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.1), rgba(124, 58, 237, 0.06));
    border-color: rgba(184, 134, 11, 0.2);
}

[data-theme="light"] .streak-badge {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.08), rgba(184, 134, 11, 0.08));
    border-color: rgba(184, 134, 11, 0.15);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(184, 134, 11, 0.3);
}

[data-theme="light"] ::selection {
    background: rgba(184, 134, 11, 0.2);
}

[data-theme="light"] .dua-category-card {
    box-shadow: var(--shadow-sm);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .dua-quick-card {
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.04), rgba(124, 58, 237, 0.04));
}

[data-theme="light"] .view-toggle {
    background: var(--bg-card);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .view-toggle-btn.active {
    background: rgba(184, 134, 11, 0.12);
}

[data-theme="light"] .summary-card {
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.06), rgba(124, 58, 237, 0.04));
    border-color: rgba(184, 134, 11, 0.15);
}

[data-theme="light"] .mood-chart-bar-bg {
    background: var(--bg-surface);
}

/* ═══════════ VIEW TOGGLE ═══════════ */
.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 0.25rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(212, 164, 76, 0.08);
}

.view-toggle-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
}

.view-toggle-btn.active {
    background: rgba(212, 164, 76, 0.15);
    color: var(--gold);
}

.view-toggle-btn:hover:not(.active) {
    color: var(--text-primary);
}

/* ═══════════ FASTING CHART ═══════════ */
.fasting-chart {
    display: flex;
    gap: 2px;
    height: 80px;
    align-items: flex-end;
    margin: 0.75rem 0;
}

.fasting-bar {
    flex: 1;
    min-width: 0;
    border-radius: 2px 2px 0 0;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    cursor: default;
}

.fasting-bar-fasted {
    height: 100%;
    background: var(--green);
    opacity: 0.8;
}

.fasting-bar-missed {
    height: 100%;
    background: var(--red);
    opacity: 0.8;
}

.fasting-bar-unlogged {
    height: 40%;
    background: var(--text-muted);
    opacity: 0.3;
}

.fasting-bar-today {
    height: 60%;
    background: var(--gold);
    opacity: 0.6;
    animation: today-pulse 2s ease-in-out infinite;
}

.fasting-bar-future {
    height: 20%;
    background: var(--text-muted);
    opacity: 0.15;
}

.fasting-bar-label {
    position: absolute;
    bottom: -16px;
    font-size: 0.5rem;
    color: var(--text-muted);
    display: none;
}

.fasting-bar:nth-child(5n) .fasting-bar-label {
    display: block;
}

.fasting-chart-legend {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.25rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.chart-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-right: 0.25rem;
    vertical-align: middle;
}

.chart-dot-fasted { background: var(--green); opacity: 0.8; }
.chart-dot-missed { background: var(--red); opacity: 0.8; }
.chart-dot-unlogged { background: var(--text-muted); opacity: 0.3; }

/* ═══════════ MOOD CHART ═══════════ */
.mood-chart {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mood-chart-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mood-chart-emoji {
    font-size: 1.2rem;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.mood-chart-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    width: 60px;
    flex-shrink: 0;
}

.mood-chart-bar-bg {
    flex: 1;
    height: 16px;
    background: var(--bg-surface);
    border-radius: 8px;
    overflow: hidden;
}

.mood-chart-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dim), var(--gold));
    border-radius: 8px;
    transition: width 0.5s ease;
    min-width: 4px;
}

.mood-chart-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gold);
    width: 1.5rem;
    text-align: right;
    flex-shrink: 0;
}

/* ═══════════ WORKOUT CHART ═══════════ */
.workout-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 120px;
    gap: 0.5rem;
    padding-top: 0.5rem;
}

.workout-chart-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.workout-chart-bar-wrap {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.workout-chart-bar {
    width: 80%;
    max-width: 40px;
    background: linear-gradient(to top, var(--green), rgba(74, 222, 128, 0.6));
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
    min-height: 2px;
}

.workout-chart-count {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--green);
}

.workout-chart-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ═══════════ SUMMARY CARD ═══════════ */
.summary-card {
    background: linear-gradient(135deg, rgba(212, 164, 76, 0.08), rgba(167, 139, 250, 0.06));
    border-color: rgba(212, 164, 76, 0.2);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.5rem 0;
}

.summary-emoji {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gold);
    line-height: 1;
}

.summary-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-top: 0.2rem;
}

.summary-message {
    text-align: center;
    color: var(--gold-light);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(212, 164, 76, 0.15);
}

/* ═══════════ DUA LIBRARY ═══════════ */
.dua-search-input {
    margin-bottom: 0.5rem;
}

.dua-category-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.dua-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1.25rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid rgba(212, 164, 76, 0.08);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.dua-category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
    opacity: 0.5;
}

.dua-category-card:hover {
    border-color: rgba(212, 164, 76, 0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.dua-category-emoji {
    font-size: 2rem;
}

.dua-category-name {
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    line-height: 1.3;
}

.dua-category-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.dua-list-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.dua-list-title {
    font-family: var(--font-display);
    color: var(--gold-light);
    font-size: 1.1rem;
}

.dua-lib-card {
    text-align: center;
    margin-bottom: 0.75rem;
}

.dua-source {
    font-size: 0.7rem;
    color: var(--gold-dim);
    font-weight: 600;
    margin-top: 0.5rem;
    letter-spacing: 0.02em;
}

.dua-quick-card {
    background: linear-gradient(135deg, rgba(212, 164, 76, 0.06), rgba(167, 139, 250, 0.06));
    border-color: rgba(212, 164, 76, 0.15);
    transition: transform var(--transition), border-color var(--transition);
}

.dua-quick-card:hover {
    border-color: rgba(212, 164, 76, 0.3);
    transform: translateY(-1px);
}

.dua-quick-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dua-quick-emoji {
    font-size: 2rem;
    flex-shrink: 0;
}

/* ═══════════ PWA INSTALL BANNER ═══════════ */
.install-banner {
    background: linear-gradient(135deg, rgba(212, 164, 76, 0.12), rgba(167, 139, 250, 0.08));
    border: 1px solid rgba(212, 164, 76, 0.25);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.install-banner-text strong {
    color: var(--gold-light);
    font-size: 0.95rem;
}

.install-banner-text p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

.install-banner-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ═══════════ TRANSITIONS ═══════════ */
[x-transition] {
    transition: all 0.3s ease;
}
