/**
 * Terço Diário Guiado - Styles
 * Desenvolvido por B20 Conteúdo Digital
 * https://www.b20.com.br
 */

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

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
    /* Primary Palette - Royal Purple */
    --primary-color: #2D1B69;
    --secondary-color: #512B81;
    --accent-color: #635985;
    --surface-color: #F8FAFC;
    --text-color: #1E293B;

    /* Derived Colors */
    --primary-hover: #1F1247;
    --primary-light: rgba(45, 27, 105, 0.1);
    --primary-lighter: rgba(45, 27, 105, 0.05);
    --secondary-light: rgba(81, 43, 129, 0.1);

    /* Marian Colors */
    --marian-blue: #1E40AF;
    --gold: #F59E0B;
    --pearl-white: #F8FAFC;

    /* Mystery Colors */
    --joyful-color: #FFD700;
    --luminous-color: #87CEEB;
    --sorrowful-color: #DC143C;
    --glorious-color: #FFD700;

    /* UI Colors */
    --bg-color: #FFFFFF;
    --bg-secondary: #F1F5F9;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --border-color: #E2E8F0;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --error-color: #EF4444;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Typography */
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-prayer: 'Crimson Pro', Georgia, 'Times New Roman', serif;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* Layout */
    --header-height: 60px;
    --bottom-nav-height: 80px;
    --max-width: 600px;

    /* Font Sizes */
    --font-size-base: 16px;
    --font-size-prayer: 18px;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-color: #121212;
    --bg-secondary: #1E1E1E;
    --surface-color: #242424;
    --text-color: #E2E8F0;
    --text-muted: #CBD5E1;
    --text-light: #94A3B8;
    --border-color: #333333;

    /* Adjusted Primary for Dark Mode Contrast */
    --primary-color: #8B5CF6;
    /* Lighter Purple */
    --secondary-color: #A78BFA;
    --accent-color: #7C3AED;

    --primary-light: rgba(139, 92, 246, 0.2);
    --primary-lighter: rgba(139, 92, 246, 0.1);
    --secondary-light: rgba(167, 139, 250, 0.20);

    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
}

/* ===== BASE STYLES ===== */
html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-ui);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: var(--header-height);
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    transition: background-color var(--transition-normal), color var(--transition-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-color);
}

h1 {
    font-size: 1.75rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.125rem;
}

p {
    color: var(--text-muted);
}

.black-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background-color: #000000;
    z-index: 1001;
    pointer-events: none;
}

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

a:hover {
    color: var(--secondary-color);
}

/* ===== HEADER ===== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-md);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #E2E8F0;

    /* Force Light Mode Colors for Header */
    --primary-color: #2D1B69;
    --secondary-color: #512B81;
    --text-muted: #64748B;
    color: #1E293B;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.header-logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.header-logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.desktop-nav {
    display: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Desktop Navigation */
@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
        align-items: center;
        gap: var(--spacing-xs);
        z-index: 10;
        position: relative;
    }

    .desktop-nav .nav-link {
        display: flex;
        align-items: center;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm) var(--spacing-md);
        border-radius: var(--radius-md);
        color: var(--text-muted);
        font-size: 0.875rem;
        font-weight: 500;
        transition: all var(--transition-fast);
    }

    .desktop-nav .nav-link:hover {
        background: var(--primary-light);
        color: var(--primary-color);
    }

    .desktop-nav .nav-link.active {
        background: var(--primary-color);
        color: white;
    }

    .desktop-nav .nav-link i {
        font-size: 1rem;
    }
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed;
    bottom: 22px;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--bg-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1002;
    border-top: 1px solid var(--border-color);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    padding: var(--spacing-sm) 0;
    touch-action: manipulation;
    min-width: 64px;
    min-height: 48px;
    color: var(--text-muted);
    font-size: 0.625rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    border-radius: var(--radius-md);
    /* Button Reset */
    background: none;
    border: none;
    font-family: var(--font-ui);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.nav-item i {
    font-size: 1.25rem;
    transition: transform var(--transition-fast);
}

.nav-item span {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.nav-item.active i {
    transform: scale(1.1);
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none !important;
    }

    body {
        padding-bottom: 0;
    }
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-family: var(--font-ui);
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 44px;
    text-decoration: none;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-secondary:hover:not(:disabled) {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.btn-ghost:hover:not(:disabled) {
    background: var(--primary-light);
    color: var(--primary-color);
}

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

.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.1);
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.8125rem;
    min-height: 36px;
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1rem;
    min-height: 52px;
}

.btn-circle {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: var(--radius-full);
}

.btn-circle.btn-lg {
    width: 64px;
    height: 64px;
    font-size: 1.25rem;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

/* ===== CONTAINER ===== */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing-md);
}

/* ===== SECTIONS ===== */
.section {
    display: none;
    animation: fadeIn var(--transition-normal);
}

.section.active {
    display: block !important;
    opacity: 1;
    transform: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-header h2 {
    margin-bottom: var(--spacing-sm);
}

.section-header p {
    color: var(--text-muted);
}

/* ===== HOME SECTION ===== */
.hero-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: var(--spacing-2xl) var(--spacing-lg);
    border-radius: var(--radius-xl);
    text-align: center;
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-xl);
}

.hero-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.hero-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: white;
}

.hero-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: var(--spacing-lg);
    color: rgba(255, 255, 255, 0.9);
}

.hero-card .btn-primary {
    background: white;
    color: var(--primary-color);
}

.hero-card .btn-primary:hover {
    background: var(--pearl-white);
}

/* Mystery Preview Card */
.mystery-preview-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

.mystery-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.mystery-day {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.mystery-type {
    font-size: 0.75rem;
    font-weight: 600;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: var(--radius-full);
}

.mystery-preview-content h3 {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-xs);
}

.mystery-verse {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: var(--spacing-md);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--surface-color);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.stat-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Quick Actions */
.quick-actions {
    margin-bottom: var(--spacing-xl);
}

.quick-actions h3 {
    font-size: 1rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-muted);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-lg);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.action-card:hover {
    border-color: var(--primary-color);
    background: var(--primary-lighter);
    transform: translateY(-2px);
}

.action-icon {
    font-size: 2rem;
}

.action-card span {
    font-weight: 600;
    color: var(--text-color);
}

.action-card small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== FAQ SECTION ===== */
.faq-section {
    margin-top: var(--spacing-xl);
}

.faq-section h3 {
    margin-bottom: var(--spacing-md);
    font-size: 1.125rem;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.faq-item {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: transparent;
    border: none;
    font-family: var(--font-ui);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-color);
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.faq-question:hover {
    background: var(--primary-lighter);
}

.faq-icon {
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 var(--spacing-md) var(--spacing-md);
}

.faq-answer p {
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ===== PRAY SECTION ===== */
#pray {
    background: var(--bg-secondary);
    min-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: var(--spacing-xl);
}

#pray .container {
    max-width: 600px;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.prayer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.prayer-progress-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.mystery-indicator {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prayer-indicator {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

/* Bead Counter */
.bead-counter-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

.bead-counter {
    position: relative;
    width: 200px;
    height: 200px;
}

.bead-ring {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-full);
    background: var(--surface-color);
    box-shadow: var(--shadow-lg);
}

.beads-visual {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-full);
}

.bead-visual {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    transform-origin: center;
    transition: all var(--transition-fast);
}

.bead-visual.active {
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

.bead-visual.completed {
    background: var(--success-color);
}

.bead-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    z-index: 1;
}

.bead-count {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.bead-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Mystery Info Card */
.mystery-info-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    text-align: center;
    border: 1px solid var(--border-color);
}

.mystery-number {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-xs);
}

.mystery-title {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-xs);
}

.mystery-meditation {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
    display: none;
}

.mystery-meditation.visible {
    display: block;
    margin-bottom: var(--spacing-sm);
}

.toggle-meditation {
    font-size: 0.75rem;
}

/* Prayer Content Card */
.prayer-content-card {
    background: var(--bg-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    text-align: center;
    box-shadow: var(--shadow-lg);
    min-height: 200px;
}

.prayer-type {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: var(--spacing-sm);
}

.prayer-title {
    font-family: var(--font-prayer);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.prayer-text {
    font-family: var(--font-prayer);
    font-size: var(--font-size-prayer);
    line-height: 1.8;
    color: var(--text-color);
}

.prayer-text p {
    color: var(--text-color);
}

.prayer-text .highlight {
    color: var(--primary-color);
    font-weight: 500;
}

/* Prayer Controls */
.prayer-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

/* Progress Bar */
.prayer-progress-bar {
    margin-bottom: var(--spacing-md);
}

.progress-track {
    height: 4px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.progress-mysteries {
    display: flex;
    justify-content: space-between;
    padding: 0 var(--spacing-md);
}

.progress-mystery {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.progress-mystery.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.progress-mystery.completed {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

/* ===== MYSTERIES SECTION ===== */
.day-selector {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-lg);
    overflow-x: auto;
    padding-bottom: var(--spacing-sm);
    -webkit-overflow-scrolling: touch;
}

.day-btn {
    flex: 1;
    min-width: 44px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.day-btn:hover,
.day-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.day-btn.today {
    border-color: var(--primary-color);
}

/* Mystery Tabs */
.mystery-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    overflow-x: auto;
    padding-bottom: var(--spacing-sm);
    -webkit-overflow-scrolling: touch;
}

.mystery-tab {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.mystery-tab:hover,
.mystery-tab.active {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tab-icon {
    font-size: 1rem;
}

/* Mysteries List */
.mysteries-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.mystery-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    transition: all var(--transition-fast);
}

.mystery-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.mystery-card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.mystery-card-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary-color);
    flex-shrink: 0;
}

.mystery-card-content {
    flex: 1;
}

.mystery-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.mystery-card-verse {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.mystery-card-meditation {
    font-size: 0.875rem;
    color: var(--text-muted);
    padding-left: calc(36px + var(--spacing-md));
    line-height: 1.6;
}

.mysteries-actions {
    text-align: center;
}

/* ===== HISTORY SECTION ===== */
.history-stats {
    margin-bottom: var(--spacing-xl);
}

.history-stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.stat-icon-lg {
    font-size: 3rem;
}

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

.stat-big-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.stat-big-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.history-stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

.history-stat-item {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    text-align: center;
}

.history-stat-item .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.history-stat-item .stat-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Calendar */
.history-calendar {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.calendar-header h3 {
    font-size: 1rem;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.calendar-weekdays span {
    text-align: center;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--spacing-xs);
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.calendar-day.other-month {
    color: var(--text-light);
}

.calendar-day.today {
    border: 2px solid var(--primary-color);
    font-weight: 600;
}

.calendar-day.prayed {
    background: var(--primary-color);
    color: white;
}

.calendar-day.prayed-multiple {
    background: linear-gradient(135deg, var(--primary-color), var(--gold));
    color: white;
}

/* History List */
.history-recent {
    margin-bottom: var(--spacing-xl);
}

.history-recent h3 {
    font-size: 1rem;
    margin-bottom: var(--spacing-md);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.history-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.history-item-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: var(--radius-full);
    font-size: 1.25rem;
}

.history-item-content {
    flex: 1;
}

.history-item-title {
    font-size: 0.9375rem;
    font-weight: 500;
    margin-bottom: 2px;
}

.history-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.history-item-duration {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
}

.empty-state.hidden {
    display: none;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state h4 {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    margin-bottom: var(--spacing-lg);
}

.history-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
}

/* ===== SETTINGS SECTION ===== */
.settings-group {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.settings-group-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item-vertical {
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-sm);
}

.setting-info {
    flex: 1;
}

.setting-label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 500;
    margin-bottom: 2px;
}

.setting-description {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border-color);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--primary-color);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(24px);
}

/* Select */
.setting-select {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-size: 0.875rem;
    color: var(--text-color);
    cursor: pointer;
    min-width: 150px;
}

/* Range Control */
.range-control {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.range-control input[type="range"] {
    width: 100px;
    height: 4px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.range-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: var(--radius-full);
    cursor: pointer;
}

.range-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    min-width: 40px;
    text-align: right;
}

/* Textarea & Input */
.setting-textarea,
.setting-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-size: 0.9375rem;
    color: var(--text-color);
    resize: vertical;
    transition: border-color var(--transition-fast);
}

.setting-textarea:focus,
.setting-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* About */
.settings-about {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
}

.about-logo {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.settings-about h4 {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-xs);
}

.settings-about p {
    font-size: 0.875rem;
}

.about-tagline {
    font-style: italic;
    margin-top: var(--spacing-sm);
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--spacing-md) + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    width: calc(100% - var(--spacing-lg) * 2);
    max-width: 400px;
    pointer-events: none;
}

@media (min-width: 768px) {
    .toast-container {
        bottom: var(--spacing-lg);
    }
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--text-color);
    color: var(--bg-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-normal);
    pointer-events: auto;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--error-color);
}

.toast.warning {
    background: var(--warning-color);
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-message {
    flex: 1;
    font-size: 0.9375rem;
}

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay:not([hidden]) {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal-overlay:not([hidden]) .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.125rem;
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

/* Celebration Modal */
.modal-celebration {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.celebration-content {
    padding: var(--spacing-2xl);
}

.celebration-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    animation: celebratePulse 2s ease-in-out infinite;
}

@keyframes celebratePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.celebration-content h2 {
    font-size: 1.75rem;
    margin-bottom: var(--spacing-sm);
    color: white;
}

.celebration-message {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: var(--spacing-lg);
    color: rgba(255, 255, 255, 0.9);
}

.celebration-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.celebration-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.celebration-stat .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: white;
}

.celebration-stat .stat-label {
    font-size: 0.75rem;
    opacity: 0.8;
    color: rgba(255, 255, 255, 0.8);
}

.celebration-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.celebration-actions .btn-primary {
    background: white;
    color: var(--primary-color);
}

.celebration-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

/* ===== FOOTER ===== */
.app-footer {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    margin-bottom: var(--bottom-nav-height);
}

@media (min-width: 768px) {
    .app-footer {
        margin-bottom: 0;
    }
}

.app-footer p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
}

.b20-link {
    color: var(--primary-color);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.b20-link:hover {
    text-decoration: underline;
}

/* ===== UTILITIES ===== */
.hidden {
    display: none !important;
}

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

/* ===== LOADING SKELETON ===== */
.skeleton {
    background: linear-gradient(90deg,
            var(--border-color) 25%,
            var(--bg-secondary) 50%,
            var(--border-color) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (min-width: 768px) {
    :root {
        --font-size-base: 16px;
        --font-size-prayer: 20px;
    }

    .container {
        padding: var(--spacing-lg);
    }

    .hero-card {
        padding: var(--spacing-2xl) var(--spacing-xl);
    }

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

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

    .bead-counter {
        width: 250px;
        height: 250px;
    }

    .prayer-content-card {
        padding: var(--spacing-2xl);
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 800px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {

    .app-header,
    .bottom-nav,
    .prayer-controls,
    .btn {
        display: none !important;
    }

    body {
        padding: 0;
    }

    .prayer-content-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 767px) {

    /* Improve mystery card layout on mobile */
    .mystery-card-header {
        align-items: center;
    }

    .mystery-card-meditation {
        padding-left: 0;
        margin-top: var(--spacing-sm);
        text-align: justify;
    }

    /* Make day selector item sized better for touch */
    .day-btn {
        min-width: auto;
        padding: var(--spacing-sm) var(--spacing-xs);
        font-size: 0.70rem;
    }

    /* Make mystery tabs more compact */
    .mystery-tab {
        padding: var(--spacing-sm) var(--spacing-sm);
    }
}