/**
 * HatimConnect PWA - Custom Pico.css Override
 * Based on design system from stitch_hatim_dashboard
 * 
 * Color Palette:
 * - Primary: #19e66b (Emerald Green)
 * - Background Dark: #112117
 * - Background Light: #f6f8f7
 * - Surface Dark: #1c2620
 * - Text Muted: #9db8a8
 */

@import url('/css/pages/reader.css');
@import url('/css/pages/session-details.css');
@import url('/css/pages/landing.css');
@import url('/css/pages/profile.css');
@import url('/css/pages/settings.css');
@import url('/css/pages/notifications.css');
@import url('/css/pages/admin.css');

/* ========================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ======================================== */

:root {
    color-scheme: light;
    /* Primary Colors */
    --primary: #19e66b;
    --primary-hover: #15cc5f;
    --primary-focus: rgba(25, 230, 107, 0.25);
    --primary-inverse: #112117;
    
    /* Background Colors - Light Mode */
    --background-color: #f4f5f1;
    --card-background-color: #fbfbf8;
    --card-border-color: #e4e7e2;
    
    /* Text Colors - Light Mode */
    --color: #0b2a1d;
    --color-muted: #3e5a4a;
    --h1-color: #0b2a1d;
    --h2-color: #0b2a1d;
    --h3-color: #0f2f22;
    
    /* Typography */
    --font-family: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-family-arabic: 'Amiri', 'Traditional Arabic', serif;
    --font-weight: 400;
    --line-height: 1.5;
    
    /* Spacing */
    --spacing: 1rem;
    --block-spacing-vertical: 1rem;
    --block-spacing-horizontal: 1rem;
    
    /* Border Radius */
    --border-radius: 0.75rem;
    --border-radius-sm: 0.5rem;
    --border-radius-lg: 1rem;
    --border-radius-xl: 1.5rem;
    --border-radius-full: 9999px;
    
    /* Transitions */
    --transition: 0.2s ease-in-out;
    
    /* Form Elements */
    --form-element-background-color: #ffffff;
    --form-element-border-color: #d7ddd7;
    --form-element-focus-color: var(--primary);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-primary: 0 10px 25px -5px rgba(25, 230, 107, 0.3);
    
    /* Safe Areas (iOS) */
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
}

/* ========================================
   DARK MODE
   ======================================== */

[data-theme="dark"],
.dark {
    color-scheme: dark;
    --background-color: #112117;
    --card-background-color: #1c2620;
    --card-border-color: rgba(255, 255, 255, 0.05);
    
    --color: #f3f4f6;
    --color-muted: #9db8a8;
    --h1-color: #ffffff;
    --h2-color: #ffffff;
    --h3-color: #f3f4f6;
    
    --form-element-background-color: rgba(255, 255, 255, 0.05);
    --form-element-border-color: rgba(255, 255, 255, 0.1);
}

/* ========================================
   BASE STYLES
   ======================================== */

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

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    font-weight: var(--font-weight);
    line-height: var(--line-height);
    background-color: var(--background-color);
    color: var(--color);
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#page-content,
.app-container {
    background: var(--background-color);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--spacing);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

h1 { font-size: 1.875rem; color: var(--h1-color); }
h2 { font-size: 1.5rem; color: var(--h2-color); }
h3 { font-size: 1.25rem; color: var(--h3-color); }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    margin: 0 0 var(--spacing);
}

small {
    font-size: 0.75rem;
    color: var(--color-muted);
}

.text-muted { color: var(--color-muted); }
.text-primary { color: var(--primary); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.05em; }
.tracking-wider { letter-spacing: 0.1em; }

/* Arabic Text */
.arabic-text {
    font-family: var(--font-family-arabic);
    direction: rtl;
    text-align: right;
    line-height: 2.2;
    font-size: 1.75rem;
}

/* ========================================
   LAYOUT UTILITIES
   ======================================== */

.container {
    max-width: 28rem; /* 448px - mobile-first */
    margin: 0 auto;
    padding: 0 var(--spacing);
}

/* App Content Container - Standard max-width for all pages */
.app-content-container {
    max-width: 48rem; /* 768px */
    margin: 0 auto;
    padding: 0 1rem;
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 48rem;
    margin: 0 auto;
}

/* Auth pages (login/register) */
[data-page="login"] #page-content,
[data-page="register"] #page-content {
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.auth-card {
    width: 100%;
    max-width: 26rem;
    padding: 2rem 1.5rem;
    background: var(--card-background-color);
    border: 1px solid var(--card-border-color);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-lg);
    margin: auto;
}

[data-page="login"] #page-content,
[data-page="register"] #page-content {
    height: 100vh;
}

.auth-credits {
    margin-top: 1.5rem;
    font-size: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    justify-content: center;
}

.auth-credits a {
    color: inherit;
    text-decoration: none;
}

.auth-credits a:hover {
    color: var(--primary);
}

.auth-dot {
    opacity: 0.5;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.flex-none { flex: none; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.hidden { display: none; }
.block { display: block; }
.inline-flex { display: inline-flex; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { inset: 0; }
.top-0 { top: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }

.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100dvh; }

.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Spacing */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }

.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

.pt-4 { padding-top: 1rem; }
.pt-6 { padding-top: 1.5rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-4 { padding-bottom: 1rem; }
.pb-6 { padding-bottom: 1.5rem; }
.pb-24 { padding-bottom: 6rem; }
.pb-safe { padding-bottom: var(--safe-area-inset-bottom); }

.m-0 { margin: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ml-4 { margin-left: 1rem; }

.-mt-4 { margin-top: -1rem; }
.-mt-8 { margin-top: -2rem; }

/* ========================================
   COMPONENTS
   ======================================== */

/* Cards */
.card {
    background: var(--card-background-color);
    border: 1px solid var(--card-border-color);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing);
    box-shadow: var(--shadow-sm);
}

.card-elevated {
    box-shadow: var(--shadow-md);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-inverse);
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: rgba(25, 230, 107, 0.1);
    color: var(--primary);
    border: 1px solid rgba(25, 230, 107, 0.2);
}

.btn-secondary:hover {
    background: rgba(25, 230, 107, 0.15);
}

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

.btn-ghost {
    background: transparent;
    color: var(--color);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .btn-ghost:hover {
    background: rgba(0, 0, 0, 0.05);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-pill {
    border-radius: var(--border-radius-full);
}

.btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color);
}

[data-theme="dark"] .btn-icon,
.dark .btn-icon {
    color: #ffffff;
}

[data-theme="light"] .btn-icon {
    color: #1f2937;
}

.btn-icon .material-symbols-outlined {
    font-size: 1.5rem;
}

.btn-icon-lg {
    width: 3.5rem;
    height: 3.5rem;
}

.btn-icon-lg .material-symbols-outlined {
    font-size: 1.75rem;
}

/* Icon Button (FAB) */
.fab {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--border-radius-full);
    background: var(--primary);
    color: var(--primary-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg), var(--shadow-primary);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 0.75rem;
}

.fab:active {
    transform: scale(0.95);
}

/* Form Elements */
input, textarea, select {
    width: 100%;
    padding: 1rem;
    font-family: inherit;
    font-size: 1rem;
    background: var(--form-element-background-color);
    border: 2px solid var(--form-element-border-color);
    border-radius: var(--border-radius);
    color: var(--color);
    transition: border-color var(--transition);
}

input::placeholder, textarea::placeholder {
    color: var(--color-muted);
    opacity: 0.6;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-focus);
}

label {
    display: block;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-muted);
    margin-bottom: 0.5rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--border-radius-full);
}

.badge-primary {
    background: var(--primary);
    color: var(--primary-inverse);
}

.badge-secondary {
    background: rgba(25, 230, 107, 0.15);
    color: var(--primary);
}

.badge-muted {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-muted);
}

/* Progress Bar */
.progress {
    width: 100%;
    height: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-full);
    overflow: hidden;
}

[data-theme="light"] .progress {
    background: #e5e7eb;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: var(--border-radius-full);
    transition: width 0.5s ease-out;
    box-shadow: 0 0 8px rgba(25, 230, 107, 0.5);
}

/* Avatar */
.avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--border-radius-full);
    object-fit: cover;
    border: 2px solid var(--primary);
}

.avatar-sm { width: 2rem; height: 2rem; }
.avatar-lg { width: 4rem; height: 4rem; }
.avatar-xl { width: 6rem; height: 6rem; }

/* ========================================
   LAYOUT COMPONENTS
   ======================================== */

/* Top App Bar */
.app-bar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    z-index: 50;
    border-bottom: 1px solid var(--card-border-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

[data-theme="dark"] .app-bar,
.dark .app-bar {
    background: rgba(17, 33, 23, 0.95);
    color: #ffffff;
}

[data-theme="light"] .app-bar {
    background: rgba(244, 245, 241, 0.95);
    color: #0b2a1d;
}

.app-bar-inner {
    max-width: 48rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
}

.app-bar-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
    color: var(--color);
}

.app-logo {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-logo-icon {
    width: 2rem;
    height: 2rem;
    display: block;
    border-radius: 50%;
}

[data-theme="dark"] .app-bar-title,
.dark .app-bar-title {
    color: #ffffff;
}

[data-theme="light"] .app-bar-title {
    color: #0b2a1d;
}

[data-theme="dark"] .app-bar .material-symbols-outlined,
.dark .app-bar .material-symbols-outlined {
    color: #ffffff;
}

[data-theme="light"] .app-bar .material-symbols-outlined {
    color: #0b2a1d;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    border-top: 1px solid var(--card-border-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding-bottom: var(--safe-area-inset-bottom);
}

[data-theme="dark"] .bottom-nav,
.dark .bottom-nav {
    background: rgba(17, 33, 23, 0.95);
}

[data-theme="light"] .bottom-nav {
    background: rgba(251, 251, 248, 0.95);
}

.bottom-nav-inner {
    max-width: 48rem;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    align-items: center;
    /* padding: 0.5rem 1rem; */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.25rem;
    color: var(--color-muted);
    text-decoration: none;
    transition: color var(--transition);
    -webkit-tap-highlight-color: transparent;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.nav-item.active,
.nav-item:hover {
    color: var(--primary);
}

.nav-item .material-symbols-outlined {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

[data-theme="dark"] .bottom-nav .nav-item,
.dark .bottom-nav .nav-item {
    color: #ffffff;
}

[data-theme="light"] .bottom-nav .nav-item {
    color: #0b2a1d;
}

[data-theme="dark"] .bottom-nav .nav-item.active,
[data-theme="dark"] .bottom-nav .nav-item:hover,
.dark .bottom-nav .nav-item.active,
.dark .bottom-nav .nav-item:hover {
    color: var(--primary);
}

[data-theme="light"] .bottom-nav .nav-item.active,
[data-theme="light"] .bottom-nav .nav-item:hover {
    color: var(--primary);
}

.bottom-nav .nav-item .material-symbols-outlined {
    color: inherit;
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.nav-item span:last-child:not(.material-symbols-outlined) {
    font-size: 0.625rem;
    font-weight: 500;
}

.nav-item-center {
    position: relative;
    margin-top: -1rem;
}

.nav-item-center .material-symbols-outlined {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--primary-inverse);
    border-radius: 50%;
    font-size: 1.5rem;
}

.nav-item-center .nav-logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item-center .nav-logo-icon img {
    width: 2.5rem;
    height: 2.5rem;
    display: block;
    border-radius: 50%;
}

/* iOS Home Indicator */
.home-indicator {
    width: 8rem;
    height: 0.375rem;
    background: var(--color-muted);
    opacity: 0.3;
    border-radius: var(--border-radius-full);
    margin: 0.5rem auto;
}

/* ========================================
   PAGE SECTIONS
   ======================================== */

/* Hero/Profile Header */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}

.profile-info h2 {
    margin: 0;
    font-size: 1.25rem;
}

.profile-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-muted);
}

/* Stats Row */
.stats-row {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.stats-row::-webkit-scrollbar {
    display: none;
}

.stat-card {
    flex: none;
    min-width: 7.5rem;
    padding: 0.75rem;
    background: var(--card-background-color);
    border: 1px solid var(--card-border-color);
    border-radius: var(--border-radius);
}

.stat-card .label {
    font-size: 0.75rem;
    color: var(--color-muted);
    margin: 0;
}

.stat-card .value {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1rem 0.5rem;
}

.section-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.section-header a,
.section-header button {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
}

/* Hatim Card */
.hatim-card {
    background: var(--card-background-color);
    border: 1px solid var(--card-border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.hatim-card-image {
    position: relative;
    height: 8rem;
    background-size: cover;
    background-position: center;
}

.hatim-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}

.hatim-card-image .badge {
    position: absolute;
    bottom: 0.75rem;
    left: 1rem;
    z-index: 1;
}

.hatim-card-body {
    padding: 1rem;
    background: var(--card-background-color);
}

.hatim-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.hatim-card-subtitle {
    font-size: 0.875rem;
    color: var(--color-muted);
    margin: 0 0 1rem;
}

/* List Item */
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--card-background-color);
    border: 1px solid var(--card-border-color);
    border-radius: var(--border-radius);
}

.list-item-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.list-item-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--border-radius-full);
    background: rgba(25, 230, 107, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-item-text h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
}

.list-item-text p {
    font-size: 0.75rem;
    color: var(--color-muted);
    margin: 0;
}

/* Juz Grid */
.juz-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 1rem;
}

.juz-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--card-background-color);
    border: 1px solid var(--card-border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition);
}

.juz-card:hover {
    border-color: var(--primary);
}

.juz-card.available {
    background: var(--primary);
    color: var(--primary-inverse);
    border-color: var(--primary);
}

.juz-card.completed {
    border-color: var(--primary);
    position: relative;
}

.juz-card.completed::after {
    content: '✓';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.25rem;
    height: 1.25rem;
    background: var(--primary);
    color: var(--primary-inverse);
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
}

.juz-card.taken {
    opacity: 0.5;
}

.juz-number {
    font-size: 1.5rem;
    font-weight: 700;
}

.juz-label {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.7;
}

/* ========================================
   QURAN READER
   ======================================== */

.reader-header {
    text-align: center;
}

.reader-header h2 {
    margin: 0;
    font-size: 1.125rem;
}

.reader-header p {
    margin: 0;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-muted);
}

.verse {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--card-border-color);
}

.verse {
    display: flex;
    gap: 1rem;
}

.verse-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.verse-number {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    background: rgba(25, 230, 107, 0.1);
    color: var(--primary);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.verse-content {
    flex: 1;
    min-width: 0;
}

.verse-header {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 1rem;
    font-weight: 700;
}

.verse-arabic {
    flex: 1;
    font-family: var(--font-family-arabic);
    font-size: 1.75rem;
    line-height: 2.2;
    text-align: right;
    direction: rtl;
}

.verse-transliteration {
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-muted);
    font-style: italic;
    margin-top: 0.75rem;
    display: none;
}

.verse-transliteration.visible {
    display: block;
}

.verse-translation {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--color-muted);
    line-height: 1.6;
    display: none;
}

.verse-translation.visible {
    display: block;
}

/* ========================================
   AUTHENTICATION PAGES
   ======================================== */

.auth-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1rem 2rem;
    text-align: center;
}

.auth-logo {
    width: 5rem;
    height: 5rem;
    background: var(--primary);
    border-radius: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(12deg);
    box-shadow: var(--shadow-lg), var(--shadow-primary);
    margin-bottom: 1rem;
}

.auth-logo .material-symbols-outlined {
    font-size: 3rem;
    color: var(--primary-inverse);
    transform: rotate(-12deg);
}

.auth-header h1 {
    margin: 0;
    font-size: 1.875rem;
}

.auth-form {
    padding: 0 1.5rem;
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

/* ========================================
   ISLAMIC PATTERN BACKGROUND
   ======================================== */

.islamic-pattern {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-color: var(--background-color);
    background-image: radial-gradient(var(--primary) 0.5px, transparent 0.5px);
    background-size: 24px 24px;
    opacity: 0.03;
    z-index: -1;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--primary);
    color: var(--primary-inverse);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.toast-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-content h4 {
    font-size: 0.875rem;
    font-weight: 700;
    margin: 0;
}

.toast-content p {
    font-size: 0.75rem;
    margin: 0;
    opacity: 0.8;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.3s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* ========================================
   UTILITIES
   ======================================== */

.rounded { border-radius: var(--border-radius); }
.rounded-lg { border-radius: var(--border-radius-lg); }
.rounded-xl { border-radius: var(--border-radius-xl); }
.rounded-full { border-radius: var(--border-radius-full); }

.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.opacity-50 { opacity: 0.5; }
.opacity-60 { opacity: 0.6; }
.opacity-80 { opacity: 0.8; }

.pointer-events-none { pointer-events: none; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* No Scrollbar */
.no-scrollbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Material Icons Fill */
.material-symbols-outlined.filled {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* iOS Safe Area */
.pt-safe { padding-top: var(--safe-area-inset-top); }
.pb-safe { padding-bottom: var(--safe-area-inset-bottom); }

/* ========================================
   ADDITIONAL VARIABLES
   ======================================== */

:root {
    --background-dark: #112117;
    --surface-dark: #1c2620;
    --border-color: rgba(255, 255, 255, 0.1);
    --text-color: #f3f4f6;
    --text-muted: #9db8a8;
}

[data-theme="dark"] {
    --background-dark: #112117;
    --surface-dark: #1c2620;
    --border-color: rgba(255, 255, 255, 0.1);
    --text-color: #f3f4f6;
    --text-muted: #9db8a8;
}

/* ========================================
   APP CONTAINER
   ======================================== */

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    max-width: 48rem;
    margin: 0 auto;
    background: var(--background-color);
}

/* ========================================
   GLASS EFFECT
   ======================================== */

.glass {
    background: rgba(17, 33, 23, 0.8) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ========================================
   ICON BUTTON
   ======================================== */

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.w-10 {
    width: 2.5rem;
}

/* ========================================
   SEARCH BOX
   ======================================== */

.search-container {
    padding: 0.5rem 1rem 0.75rem;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--surface-dark);
    border-radius: 0.75rem;
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    padding: 0;
    color: var(--text-color);
    font-size: 0.9375rem;
}

.search-box input:focus {
    outline: none;
    box-shadow: none;
}

.search-box .material-symbols-outlined {
    color: var(--text-muted);
}

/* ========================================
   FILTER CHIPS
   ======================================== */

.filter-chips {
    display: flex;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.chip .material-symbols-outlined {
    font-size: 1.125rem;
}

.chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--background-dark);
}

/* ========================================
   DISCOVER PAGE
   ======================================== */

.discover-content {
    flex: 1;
    padding: 0 1rem;
    padding-bottom: 6rem;
    overflow-y: auto;
}

.hatim-card {
    background: var(--surface-dark);
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

.hatim-card-image {
    height: 10rem;
    position: relative;
    background-size: cover;
    background-position: center;
}

.hatim-badge {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hatim-badge.active {
    background: rgba(25, 230, 107, 0.2);
    color: var(--primary);
}

.hatim-badge.closing {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.hatim-badge.new {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

.hatim-card-content {
    padding: 1rem;
}

.hatim-card-header {
    margin-bottom: 1rem;
}

.hatim-card-header h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.progress-section {
    margin-bottom: 1rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 1rem;
    box-shadow: 0 0 8px rgba(25, 230, 107, 0.4);
}

.hatim-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

/* Avatar Stack */
.avatar-stack {
    display: flex;
    margin-left: 0.5rem;
}

.avatar-item {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
    margin-left: -0.5rem;
    border: 2px solid var(--surface-dark);
}

.avatar-item:first-child {
    margin-left: 0;
}

.avatar-item.primary {
    background: var(--primary);
    color: var(--background-dark);
}

/* Skeleton Loading */
.skeleton-card {
    background: var(--surface-dark);
    border-radius: 1rem;
    overflow: hidden;
}

.skeleton {
    background: linear-gradient(90deg, var(--surface-dark) 0%, rgba(255,255,255,0.1) 50%, var(--surface-dark) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-image {
    height: 10rem;
}

.skeleton-content {
    padding: 1rem;
}

.skeleton-title {
    height: 1.25rem;
    width: 60%;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.skeleton-text {
    height: 1rem;
    width: 40%;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

.skeleton-bar {
    height: 0.5rem;
    width: 100%;
    border-radius: 1rem;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Duplicate FAB and nav-item-center styles removed - using definitions from lines 374-391 and 578-586 */

/* ========================================
   NOTIFICATION BADGE
   ======================================== */

.notification-badge {
    position: relative;
}

.notification-badge::after {
    content: '';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 0.5rem;
    height: 0.5rem;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.notification-badge.has-unread::after {
    opacity: 1;
    transform: scale(1);
}

/* ========================================
   NOTIFICATION ALERT (APP BAR PULSE)
   ======================================== */

.app-bar.has-unread {
    animation: appbarPulse 1.1s ease-in-out infinite;
}

@keyframes appbarPulse {
    0% { box-shadow: 0 0 0 rgba(25, 230, 107, 0.0), inset 0 0 0 rgba(25, 230, 107, 0.0); }
    40% { box-shadow: 0 0 1.25rem rgba(25, 230, 107, 0.55), inset 0 0 0.5rem rgba(25, 230, 107, 0.35); }
    100% { box-shadow: 0 0 0 rgba(25, 230, 107, 0.0), inset 0 0 0 rgba(25, 230, 107, 0.0); }
}

/* ========================================
   MESSAGES
   ======================================== */

.message-card.unread {
    border-color: var(--primary);
    box-shadow: 0 0 0.75rem rgba(25, 230, 107, 0.15);
}

.message-unread-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--primary);
    display: inline-block;
}

/* ========================================
   SW UPDATE BANNER
   ======================================== */

.sw-update-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 4.5rem;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--card-background-color);
    border: 1px solid var(--card-border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}
/* ========================================
   SHARE MODAL
   ======================================== */

.share-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 130;
}
.share-modal.active {
    display: block;
}
.share-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}
.share-modal-content {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(92vw, 26rem);
    background: var(--card-background-color);
    border: 1px solid var(--card-border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--card-border-color);
}
.share-modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
}
.share-modal-body {
    padding: 1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.share-modal-body input {
    width: 100%;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--card-border-color);
    padding: 0.6rem 0.75rem;
    background: var(--form-element-background-color);
    color: var(--color);
}
.share-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}
