/**
 * Qaza Tracker — Premium Dark Theme
 * Islamic-inspired design with emerald/gold accents
 */

/* ===== FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Amiri:wght@400;700&display=swap');

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

/* ===== DESIGN TOKENS ===== */
:root {
    /* Backgrounds */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-elevated: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.6);
    --bg-card-hover: rgba(255, 255, 255, 0.9);
    --bg-input: rgba(255, 255, 255, 0.7);
    --bg-input-focus: #ffffff;

    /* Borders */
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --border-focus: rgba(16, 185, 129, 0.4);

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    /* Accent: Emerald */
    --emerald: #10b981;
    --emerald-light: #34d399;
    --emerald-dark: #059669;
    --emerald-glow: rgba(16, 185, 129, 0.12);
    --emerald-glow-strong: rgba(16, 185, 129, 0.25);

    /* Accent: Gold */
    --gold: #f59e0b;
    --gold-light: #fbbf24;
    --gold-dark: #d97706;

    /* Status */
    --red: #ef4444;
    --red-light: #f87171;
    --blue: #3b82f6;

    /* Typography */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Amiri', Georgia, serif;

    /* Spacing */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --nav-height: 72px;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

/* ===== BASE ===== */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 15% 50%, rgba(16, 185, 129, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 20%, rgba(245, 158, 11, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(16, 185, 129, 0.04) 0%, transparent 40%);
}

a {
    color: var(--emerald);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--emerald-light);
}

/* ===== NAVIGATION ===== */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.main-nav.scrolled {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--emerald-glow);
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.04);
}

.nav-link.active {
    color: var(--emerald);
    background: var(--emerald-glow);
}

.nav-link svg {
    opacity: 0.7;
    transition: var(--transition-fast);
}

.nav-link:hover svg,
.nav-link.active svg {
    opacity: 1;
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 0.5rem;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-greeting {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--emerald-dark), var(--emerald));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.logout-link {
    color: var(--text-muted) !important;
}

.logout-link:hover {
    color: var(--red-light) !important;
    background: rgba(239, 68, 68, 0.08) !important;
}



/* ===== MAIN CONTENT ===== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: calc(var(--nav-height) + 2rem) 1.5rem 3rem;
    min-height: 100vh;
}

.main-content.no-nav {
    padding-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== FLASH MESSAGES ===== */
.flash-message {
    position: fixed;
    top: calc(var(--nav-height) + 1rem);
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    opacity: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    min-width: 360px;
    max-width: 560px;
    border-radius: var(--radius);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.flash-message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.flash-success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
    color: var(--emerald-light);
}

.flash-error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--red-light);
}

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

.flash-icon {
    flex-shrink: 0;
    display: flex;
}

.flash-text {
    font-size: 0.92rem;
    font-weight: 500;
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.3rem;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 0.25rem;
    transition: var(--transition-fast);
}

.flash-close:hover {
    opacity: 1;
}

/* ===== GLASS CARD ===== */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

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

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

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

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
    color: #fff;
    box-shadow: 0 4px 15px var(--emerald-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--emerald-glow-strong);
    color: #fff;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: rgba(0, 0, 0, 0.03);
}

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

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn.loading span {
    opacity: 0;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    opacity: 0;
    transform: translateY(15px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.stat-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.stat-card:nth-child(1) { transition-delay: 0.05s; }
.stat-card:nth-child(2) { transition-delay: 0.1s; }
.stat-card:nth-child(3) { transition-delay: 0.15s; }
.stat-card:nth-child(4) { transition-delay: 0.2s; }

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

.stat-card.animate-in:hover {
    transform: translateY(-3px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-total .stat-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue);
}

.stat-completed .stat-icon {
    background: var(--emerald-glow);
    color: var(--emerald);
}

.stat-remaining .stat-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--gold);
}

.stat-progress .stat-icon {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== PROGRESS BAR ===== */
.progress-section {
    margin-bottom: 2rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.progress-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.progress-value {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 100px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--emerald-dark), var(--emerald), var(--emerald-light));
    border-radius: 100px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== SECTION HEADER ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.section-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
}

.view-all-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--emerald);
}

.view-all-link:hover {
    color: var(--emerald-light);
}

/* ===== RECORDS LIST (Dashboard) ===== */
.records-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.record-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid transparent;
    transition: var(--transition);
    opacity: 0;
    transform: translateX(-10px);
}

.record-item.animate-in {
    opacity: 1;
    transform: translateX(0);
}

.record-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border);
}

.record-prayer {
    flex-shrink: 0;
}

.record-details {
    flex: 1;
}

.record-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* ===== PRAYER BADGES ===== */
.prayer-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.prayer-fajr {
    background: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.prayer-zuhr {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.prayer-asr {
    background: rgba(249, 115, 22, 0.12);
    color: #fb923c;
    border: 1px solid rgba(249, 115, 22, 0.2);
}

.prayer-maghrib {
    background: rgba(236, 72, 153, 0.12);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.2);
}

.prayer-isha {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.prayer-witr {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-completed {
    background: var(--emerald-glow);
    color: var(--emerald-light);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--gold-light);
    border: 1px solid rgba(245, 158, 11, 0.15);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-icon {
    color: var(--text-muted);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 1.5rem;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== AUTH SECTION ===== */
.auth-section {
    width: 100%;
    min-height: 100vh;
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    width: 100%;
}

/* Auth Decoration Panel */
.auth-decoration {
    background: linear-gradient(160deg, #ecfdf5 0%, #d1fae5 40%, #a7f3d0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.auth-decoration::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--emerald-glow-strong) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse-glow 4s ease-in-out infinite;
}

.auth-decoration::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5L35 15L45 15L37 22L40 32L30 26L20 32L23 22L15 15L25 15Z' fill='none' stroke='rgba(16,185,129,0.06)' stroke-width='0.5'/%3E%3C/svg%3E");
    background-size: 60px 60px;
    opacity: 0.5;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}

.auth-deco-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 380px;
}

.auth-deco-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 30px var(--emerald-glow-strong));
}

.auth-deco-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--emerald-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-deco-text {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 2.5rem;
}

.auth-deco-verse {
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius);
    border-left: 3px solid var(--emerald);
}

.auth-deco-verse p {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.auth-deco-verse span {
    font-size: 0.82rem;
    color: var(--emerald);
    font-weight: 600;
}

/* Auth Form Panel */
.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: var(--bg-primary);
}

.auth-form-wrapper {
    width: 100%;
    max-width: 420px;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

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

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

.auth-switch a {
    font-weight: 600;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition);
}

.form-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    background: var(--bg-input-focus);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--emerald-glow);
}

.form-input:focus + .input-icon,
.form-input:focus ~ .input-icon {
    color: var(--emerald);
}

.input-wrapper:has(.form-input:focus) .input-icon {
    color: var(--emerald);
}

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

/* Date input fix */
input[type="date"] {
    color-scheme: light;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* ===== PRAYER GRID (Add Qaza) ===== */
.prayer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.prayer-card {
    cursor: pointer;
}

.prayer-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.prayer-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.prayer-card:hover .prayer-card-inner {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.prayer-card.selected .prayer-card-inner,
.prayer-card input:checked + .prayer-card-inner {
    border-color: var(--emerald);
    background: var(--emerald-glow);
    box-shadow: 0 4px 20px var(--emerald-glow);
}

.prayer-card-icon {
    font-size: 1.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.prayer-card-icon svg {
    width: 28px;
    height: 28px;
}

.prayer-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.prayer-card input:checked + .prayer-card-inner .prayer-card-name,
.prayer-card input:checked + .prayer-card-inner .prayer-card-icon {
    color: var(--emerald-dark);
}

/* ===== ADD FORM CONTAINER ===== */
.add-form-container {
    max-width: 640px;
}

.add-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ===== FILTER TABS ===== */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.35rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    width: fit-content;
}

.filter-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition);
}

.filter-tab:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.04);
}

.filter-tab.active {
    color: var(--emerald);
    background: var(--emerald-glow);
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.filter-tab.active .filter-count {
    background: rgba(16, 185, 129, 0.2);
}

/* ===== RECORDS TABLE ===== */
.records-table-container {
    overflow-x: auto;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
}

.records-table th {
    text-align: left;
    padding: 0.85rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--emerald);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border);
}

.records-table td {
    padding: 0.85rem 1rem;
    font-size: 0.92rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    vertical-align: middle;
}

.records-table tr:last-child td {
    border-bottom: none;
}

.records-table tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

.date-cell {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.actions-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inline-form {
    display: inline;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.btn-complete:hover {
    color: var(--emerald);
    border-color: rgba(16, 185, 129, 0.3);
    background: var(--emerald-glow);
}

.btn-delete:hover {
    color: var(--red);
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
}

.row-completed {
    opacity: 0.6;
}

/* ===== FOOTER ===== */
.main-footer {
    text-align: center;
    padding: 2rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

/* ===== ANIMATIONS ===== */
.glass-card {
    opacity: 0;
    transform: translateY(15px);
}

.glass-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* ===== MOBILE TOP BAR ===== */
.mobile-topbar {
    display: none; /* Hidden on desktop */
}

/* ===== MOBILE BOTTOM NAV ===== */
.mobile-bottom-nav {
    display: none; /* Hidden on desktop */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Breakpoint */
@media (max-width: 768px) {

    /* ── Hide Desktop Nav, Show Mobile Nav ── */
    .desktop-nav {
        display: none !important;
    }

    .mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        height: var(--nav-height);
        padding: 0 1rem;
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
    }

    .mobile-topbar .nav-logo {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        text-decoration: none;
        color: var(--text-primary);
    }

    .mobile-topbar .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }

    .mobile-topbar .logo-text {
        font-size: 1.15rem;
    }

    .mobile-logout-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: var(--radius-sm);
        color: var(--text-muted);
        transition: var(--transition);
        text-decoration: none;
    }

    .mobile-logout-btn:hover,
    .mobile-logout-btn:active {
        color: var(--red-light);
        background: rgba(239, 68, 68, 0.08);
    }

    /* ── Bottom Navigation Bar ── */
    .mobile-bottom-nav {
        display: flex;
        align-items: stretch;
        justify-content: space-around;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        height: 68px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-top: 1px solid var(--border);
        padding: 0 0.25rem;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        flex: 1;
        padding: 8px 4px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.7rem;
        font-weight: 500;
        letter-spacing: 0.2px;
        transition: var(--transition);
        position: relative;
        -webkit-tap-highlight-color: transparent;
    }

    .bottom-nav-item svg {
        transition: var(--transition);
    }

    .bottom-nav-item span {
        transition: var(--transition);
    }

    .bottom-nav-item:active {
        transform: scale(0.92);
    }

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

    .bottom-nav-item.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 32px;
        height: 3px;
        background: var(--emerald);
        border-radius: 0 0 4px 4px;
    }

    .bottom-nav-avatar {
        width: 24px;
        height: 24px;
        border-radius: 6px;
        background: linear-gradient(135deg, var(--emerald-dark), var(--emerald));
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.72rem;
        font-weight: 700;
    }

    .bottom-nav-profile.active .bottom-nav-avatar {
        box-shadow: 0 0 0 2px var(--emerald);
    }

    /* ── Main Content Adjustments ── */
    .main-content {
        padding-top: calc(var(--nav-height) + 1.25rem);
        padding-bottom: calc(68px + 1.5rem + env(safe-area-inset-bottom, 0px));
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* ── Footer — hide on mobile (bottom nav replaces it) ── */
    .main-footer {
        display: none;
    }

    /* ── Auth Pages ── */
    .auth-container {
        grid-template-columns: 1fr;
    }

    .auth-decoration {
        display: none;
    }

    .auth-form-panel {
        min-height: 100vh;
        padding: 2rem 1.25rem;
    }

    .main-content.no-nav {
        padding-bottom: 0;
    }

    /* ── Page Header ── */
    .page-header {
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .page-title {
        font-size: 1.35rem;
    }

    .page-subtitle {
        font-size: 0.88rem;
    }

    /* ── Stats Grid ── */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }

    .stat-card {
        padding: 1rem;
        gap: 0.75rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-icon svg {
        width: 20px;
        height: 20px;
    }

    .stat-value {
        font-size: 1.35rem;
    }

    .stat-label {
        font-size: 0.72rem;
    }

    /* ── Progress Section ── */
    .progress-section {
        margin-bottom: 1.25rem;
    }

    .progress-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    /* ── Glass Cards ── */
    .glass-card {
        padding: 1.25rem;
        border-radius: var(--radius);
    }

    /* ── Prayer Grid ── */
    .prayer-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.6rem;
    }

    .prayer-card-inner {
        padding: 1rem 0.5rem;
        gap: 0.35rem;
    }

    .prayer-card-icon svg {
        width: 24px;
        height: 24px;
    }

    .prayer-card-name {
        font-size: 0.82rem;
    }

    /* ── Filter Tabs ── */
    .filter-tabs {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

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

    .filter-tab {
        flex: 1;
        justify-content: center;
        white-space: nowrap;
        padding: 0.45rem 0.6rem;
        font-size: 0.82rem;
    }

    .filter-count {
        min-width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }

    /* ── Records Table → Card Layout on Mobile ── */
    .records-table-container {
        overflow-x: visible;
    }

    .records-table thead {
        display: none;
    }

    .records-table,
    .records-table tbody,
    .records-table tr,
    .records-table td {
        display: block;
        width: 100%;
    }

    .records-table tr {
        padding: 1rem;
        margin-bottom: 0.6rem;
        border-radius: var(--radius);
        border: 1px solid var(--border);
        background: var(--bg-card);
        position: relative;
    }

    .records-table tr:hover td {
        background: transparent;
    }

    .records-table td {
        padding: 0.2rem 0;
        border-bottom: none;
        font-size: 0.88rem;
    }

    .records-table td:first-child {
        margin-bottom: 0.35rem;
    }

    .records-table .date-cell {
        font-size: 0.82rem;
    }

    .records-table .actions-cell {
        margin-top: 0.6rem;
        padding-top: 0.6rem;
        border-top: 1px solid var(--border);
        justify-content: flex-start;
        gap: 0.6rem;
    }

    .btn-action {
        width: 38px;
        height: 38px;
    }

    /* ── Record Items (Dashboard) ── */
    .record-item {
        padding: 0.75rem;
        gap: 0.65rem;
        flex-wrap: wrap;
    }

    .record-details {
        min-width: 0;
    }

    .status-badge {
        font-size: 0.72rem;
        padding: 0.2rem 0.55rem;
    }

    /* ── Flash Messages ── */
    .flash-message {
        min-width: auto;
        left: 0.75rem;
        right: 0.75rem;
        transform: translateY(-20px);
        padding: 0.75rem 1rem;
        font-size: 0.88rem;
    }

    .flash-message.show {
        transform: translateY(0);
    }

    /* ── Add Form ── */
    .add-form-container {
        max-width: 100%;
    }

    .form-actions {
        flex-direction: column-reverse;
        gap: 0.6rem;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* ── Empty State ── */
    .empty-state {
        padding: 2rem 1rem;
    }

    /* ── Section Headers ── */
    .section-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* ── Buttons ── */
    .btn {
        padding: 0.65rem 1.15rem;
        font-size: 0.88rem;
    }

    .btn-sm {
        padding: 0.5rem 0.9rem;
        font-size: 0.82rem;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .prayer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mobile-topbar {
        padding: 0 0.75rem;
    }

    .mobile-topbar .logo-text {
        font-size: 1.05rem;
    }

    .page-title {
        font-size: 1.2rem;
    }

    .auth-title {
        font-size: 1.4rem;
    }

    .auth-form-panel {
        padding: 1.5rem 1rem;
    }

    .bottom-nav-item {
        font-size: 0.65rem;
    }

    .bottom-nav-item svg {
        width: 20px;
        height: 20px;
    }
}

/* ===== SELECTION / SCROLLBAR ===== */
::selection {
    background: var(--emerald-glow-strong);
    color: var(--text-primary);
}

::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* ===== GLOBAL OVERFLOW PREVENTION ===== */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

img, video, iframe, table {
    max-width: 100%;
}
