/* ================================================
   ISLAMIC CALENDAR PWA — Premium Dark Theme
   ================================================ */

:root {
    /* Core palette — deep space teal + warm gold */
    --bg-primary: #0a1628;
    --bg-secondary: #0f1f3a;
    --bg-card: rgba(15, 31, 58, 0.85);
    --bg-glass: rgba(15, 31, 58, 0.55);
    --surface: #162544;
    --surface-hover: #1c3058;
    --border: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(0, 200, 150, 0.25);

    /* Main regions */
    --bg-main: var(--bg-primary);
    --bg-sidebar: var(--bg-secondary);

    /* Accent colors */
    --accent-primary: #00c896;
    --accent-primary-rgb: 0, 200, 150;
    --accent-gold: #f5c842;
    --accent-gold-rgb: 245, 200, 66;

    /* Text */
    --text-primary: #e8edf5;
    --text-secondary: #8a9bb5;
    --text-muted: #556a85;
    --text-accent: #00e6aa;

    /* Category colors */
    --cat-eid: #FFD700;
    --cat-holy: #00E676;
    --cat-fasting: #42A5F5;
    --cat-hajj: #AB47BC;
    --cat-historical: #FF7043;

    /* Sizing */
    --header-h: 60px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Fonts */
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-arabic: 'Amiri', serif;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 18px;
    /* Increased to 18px */
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
    overscroll-behavior-y: contain;
    /* UX Fix */
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100dvh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Animated geometric background pattern */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.04;
    background-image:
        url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%2300c896' stroke-width='0.6'%3E%3Cpolygon points='40,4 76,24 76,56 40,76 4,56 4,24'/%3E%3Cpolygon points='40,16 64,28 64,52 40,64 16,52 16,28'/%3E%3Cline x1='40' y1='4' x2='40' y2='16'/%3E%3Cline x1='76' y1='24' x2='64' y2='28'/%3E%3Cline x1='76' y1='56' x2='64' y2='52'/%3E%3Cline x1='40' y1='76' x2='40' y2='64'/%3E%3Cline x1='4' y1='56' x2='16' y2='52'/%3E%3Cline x1='4' y1='24' x2='16' y2='28'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

/* ================================================
   HEADER
   ================================================ */
#app-header {
    /* Set to static to allow children to stick to viewport */
    position: static;
    z-index: 100;
}



.header-top {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 12px;
    width: 100%;
    margin: 0;
    gap: 12px;
    position: sticky;
    top: 0;
    height: 50px; /* ENFORCED */
    background: var(--bg-primary); 
    z-index: 1100;
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: none;
}

#app-main {
    padding-top: 0; /* No longer needed as header is sticky within main */
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    font-size: 1.6rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(var(--accent-primary-rgb), 0.4));
}

.header-brand h1 {
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
    padding: 2px 0;
}

.header-actions::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.icon-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease);
}

.icon-btn:hover,
.icon-btn:active {
    background: var(--surface-hover);
    color: var(--accent-primary);
    border-color: var(--border-glow);
    box-shadow: 0 0 12px rgba(var(--accent-primary-rgb), 0.15);
}

/* Compact Today Banner */
.today-banner {
    box-sizing: border-box;
    padding: 10px 16px;
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: sticky;
    top: 82px; /* 50 + 32 */
    background: var(--surface);
    z-index: 1060;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    min-height: 80px; /* Allows content to expand natively */
    justify-content: center;
}

.today-banner::before {
    content: '✦';
    position: absolute;
    top: 8px;
    right: 14px;
    font-size: 0.7rem;
    color: rgba(245, 200, 66, 0.25);
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.2;
    }

    50% {
        opacity: 0.6;
        transform: scale(1.3) rotate(15deg);
    }
}

.today-hijri {
    font-family: var(--font-arabic);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent-gold);
    text-shadow: 0 0 20px rgba(245, 200, 66, 0.15);
    text-align: center;
    line-height: 1.2;
}

.today-greg {
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-align: center;
}

.today-event {
    font-size: 0.78rem;
    color: var(--accent-primary);
    font-weight: 600;
    text-align: center;
    margin-top: 2px;
    animation: pulseGlow 3s ease-in-out infinite;
}

/* Hero countdown ring */
.hero-countdown {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding: 8px 16px;
    background: rgba(0, 200, 150, 0.06);
    border: 1px solid rgba(0, 200, 150, 0.12);
    border-radius: 24px;
}

.hero-countdown svg {
    width: 36px;
    height: 36px;
    transform: rotate(-90deg);
}

.countdown-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 3;
}

.countdown-ring-fill {
    fill: none;
    stroke: var(--accent-primary);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.hero-countdown-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.hero-countdown-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hero-countdown-time {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-primary);
    font-variant-numeric: tabular-nums;
}

@keyframes pulseGlow {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }
}

.settings-jump-row {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
}

/* ================================================
   MONTH NAVIGATION
   ================================================ */
.month-nav {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 12px;
    max-width: 720px;
    margin: 0 auto;
    background: var(--surface);
    position: sticky;
    top: 136px; /* 82 + 54 */
    z-index: 1040;
    border-bottom: none;
    height: 38px; /* Compact */
    overflow: hidden;
}

.nav-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease);
}

.nav-btn:hover,
.nav-btn:active {
    background: var(--surface-hover);
    color: var(--accent-primary);
    border-color: var(--border-glow);
    transform: scale(1.05);
}

.month-title-block {
    text-align: center;
    flex: 1;
    min-width: 0;
}

.month-title-hijri {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--accent-gold);
    line-height: 1.1;
}

.month-title-greg {
    font-size: 0.65rem;
    color: var(--text-muted);
    display: block;
    margin-top: 0px;
}

/* ================================================
   CALENDAR GRID
   ================================================ */
.calendar-section-wrapper {
    position: relative;
    overflow: visible; /* CRITICAL for stickiness */
    width: 100%;
}

.calendar-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 8px 10px 0;
}

.calendar-weekdays {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    padding: 0;
    max-width: 720px;
    margin: 0 auto;
    background: var(--surface);
    position: sticky;
    top: 174px; /* 136 + 38 */
    z-index: 1020;
    border-bottom: none;
    height: 28px; /* Compact */
    align-items: center;
    overflow: hidden;
}

.calendar-weekdays .weekday {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-weekdays .weekday.friday {
    color: var(--accent-primary);
}

.calendar-container {
    overflow: hidden;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    transition: opacity 0.2s var(--ease), transform 0.25s var(--ease);
}

.calendar-grid.fading {
    opacity: 0;
}

.calendar-grid.slide-left {
    animation: slideOutLeft 0.22s var(--ease) forwards;
}

.calendar-grid.slide-right {
    animation: slideOutRight 0.22s var(--ease) forwards;
}

.calendar-grid.slide-in-left {
    animation: slideInLeft 0.22s var(--ease) forwards;
}

.calendar-grid.slide-in-right {
    animation: slideInRight 0.22s var(--ease) forwards;
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(-40px);
        opacity: 0;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(40px);
        opacity: 0;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(40px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(-40px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Calendar Day Cell */
.day-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    overflow: hidden;
    min-height: 60px;
    /* Increased to 60px */
}

.day-cell:hover {
    background: var(--surface-hover);
    border-color: rgba(var(--accent-primary-rgb), 0.3);
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.day-cell:active {
    transform: scale(0.96);
    transition-duration: 0.06s;
}

/* Ripple effect on tap */
.day-cell::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(0, 200, 150, 0.25), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
    pointer-events: none;
}

.day-cell.ripple::after {
    opacity: 1;
    animation: rippleFade 0.5s ease forwards;
}

@keyframes rippleFade {
    0% {
        opacity: 0.6;
        transform: scale(0.8);
    }

    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

.day-cell.empty {
    background: transparent;
    border-color: transparent;
    cursor: default;
    pointer-events: none;
}

.day-cell.today {
    background: linear-gradient(135deg, rgba(var(--accent-primary-rgb), 0.2), rgba(var(--accent-gold-rgb), 0.1));
    border-color: var(--accent-primary);
    box-shadow:
        0 0 12px rgba(var(--accent-primary-rgb), 0.2),
        inset 0 0 20px rgba(var(--accent-primary-rgb), 0.05);
}

.day-cell.today::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-gold));
    opacity: 0.15;
    z-index: 0;
    animation: todayPulse 3s ease-in-out infinite;
}

.day-cell.selected-highlight {
    background: rgba(var(--accent-gold-rgb), 0.2) !important;
    border: 2px solid var(--accent-gold) !important;
    animation: highlightPulse 1.5s ease-out;
    z-index: 2;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--accent-gold-rgb), 0.7);
    }

    100% {
        box-shadow: 0 0 0 12px rgba(var(--accent-gold-rgb), 0);
    }
}

@keyframes todayPulse {

    0%,
    100% {
        opacity: 0.1;
    }

    50% {
        opacity: 0.22;
    }
}

.day-cell.has-event {
    border-color: rgba(255, 255, 255, 0.08);
}

.day-hijri {
    position: relative;
    z-index: 1;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.1;
}

.day-greg {
    position: relative;
    z-index: 1;
    font-size: 0.58rem;
    color: var(--text-muted);
    line-height: 1.2;
    margin-top: 1px;
}

.day-cell.today .day-hijri {
    color: var(--accent-primary);
    font-weight: 700;
}

/* Event dot indicators */
.day-dots {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    z-index: 1;
}

.event-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Friday highlight */
.day-cell.friday .day-hijri {
    color: var(--accent-primary);
}

/* Highlight effect for 'Go to Today' */
@keyframes highlight-pulse-large {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(var(--accent-primary-rgb), 0);
    }

    50% {
        transform: scale(1.15);
        box-shadow: 0 0 20px rgba(var(--accent-primary-rgb), 0.6);
        z-index: 10;
        border-color: var(--accent-gold);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(var(--accent-primary-rgb), 0);
    }
}

.day-cell.highlight-effect {
    animation: highlight-pulse-large 0.8s ease-out;
}

/* ================================================
   EVENTS SECTION
   ================================================ */
.events-section {
    max-width: 720px;
    margin: 20px auto 0;
    padding: 0 16px;
}

.events-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.events-title::before {
    content: '';
    width: 3px;
    height: 18px;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-gold));
    border-radius: 2px;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    position: relative;
    overflow: hidden;
}

.event-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 0 2px 2px 0;
}

.event-card:hover {
    background: var(--surface-hover);
    border-color: rgba(var(--accent-primary-rgb), 0.2);
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.event-card-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.event-card-body {
    flex: 1;
    min-width: 0;
}

.event-card-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.event-card-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.event-card-category {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 20px;
    flex-shrink: 0;
}

.event-share-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-left: 4px;
    transition: all 0.2s var(--ease);
    flex-shrink: 0;
}

.event-share-btn:hover {
    background: rgba(var(--accent-primary-rgb), 0.1);
    color: var(--accent-primary);
    transform: scale(1.1);
}

.no-events {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

/* ================================================
   LEGEND
   ================================================ */
.legend-section {
    max-width: 720px;
    margin: 20px auto 0;
    padding: 0 16px 24px;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    background: var(--surface);
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ================================================
   MODALS
   ================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s var(--ease);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    max-width: 420px;
    width: 100%;
    position: relative;
    animation: slideUp 0.3s var(--ease);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease);
}

.modal-close-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

/* Language Modal */
.lang-modal-card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.lang-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.lang-option {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.85rem;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s var(--ease);
    font-family: var(--font-body);
}

.lang-option:hover {
    background: var(--surface-hover);
    border-color: var(--border-glow);
}

.lang-option.active {
    background: rgba(var(--accent-primary-rgb), 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    font-weight: 600;
}

/* Event Detail Modal */
.event-modal-card {
    text-align: center;
    padding: 32px 24px;
}

.event-modal-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.event-modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.3;
}

.event-modal-date {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.event-modal-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.event-modal-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 5px 14px;
    border-radius: 20px;
}

/* ================================================
   INSTALL BANNER
   ================================================ */
.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: linear-gradient(135deg, var(--surface), var(--bg-secondary));
    border-top: 1px solid var(--border-glow);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideUp 0.4s var(--ease);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}

.install-banner span {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.install-btn {
    background: linear-gradient(135deg, var(--accent-primary), #00a87a);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    font-family: var(--font-body);
}

.install-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 16px rgba(var(--accent-primary-rgb), 0.3);
}

.install-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
}

/* ================================================
   UPDATE AVAILABLE BANNER
   ================================================ */
/* Offline Indicator */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #7c4a00, #b36b00);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: slideDown 0.4s var(--ease);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: background 0.4s ease, opacity 0.4s ease;
}

.offline-banner.online-mode {
    background: linear-gradient(135deg, #0d5c2e, #1a8a45);
}

.offline-icon {
    font-size: 0.9rem;
    animation: pulse 2s ease-in-out infinite;
}

.offline-text {
    font-size: 0.78rem;
    font-weight: 600;
    color: #ffecd2;
    letter-spacing: 0.02em;
}

/* Connectivity Dot (always visible in location bar) */
.connectivity-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #4caf50;
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.7);
    margin-right: 4px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
}

.connectivity-dot.offline {
    background-color: #ff9800;
    box-shadow: 0 0 6px rgba(255, 152, 0, 0.7);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.update-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: linear-gradient(135deg, #1a2744, #162040);
    border-top: 1px solid rgba(66, 165, 245, 0.4);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideUp 0.4s var(--ease);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}

.update-banner-text {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.update-btn {
    background: linear-gradient(135deg, #42a5f5, #1e88e5);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    font-family: var(--font-body);
}

.update-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 16px rgba(66, 165, 245, 0.4);
}

.update-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
}

/* ================================================
   TIME ADJUSTMENT CONTROLS (in Location Modal)
   ================================================ */
.time-adjust-row {
    flex-wrap: wrap;
    padding-top: 4px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.time-adjust-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.time-adjust-sign {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--accent-primary);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    cursor: pointer;
    min-width: 42px;
    text-align: center;
}

.time-adjust-sign:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.time-adjust-input {
    width: 46px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.78rem;
    padding: 5px 6px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}

.time-adjust-input::-webkit-outer-spin-button,
.time-adjust-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.time-adjust-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.1);
}

.time-adjust-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ================================================
   FOOTER
   ================================================ */
#app-footer {
    text-align: center;
    padding: 20px 16px 80px;
    color: var(--text-muted);
    font-size: 0.72rem;
    max-width: 720px;
    margin: 0 auto;
}

.footer-note {
    margin-top: 6px;
    font-size: 0.65rem;
    opacity: 0.7;
    line-height: 1.5;
}

/* ================================================
   RTL SUPPORT
   ================================================ */
[dir="rtl"] .event-card:hover {
    transform: translateX(-4px);
}

[dir="rtl"] .events-title::before {
    order: 1;
}

.event-card-category {
    font-size: 0.62rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
    font-weight: 500;
}

.event-share-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px;
    margin: 0 4px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease);
}

.event-share-btn:hover {
    color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.1);
}

[dir="rtl"] .event-card-category {
    margin-left: initial;
    margin-right: auto;
}

[dir="rtl"] .event-card-body {
    padding-left: 0;
    padding-right: 12px;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 480px) {
    .day-cell {
        min-height: 46px;
        border-radius: 6px;
    }

    .day-hijri {
        font-size: 0.88rem;
    }

    .day-greg {
        font-size: 0.52rem;
    }

    .month-title-hijri {
        font-size: 0.95rem;
    }

    .event-dot {
        width: 4px;
        height: 4px;
    }

    .lang-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 481px) and (max-width: 720px) {
    .day-cell {
        min-height: 60px;
    }
}

@media (min-width: 721px) {
    .day-cell {
        min-height: 72px;
        border-radius: 10px;
    }

    .day-hijri {
        font-size: 1.1rem;
    }

    .day-greg {
        font-size: 0.68rem;
    }

    .calendar-grid {
        gap: 5px;
    }

    .calendar-weekdays {
        gap: 5px;
    }
}

/* ================================================
   LOCATION BAR
   ================================================ */
.location-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    max-width: 720px;
    margin: 0 auto;
}

.location-icon {
    font-size: 0.85rem;
}

.location-name {
    flex: 1;
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.location-change-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--accent-primary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    font-family: var(--font-body);
}

.location-change-btn:hover {
    background: rgba(var(--accent-primary-rgb), 0.1);
    border-color: var(--accent-primary);
}

/* ================================================
   PRAYER TIMES SECTION
   ================================================ */
.prayer-section {
    max-width: 720px;
    margin: 20px auto 0;
    padding: 0 16px;
}

.prayer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.prayer-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.location-bar {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    background: var(--surface);
    border-bottom: none;
    position: sticky;
    top: 50px; /* Exactly below header-top */
    z-index: 1080;
    height: 32px; /* ENFORCED */
    font-size: 0.72rem;
}

.location-icon {
    font-size: 0.9rem;
}

.location-name {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.location-change-btn {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.location-change-btn:hover {
    background: rgba(var(--accent-primary-rgb), 0.1);
}

.prayer-countdown {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.08);
    padding: 4px 12px;
    border-radius: 16px;
    border: 1px solid rgba(var(--accent-primary-rgb), 0.2);
}

.countdown-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.countdown-timer {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.prayer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.prayer-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 10px;
    text-align: center;
    transition: all 0.3s var(--ease);
    position: relative;
    overflow: hidden;
}

.prayer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border);
    transition: background 0.3s var(--ease);
}

.prayer-card.next-prayer {
    border-color: rgba(var(--accent-primary-rgb), 0.4);
    background: rgba(var(--accent-primary-rgb), 0.06);
    box-shadow: 0 0 20px rgba(var(--accent-primary-rgb), 0.08);
}

.prayer-card.next-prayer::before {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-gold));
}

.prayer-card-icon {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.prayer-card-name {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.prayer-card-time {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.prayer-card.next-prayer .prayer-card-time {
    color: var(--accent-primary);
}

.prayer-method-note {
    margin-top: 8px;
    font-size: 0.62rem;
    color: var(--text-muted);
    text-align: center;
    opacity: 0.7;
}

/* Prayer Time Progress Bar */
.prayer-progress-bar {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.prayer-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-gold));
    border-radius: 1px;
    transition: width 1s linear;
    position: relative;
}

.prayer-progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: -1.5px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-gold);
    box-shadow: 0 0 10px rgba(245, 200, 66, 0.82);
}

/* ================================================
   DATE PRAYER MODAL
   ================================================ */
.date-prayer-modal-card {
    text-align: center;
    padding: 24px 20px;
}

.date-prayer-modal-card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.date-prayer-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.date-prayer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.date-prayer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.date-prayer-item-icon {
    font-size: 1.1rem;
}

.date-prayer-item-info {
    text-align: left;
    flex: 1;
}

.date-prayer-item-name {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.date-prayer-item-time {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* ================================================
   LOCATION MODAL
   ================================================ */
.location-modal-card {
    max-height: 85vh;
    overflow-y: auto;
    padding-top: 20px;
}

.location-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.location-gps-row {
    margin-bottom: 12px;
}

.gps-btn {
    width: 100%;
    background: linear-gradient(135deg, rgba(var(--accent-primary-rgb), 0.15), rgba(var(--accent-primary-rgb), 0.05));
    border: 1px solid rgba(var(--accent-primary-rgb), 0.3);
    color: var(--accent-primary);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.gps-btn:hover {
    background: linear-gradient(135deg, rgba(var(--accent-primary-rgb), 0.25), rgba(var(--accent-primary-rgb), 0.1));
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-primary), #00a87d);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 200, 150, 0.2);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 200, 150, 0.3);
    filter: brightness(1.1);
}

.primary-btn:active {
    transform: translateY(0);
}

.gps-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.location-search-row {
    margin-bottom: 12px;
}

.location-search {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.88rem;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    transition: border-color 0.2s var(--ease);
    box-sizing: border-box;
}

.location-search:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.1);
}

.location-search::placeholder {
    color: var(--text-muted);
}

.location-method-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.method-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.method-select {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.75rem;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    cursor: pointer;
    min-width: 0;
}

.method-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.city-list {
    margin-top: 8px;
}

.city-region-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 10px 0 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.city-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

.city-item:hover {
    background: var(--surface-hover);
}

.city-item.active {
    background: rgba(var(--accent-primary-rgb), 0.1);
    border-left: 3px solid var(--accent-primary);
}

.city-item-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.city-item-country {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* ================================================
   RESPONSIVE — Prayer Grid
   ================================================ */
@media (max-width: 480px) {
    .prayer-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .prayer-card {
        padding: 8px 4px;
    }

    .prayer-card-icon {
        font-size: 1rem;
    }

    .prayer-card-time {
        font-size: 0.72rem;
    }

    .prayer-card-name {
        font-size: 0.55rem;
    }

    .date-prayer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 340px) {
    .prayer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ================================================
   SCROLLBAR
   ================================================ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-hover);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ================================================
   SELECTION
   ================================================ */
::selection {
    background: rgba(var(--accent-primary-rgb), 0.3);
    color: var(--text-primary);
}

/* ================================================
   SPLASH SCREEN
   ================================================ */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-body);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out, visibility 0.5s;
}

#splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-content {
    text-align: center;
    color: var(--text-primary);
    animation: fadeIn 0.8s ease-out;
}

.splash-logo {
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.4));
}

.splash-logo svg {
    width: 96px;
    height: 96px;
}

.splash-title {
    font-family: 'Amiri', serif;
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.splash-subtitle {
    font-size: 1.1rem;
    opacity: 0.8;
    margin-bottom: 3rem;
    font-weight: 300;
}

.splash-loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

.splash-author {
    margin-top: 2rem;
    font-size: 0.9rem;
    opacity: 0.5;
    font-weight: 500;
    letter-spacing: 0.5px;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer Author Credit */
.author-credit {
    margin: 12px 0;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.author-name {
    color: var(--gold);
    font-weight: 600;
}

/* Mobile adjustments for splash */
@media (max-width: 480px) {
    .splash-title {
        font-size: 2rem;
    }
}

/* 
   ENHANCED SPLASH SCREEN 
   Surrounds the simple splash with a deep, premium atmosphere
*/
#splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: radial-gradient(circle at center, #1e3a8a 0%, #0f172a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: opacity 0.6s ease-out, visibility 0.6s;
    overflow: hidden;
}

#splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Pattern - animated Islamic geometric tessellation */
#splash-screen::before {
    content: "";
    position: absolute;
    inset: -20%;
    background-image:
        linear-gradient(0deg, rgba(255, 215, 0, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 215, 0, 0.04) 1px, transparent 1px),
        linear-gradient(45deg, rgba(255, 215, 0, 0.03) 1px, transparent 1px),
        linear-gradient(-45deg, rgba(255, 215, 0, 0.03) 1px, transparent 1px);
    background-size: 60px 60px, 60px 60px, 42px 42px, 42px 42px;
    animation: geoRotate 60s linear infinite;
    z-index: 0;
}

@keyframes geoRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Vignette */
#splash-screen::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 0;
    pointer-events: none;
}

/* Geometric star decoration */
.splash-geo-star {
    position: absolute;
    z-index: 1;
    width: 200px;
    height: 200px;
    opacity: 0.06;
    animation: starSpin 40s linear infinite;
}

.splash-geo-star::before,
.splash-geo-star::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid rgba(255, 215, 0, 0.5);
}

.splash-geo-star::before {
    transform: rotate(45deg);
}

.splash-geo-star--tl {
    top: 5%;
    left: 5%;
}

.splash-geo-star--br {
    bottom: 5%;
    right: 5%;
    animation-direction: reverse;
}

@keyframes starSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.splash-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.splash-logo {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: floatLogo 3s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.4));
}

.splash-title {
    font-family: 'Amiri', serif;
    font-size: 2.8rem;
    margin: 0;
    background: linear-gradient(to bottom, #fff 20%, #fbbf24 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
}

.splash-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.splash-loader {
    margin-top: 2.5rem;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.2);
}

.splash-author {
    position: absolute;
    bottom: 2rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    font-family: 'Inter', sans-serif;
}

@keyframes floatLogo {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile override for splash title */
@media (max-width: 480px) {
    .splash-title {
        font-size: 2.2rem;
    }
}

/* ========== FULL SCREEN VIEW (Qibla) ========== */
.full-screen-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-main);
    z-index: 2000;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    animation: slideInBottom 0.3s ease-out;
}

.full-screen-view.active {
    display: flex;
}

@keyframes slideInBottom {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.view-header {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.view-back-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.view-back-btn:hover {
    background: var(--highlight-bg);
}

.view-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
}

.qibla-accuracy-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    display: inline-block;
    margin-top: 2px;
}

.qibla-accuracy-badge.high {
    background: rgba(var(--accent-primary-rgb), 0.15);
    color: var(--accent-primary);
}

.qibla-accuracy-badge.low {
    background: rgba(var(--accent-gold-rgb), 0.15);
    color: var(--accent-gold);
}

.view-content {
    flex: 1;
    padding: 2rem 1.5rem;
}

/* Compass Styling */
.qibla-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--bg-primary);
    background-image:
        radial-gradient(circle at center, transparent 0%, var(--bg-primary) 70%),
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23f5c842' stroke-width='0.5' stroke-opacity='0.1'%3E%3Cpath d='M50 0 L100 50 L50 100 L0 50 Z' /%3E%3Cpath d='M50 10 L90 50 L50 90 L10 50 Z' /%3E%3Ccircle cx='50' cy='50' r='40' /%3E%3C/g%3E%3C/svg%3E");
    background-size: cover;
    background-attachment: fixed;
}

.qibla-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 22, 40, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

.overlay-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    max-width: 320px;
    width: 100%;
}

.overlay-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.overlay-card h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.overlay-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 2rem;
}

.error-text {
    margin-top: 1rem;
    color: #ef4444;
    font-size: 0.8rem;
}

.compass-container {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 2rem auto;
    background: rgba(15, 31, 58, 0.75);
    backdrop-filter: blur(12px);
    border-radius: 50%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.alignment-glow {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 200, 150, 0.4) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 0;
}

.compass-ring {
    position: absolute;
    inset: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.direction {
    position: absolute;
    font-weight: 700;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
}

.direction.n {
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    color: #ef4444;
}

.direction.e {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.direction.s {
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
}

.direction.w {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

/* Fixed Qibla marker — positioned by JS at bearing angle */
.qibla-marker {
    position: absolute;
    font-size: 1.8rem;
    filter: drop-shadow(0 0 10px gold) drop-shadow(0 0 4px rgba(255, 215, 0, 0.6));
    z-index: 10;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Compass needle — rotates with device heading */
.compass-needle {
    position: absolute;
    width: 6px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.08s linear;
    will-change: transform;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.needle-north {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 90px solid #ef4444;
    filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.5));
}

.needle-south {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 90px solid #64748b;
}

/* Center dot overlay */
.needle-center-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff, #94a3b8);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
    z-index: 8;
}

.qibla-info {
    margin-top: 2rem;
}

.qibla-bearing {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.qibla-status {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-top: 1rem;
    min-height: 1.5em;
}

.qibla-guide-arrow {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    animation: bounceLR 1s infinite alternate;
}

@keyframes bounceLR {
    from {
        transform: translateX(-5px);
    }

    to {
        transform: translateX(5px);
    }
}

.qibla-calibration-controls {
    margin: 1.5rem 0;
    width: 100%;
    max-width: 240px;
}

.calibrate-btn {
    width: 100%;
    padding: 0.8rem 1.5rem;
    background: rgba(var(--accent-gold-rgb), 0.1);
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.calibrate-btn:hover {
    background: rgba(var(--accent-gold-rgb), 0.2);
    transform: translateY(-2px);
}

.calibrate-btn:active {
    transform: translateY(0);
}

.calibrate-btn .icon {
    font-size: 1.1rem;
}

.calibration-progress {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--accent-gold);
    font-size: 0.8rem;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: var(--accent-gold);
    border-radius: 2px;
    animation: progressLoop 2s infinite ease-in-out;
}

@keyframes progressLoop {
    0% {
        left: -30%;
    }

    100% {
        left: 100%;
    }
}

.qibla-instructions {
    margin-top: 2rem;
    padding: 1.25rem;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 400px;
}

.qibla-instructions p {
    margin-bottom: 0.5rem;
}

/* Zakat Modal Styling */
.zakat-modal-card {
    max-width: 450px;
}

.zakat-form {
    padding: 1rem 0;
}

.zakat-input-group {
    margin-bottom: 1.25rem;
}

.zakat-input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.zakat-input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.zakat-input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.zakat-result-area {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--highlight-bg);
    border-radius: 12px;
    text-align: center;
    border-left: 4px solid var(--primary);
}

.result-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.result-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* Animation for aligned compass */
.compass-container.aligned {
    border-color: var(--accent-primary);
    box-shadow: 0 0 40px rgba(var(--accent-primary-rgb), 0.4), inset 0 0 20px rgba(var(--accent-primary-rgb), 0.1);
}

.compass-container.aligned .alignment-glow {
    opacity: 1;
    animation: glowPulse 1s infinite ease-in-out, successWave 2s infinite;
}

@keyframes successWave {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--accent-primary-rgb), 0.4);
    }

    100% {
        box-shadow: 0 0 0 40px rgba(var(--accent-primary-rgb), 0);
    }
}

@keyframes glowPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.4;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
}

@keyframes pulse-primary {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.compass-container.aligned .qibla-marker {
    animation: pulse-primary 1s infinite ease-in-out;
}

/* Notification Button */
.notif-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    margin-left: 0.5rem;
}

.notif-btn:hover {
    background: var(--highlight-bg);
    color: var(--text-main);
}

.notif-btn.enabled {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

.notif-btn.enabled:hover {
    background: rgba(251, 191, 36, 0.2);
}

/* ================================================
   TASBIH COUNTER
   ================================================ */
.tasbih-view {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: var(--bg-primary);
    flex-direction: column;
    align-items: center;
}

.tasbih-view.active {
    display: flex;
}

.tasbih-header {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.tasbih-header h2 {
    flex: 1;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.tasbih-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    padding: 20px;
}

.tasbih-count {
    font-size: 5rem;
    font-weight: 700;
    color: var(--accent-gold);
    text-shadow: 0 0 30px rgba(245, 200, 66, 0.2);
    font-variant-numeric: tabular-nums;
    transition: transform 0.08s ease;
}

.tasbih-count.pulse {
    transform: scale(1.08);
}

.tasbih-target-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tasbih-progress {
    width: 80%;
    max-width: 280px;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.tasbih-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-gold));
    border-radius: 2px;
    transition: width 0.15s ease;
}

.tasbih-tap-btn {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 3px solid rgba(0, 200, 150, 0.3);
    background: radial-gradient(circle at center, rgba(0, 200, 150, 0.12), rgba(0, 200, 150, 0.03));
    color: var(--accent-primary);
    font-size: 3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.tasbih-tap-btn:active {
    transform: scale(0.95);
    border-color: var(--accent-primary);
    box-shadow: 0 0 30px rgba(0, 200, 150, 0.2);
}

.tasbih-controls {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.tasbih-controls select,
.tasbih-controls button {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.82rem;
    cursor: pointer;
    font-family: var(--font-body);
}

.tasbih-controls button:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

/* ================================================
   RAMADAN MODE
   ================================================ */
.ramadan-banner {
    max-width: 720px;
    margin: 0 auto 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(171, 71, 188, 0.1), rgba(245, 200, 66, 0.08));
    border: 1px solid rgba(171, 71, 188, 0.15);
    border-radius: var(--radius-md);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ramadan-banner.active {
    display: flex;
}

.ramadan-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #AB47BC;
    font-weight: 600;
}

.ramadan-times {
    display: flex;
    gap: 24px;
    align-items: center;
}

.ramadan-time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.ramadan-time-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.ramadan-time-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-gold);
    font-variant-numeric: tabular-nums;
}

.ramadan-divider {
    width: 1px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
}

.ramadan-countdown {
    font-size: 0.78rem;
    color: var(--accent-primary);
    font-weight: 500;
    margin-top: 2px;
}

/* ================================================
   HIJRI DATE ADJUSTMENT STEPPER
   ================================================ */
.hijri-adj-stepper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    justify-content: center;
}

.adj-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease);
}

.adj-btn:hover {
    background: rgba(var(--accent-primary-rgb), 0.15);
    border-color: var(--accent-primary);
}

.adj-label,
.adj-value {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    min-width: 36px;
    text-align: center;
}

/* ================================================
   DAILY DUA / HADITH CARD
   ================================================ */
.dua-section {
    max-width: 720px;
    margin: 16px auto;
    padding: 0 16px;
}

.dua-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.dua-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-gold), var(--accent-primary));
}

.dua-type {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.dua-arabic {
    font-family: 'Amiri', serif;
    font-size: 1.4rem;
    color: var(--accent-gold);
    text-align: center;
    direction: rtl;
    line-height: 2;
    margin-bottom: 12px;
    text-shadow: 0 0 20px rgba(245, 200, 66, 0.1);
}

.dua-pronunciation {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    font-style: italic;
    margin-bottom: 16px;
    padding: 0 10px;
    line-height: 1.4;
}

.dua-english {
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 8px;
    font-style: italic;
}

.dua-ref {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-align: right;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(var(--accent-primary-rgb), 0.3);
    background: rgba(var(--accent-primary-rgb), 0.08);
    color: var(--accent-primary);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    margin-top: 10px;
}

.share-btn:hover {
    background: rgba(var(--accent-primary-rgb), 0.15);
    border-color: var(--accent-primary);
}

/* ================================================
   ISLAMIC TUTORIALS & DUAS HUB
   ================================================ */
.islamic-hub-view {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: var(--bg-primary);
    flex-direction: column;
}

.islamic-hub-view.active {
    display: flex;
}

.islamic-hub-header {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.islamic-hub-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Hub Tabs */
.hub-tabs {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
}

.hub-tabs::-webkit-scrollbar {
    display: none;
}

.hub-tab {
    flex-shrink: 0;
    padding: 12px 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    white-space: nowrap;
    text-align: center;
}

.hub-tab:hover {
    color: var(--text-secondary);
}

.hub-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

/* Tab Content */
.hub-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.hub-tab-content.active {
    display: block;
}

/* Duas & Hadiths List */
.duas-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dua-list-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s var(--ease);
}

.dua-list-card:hover {
    border-color: rgba(var(--accent-gold-rgb), 0.3);
    transform: translateY(-1px);
}

.dua-list-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-gold));
}

.dua-list-type {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
}

.dua-list-type.dua {
    color: var(--accent-gold);
    background: rgba(var(--accent-gold-rgb), 0.1);
}

.dua-list-type.hadith {
    color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.1);
}

.dua-list-arabic {
    font-family: 'Amiri', serif;
    font-size: 1.2rem;
    color: var(--accent-gold);
    text-align: center;
    direction: rtl;
    line-height: 2;
    margin-bottom: 4px;
}

.dua-list-pronunciation,
.tutorial-pronunciation,
.name-card-pronunciation {
    font-size: 0.75rem;
    color: var(--accent-primary);
    opacity: 0.9;
    margin: 4px 0 8px;
    font-style: italic;
    background: rgba(var(--accent-primary-rgb), 0.05);
    padding: 3px 10px;
    border-radius: 6px;
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.dua-list-translation {
    font-size: 0.82rem;
    color: var(--text-primary);
    line-height: 1.5;
    font-style: italic;
    margin-bottom: 6px;
}

.dua-list-ref {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: right;
}

/* Tutorials List */
.tutorials-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tutorial-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.2s var(--ease);
}

.tutorial-card:hover {
    border-color: rgba(var(--accent-primary-rgb), 0.3);
}

.tutorial-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.2s var(--ease);
}

.tutorial-card-header:hover {
    background: var(--surface-hover);
}

.tutorial-card-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.tutorial-card-title {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tutorial-card-chevron {
    color: var(--text-muted);
    transition: transform 0.25s var(--ease);
    flex-shrink: 0;
}

.tutorial-card.open .tutorial-card-chevron {
    transform: rotate(180deg);
}

.tutorial-card-body {
    display: none;
    padding: 0 16px 16px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.tutorial-card.open .tutorial-card-body {
    display: block;
}

.tutorial-card-body h4 {
    color: var(--accent-primary);
    font-size: 0.85rem;
    margin: 12px 0 6px;
}

.tutorial-card-body h4:first-child {
    margin-top: 0;
}

.tutorial-card-body ol,
.tutorial-card-body ul {
    padding-left: 20px;
    margin: 4px 0;
}

.tutorial-card-body li {
    margin-bottom: 4px;
}

.tutorial-card-body .tutorial-arabic {
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
    color: var(--accent-gold);
    direction: rtl;
    text-align: center;
    margin: 8px 0;
    line-height: 1.8;
}

/* ================================================
   99 NAMES OF ALLAH
   ================================================ */
.names-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0;
}

.name-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 8px;
    text-align: center;
    transition: all 0.2s var(--ease);
}

.name-card:hover {
    border-color: rgba(var(--accent-gold-rgb), 0.4);
    transform: translateY(-1px);
}

.name-card-num {
    font-size: 0.58rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.name-card-ar {
    font-family: var(--font-arabic);
    font-size: 1.2rem;
    color: var(--accent-gold);
    margin-bottom: 2px;
    line-height: 1.4;
}

.name-card-en {
    font-size: 0.68rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.name-card-meaning {
    font-size: 0.82rem;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.2;
}

/* ================================================
   SETTINGS MODAL
   ================================================ */
.settings-modal-card {
    max-width: 400px;
    padding: 28px 24px;
}

.settings-modal-card h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.settings-group {
    margin-bottom: 20px;
}

.settings-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.settings-note {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.settings-adj-row {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.theme-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.theme-swatch {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    position: relative;
}

.theme-swatch:hover {
    transform: scale(1.1);
}

.theme-swatch.active {
    border-color: var(--accent-gold);
    box-shadow: 0 0 12px rgba(245, 200, 66, 0.3);
}

.theme-swatch.active::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
}

/* ================================================
   THEME DEFINITIONS
   ================================================ */

/* Emerald */
[data-theme="emerald"] {
    --bg-primary: #0a1f1a;
    --bg-secondary: #0d2e24;
    --bg-main: var(--bg-primary);
    --bg-sidebar: var(--bg-secondary);
    --surface: rgba(13, 59, 46, 0.45);
    --surface-hover: rgba(13, 59, 46, 0.7);
    --bg-card: rgba(13, 59, 46, 0.4);
    --border: rgba(16, 185, 129, 0.35);
    --accent-primary: #34d399;
    --accent-primary-rgb: 52, 211, 153;
    --accent-gold: #fbbf24;
    --accent-gold-rgb: 251, 191, 36;
    --text-secondary: #e8f5ee; /* Bright mint-white */
    --text-muted: #c8e6d6;     /* Visible light sage */
}

/* Royal Purple */
[data-theme="royal"] {
    --bg-primary: #1a0a2e;
    --bg-secondary: #231048;
    --bg-main: var(--bg-primary);
    --bg-sidebar: var(--bg-secondary);
    --surface: rgba(45, 27, 105, 0.45);
    --surface-hover: rgba(45, 27, 105, 0.7);
    --bg-card: rgba(45, 27, 105, 0.4);
    --border: rgba(167, 139, 250, 0.35);
    --accent-primary: #a78bfa;
    --accent-primary-rgb: 167, 139, 250;
    --accent-gold: #fbbf24;
    --accent-gold-rgb: 251, 191, 36;
    --text-secondary: #ede5ff; /* Bright lavender-white */
    --text-muted: #cdc0f0;     /* Visible soft lavender */
}

/* Desert Sand */
[data-theme="desert"] {
    --bg-primary: #1a1008;
    --bg-secondary: #2a1a0a;
    --bg-main: var(--bg-primary);
    --bg-sidebar: var(--bg-secondary);
    --surface: rgba(92, 58, 30, 0.45);
    --surface-hover: rgba(92, 58, 30, 0.7);
    --bg-card: rgba(92, 58, 30, 0.35);
    --border: rgba(217, 160, 90, 0.4);
    --accent-primary: #d9a05a;
    --accent-primary-rgb: 217, 160, 90;
    --accent-gold: #fbbf24;
    --accent-gold-rgb: 251, 191, 36;
    --text-secondary: #f5edd8; /* Bright warm-white */
    --text-muted: #dfd0b0;     /* Visible sand-cream */
}

/* Ocean */
[data-theme="ocean"] {
    --bg-primary: #0a1a2e;
    --bg-secondary: #0c2a40;
    --bg-main: var(--bg-primary);
    --bg-sidebar: var(--bg-secondary);
    --surface: rgba(12, 53, 71, 0.45);
    --surface-hover: rgba(12, 53, 71, 0.7);
    --bg-card: rgba(12, 53, 71, 0.4);
    --border: rgba(56, 189, 248, 0.35);
    --accent-primary: #38bdf8;
    --accent-primary-rgb: 56, 189, 248;
    --accent-gold: #fbbf24;
    --accent-gold-rgb: 251, 191, 36;
    --text-secondary: #e4f0fa; /* Bright sky-white */
    --text-muted: #c0ddf0;     /* Visible ocean-light */
}

/* Mobile: 99 names 2 columns */
@media (max-width: 480px) {
    .names-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .header-brand h1 {
        font-size: 1rem;
    }

    .brand-icon {
        font-size: 1.4rem;
    }

    .today-banner {
        padding: 4px 12px;
        top: 82px;
    }

    .today-hijri {
        font-size: 1.15rem;
    }

    .today-greg,
    .today-event {
        font-size: 0.7rem;
    }

    .hero-countdown {
        padding: 6px 12px;
        gap: 8px;
    }

    .hero-countdown svg {
        width: 30px;
        height: 30px;
    }

    .hero-countdown-time {
        font-size: 0.8rem;
    }

    .day-cell {
        min-height: 52px;
    }

    .day-hijri {
        font-size: 0.9rem;
    }

    .day-greg {
        font-size: 0.52rem;
    }
}

/* Salah Tutorials Table Styles */
.salah-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 0.85rem;
    font-family: var(--font-body);
    min-width: 100%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.salah-table thead tr {
    background: linear-gradient(135deg, var(--surface-hover), var(--surface));
    text-align: left;
    border-bottom: 2px solid var(--accent-primary);
}

.salah-table th {
    font-weight: 600;
    padding: 12px 15px;
    color: var(--text-primary);
}

.salah-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.salah-table tbody tr {
    transition: background 0.2s var(--ease);
}

.salah-table tbody tr:nth-of-type(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

.salah-table tbody tr:hover {
    background-color: rgba(var(--accent-primary-rgb), 0.05);
}

.salah-table tbody tr:last-of-type {
    border-bottom: none;
}