/**
 * Calendário Litúrgico - Styles
 * Desenvolvido por B20 Conteúdo Digital
 * https://www.b20.com.br
 */

/* ========================================
   CSS CUSTOM PROPERTIES
   ======================================== */
:root {
    /* Primary Palette */
    --primary-color: #1A535C;
    --secondary-color: #4ECDC4;
    --accent-color: #F7FFF7;
    --surface-color: #ffffff;
    --text-color: #1a1a2e;
    --text-muted: #6b7280;
    --gold-color: #F59E0B;

    /* Liturgical Colors */
    --liturgical-green: #228B22;
    --liturgical-purple: #6B3FA0;
    --liturgical-white: #F8F8FF;
    --liturgical-red: #DC143C;
    --liturgical-pink: #FFB6C1;
    --liturgical-gold: #FFD700;
    --liturgical-black: #1a1a1a;

    /* UI Colors */
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --overlay-color: rgba(0, 0, 0, 0.5);

    /* Status Colors */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;

    /* Computed Colors */
    --primary-hover: color-mix(in srgb, var(--primary-color) 85%, black);
    --primary-light: color-mix(in srgb, var(--primary-color) 15%, white);
    --secondary-light: color-mix(in srgb, var(--secondary-color) 20%, white);

    /* Typography */
    --font-display: 'Libre Baskerville', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

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

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

    /* 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);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;

    /* Z-Index */
    --z-dropdown: 100;
    --z-sticky: 500;
    --z-modal: 1000;
    --z-toast: 2000;

    /* Layout */
    --header-height: 60px;
    --bottom-nav-height: 65px;
    --max-width: 1200px;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --surface-color: #1e293b;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow-color: rgba(0, 0, 0, 0.3);

    --liturgical-white: #e2e8f0;
}

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

html {
    font-size: clamp(14px, 2.5vw, 16px);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

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

@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    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 {
    margin-bottom: var(--spacing-md);
}

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

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

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

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

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

.main-content {
    min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
}

@media (min-width: 768px) {
    .main-content {
        min-height: calc(100vh - var(--header-height));
    }
}

/* ========================================
   HEADER
   ======================================== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--surface-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-md);
    box-shadow: var(--shadow-md);
    z-index: var(--z-sticky);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

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

.header-logo .logo-img {
    height: 40px;
    width: auto;
    padding: 4px;
    background: linear-gradient(135deg, #6B3FA0 0%, #4A2C6B 100%);
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(107, 63, 160, 0.3);
}

.header-logo i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.header-logo h1 {
    font-size: 1.125rem;
    font-family: var(--font-display);
    white-space: nowrap;
}

@media (max-width: 400px) {
    .header-logo h1 {
        font-size: 0.95rem;
    }
}

.desktop-nav {
    display: none;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
        gap: var(--spacing-xs);
    }

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

    .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;
    }
}

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

/* ========================================
   BOTTOM NAVIGATION
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 30px;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--surface-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px var(--shadow-color);
    z-index: 1002;
    /* padding-bottom: env(safe-area-inset-bottom, 0px); */
}

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

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.625rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    min-width: 56px;
    min-height: 48px;
}

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

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

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

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

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-color);
}

.btn-secondary:hover:not(:disabled) {
    background: color-mix(in srgb, var(--secondary-color) 85%, black);
}

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

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

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

.btn-danger:hover:not(:disabled) {
    background: color-mix(in srgb, var(--error-color) 85%, black);
}

.btn-text {
    background: transparent;
    color: var(--primary-color);
    padding: var(--spacing-xs) var(--spacing-sm);
    min-height: auto;
}

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

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

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

.btn-icon i {
    font-size: 1.25rem;
}



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

.section[hidden] {
    display: none !important;
}

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

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

.page-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    font-size: 1.5rem;
}

.page-title i {
    color: var(--primary-color);
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    font-size: 1.125rem;
    font-family: var(--font-body);
    font-weight: 600;
}

.section-title i {
    color: var(--gold-color);
}

/* ========================================
   HERO CAROUSEL
   ======================================== */
.hero-carousel {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    background: var(--card-bg);
    aspect-ratio: 16/9;
}

@media (max-width: 768px) {
    .hero-carousel {
        aspect-ratio: 4/5;
        min-height: 400px;
    }
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
    z-index: 1;
}

.carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

.slide-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: #2c3e50;
}

/* Subtle dark overlay for text readability */
.slide-background::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.slide-content {
    position: relative;
    z-index: 2;
    height: 100%;
    padding: var(--spacing-lg);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Improved gradient: clear top, dark bottom for text */
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.2) 0%,
            rgba(0, 0, 0, 0.0) 30%,
            rgba(0, 0, 0, 0.0) 50%,
            rgba(0, 0, 0, 0.6) 80%,
            rgba(0, 0, 0, 0.9) 100%);
}

/* Force white text with shadow for readability */
.slide-content h2,
.slide-content p,
.slide-content span,
.slide-content i,
.slide-title,
.slide-text,
.slide-subtext,
.slide-date {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.slide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slide-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.slide-date {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    /* Slightly larger */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    /* Stronger shadow */
    font-weight: 600;
}

.slide-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
    margin-top: auto;
    padding-bottom: var(--spacing-xl);
    /* Space for indicators */
}

.slide-title {
    font-size: 2.25rem;
    /* Larger */
    line-height: 1.1;
    margin-bottom: var(--spacing-xs);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    /* Very strong shadow */
    font-weight: 800;
    letter-spacing: -0.02em;
}

@media (max-width: 480px) {
    .slide-title {
        font-size: 1.75rem;
    }
}

.slide-text {
    font-size: 1.125rem;
    /* Larger */
    max-width: 90%;
    opacity: 1;
    /* Full opacity */
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    font-weight: 500;
    padding: 4px 0;
    /* Minor spacing */
}



.slide-subtext {
    font-size: 0.9375rem;
    opacity: 1;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.liturgy-color-badge {
    height: 8px;
    width: 60px;
    border-radius: var(--radius-full);
    margin-top: var(--spacing-md);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.saint-icon-large,
.readings-icon-large {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.9;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.carousel-btn.prev {
    left: var(--spacing-md);
}

.carousel-btn.next {
    right: var(--spacing-md);
}

.carousel-indicators {
    position: absolute;
    bottom: var(--spacing-md);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--spacing-sm);
    z-index: 10;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: white;
    transform: scale(1.2);
}

.btn-light {
    background: white;
    color: var(--text-color);
    border: none;
    font-weight: 600;
}

.btn-light:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* ========================================
   COUNTDOWNS
   ======================================== */
.countdowns-section {
    margin-bottom: var(--spacing-xl);
}

.countdowns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-md);
}

.countdown-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

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

.countdown-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--spacing-sm);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.countdown-icon.christmas {
    background: linear-gradient(135deg, #dc2626, #16a34a);
    color: white;
}

.countdown-icon.easter {
    background: linear-gradient(135deg, var(--liturgical-white), var(--gold-color));
    color: var(--text-color);
}

.countdown-icon.pentecost {
    background: linear-gradient(135deg, var(--liturgical-red), #ff6b6b);
    color: white;
}

.countdown-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: var(--spacing-xs);
}

.countdown-days {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--primary-color);
}

.countdown-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========================================
   STATS
   ======================================== */
.stats-section {
    margin-bottom: var(--spacing-xl);
}

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

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

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

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

/* ========================================
   UPCOMING LIST
   ======================================== */
.upcoming-section {
    margin-bottom: var(--spacing-xl);
}

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

.upcoming-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.upcoming-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.upcoming-color {
    width: 8px;
    height: 48px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.upcoming-info {
    flex: 1;
    min-width: 0;
}

.upcoming-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-color);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upcoming-type {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.upcoming-date {
    text-align: right;
    flex-shrink: 0;
}

.upcoming-day {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.upcoming-month {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ========================================
   CALENDAR
   ======================================== */
.calendar-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.calendar-title-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.calendar-title {
    font-size: 1.25rem;
    font-family: var(--font-display);
}

.view-toggle {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
    background: var(--card-bg);
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.view-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.view-btn.active {
    background: var(--primary-color);
    color: white;
}

.calendar-wrapper {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: var(--spacing-lg);
}

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

.calendar-weekdays span {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: var(--spacing-sm);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    min-height: 44px;
}

.calendar-day:hover {
    transform: scale(1.05);
    z-index: 1;
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day.today {
    box-shadow: inset 0 0 0 2px var(--primary-color);
}

.calendar-day .day-number {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
}

.calendar-day.liturgical-green {
    background: var(--liturgical-green);
}

.calendar-day.liturgical-purple {
    background: var(--liturgical-purple);
}

.calendar-day.liturgical-white {
    background: var(--liturgical-white);
    border: 1px solid var(--border-color);
}

.calendar-day.liturgical-red {
    background: var(--liturgical-red);
}

.calendar-day.liturgical-pink {
    background: var(--liturgical-pink);
}

.calendar-day.liturgical-gold {
    background: var(--liturgical-gold);
}

.calendar-day.liturgical-green .day-number,
.calendar-day.liturgical-purple .day-number,
.calendar-day.liturgical-red .day-number {
    color: white;
}

.calendar-day .celebration-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--gold-color);
    position: absolute;
    bottom: 4px;
}

/* Year View */
.year-view {
    margin-bottom: var(--spacing-lg);
}

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

@media (min-width: 768px) {
    .year-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .year-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.year-month {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.year-month-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
}

.year-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

.year-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    border-radius: 2px;
    cursor: pointer;
}

/* Color Legend */
.color-legend {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.color-legend h4 {
    font-size: 0.875rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-color);
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* ========================================
   SEASONS
   ======================================== */
.seasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.season-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.season-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.season-card.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.season-header {
    padding: var(--spacing-lg);
    color: white;
    position: relative;
}

.season-header.advent {
    background: linear-gradient(135deg, var(--liturgical-purple), #8b5cf6);
}

.season-header.christmas {
    background: linear-gradient(135deg, var(--liturgical-white), var(--gold-color));
    color: var(--text-color);
}

.season-header.lent {
    background: linear-gradient(135deg, var(--liturgical-purple), #6b21a8);
}

.season-header.easter {
    background: linear-gradient(135deg, var(--liturgical-white), var(--secondary-color));
    color: var(--text-color);
}

.season-header.ordinary {
    background: linear-gradient(135deg, var(--liturgical-green), #16a34a);
}

.season-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

.season-name {
    font-size: 1.25rem;
    font-family: var(--font-display);
    margin-bottom: var(--spacing-xs);
}

.season-dates {
    font-size: 0.875rem;
    opacity: 0.9;
}

.season-body {
    padding: var(--spacing-md);
}

.season-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
}

.season-color-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.875rem;
}

.season-color-swatch {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.current-season-detail {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.current-season-detail h3 {
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
}

.season-detail-content {
    display: grid;
    gap: var(--spacing-md);
}

.season-detail-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.season-detail-item i {
    color: var(--gold-color);
    font-size: 1.25rem;
    margin-top: 2px;
}

.season-detail-item h4 {
    font-size: 0.9375rem;
    margin-bottom: var(--spacing-xs);
}

.season-detail-item p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

/* ========================================
   CELEBRATIONS
   ======================================== */
.search-container {
    margin-bottom: var(--spacing-md);
}

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

.search-input-wrapper i {
    position: absolute;
    left: var(--spacing-md);
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    padding: var(--spacing-md);
    padding-left: calc(var(--spacing-md) * 2 + 16px);
    padding-right: calc(var(--spacing-md) * 2 + 16px);
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--card-bg);
    color: var(--text-color);
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-clear {
    position: absolute;
    right: var(--spacing-sm);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--spacing-sm);
}

.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    overflow-x: auto;
    padding-bottom: var(--spacing-sm);
    -webkit-overflow-scrolling: touch;
}

.filter-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

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

.celebration-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.celebration-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.celebration-color {
    width: 8px;
    height: 56px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.celebration-info {
    flex: 1;
    min-width: 0;
}

.celebration-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-color);
    margin-bottom: 2px;
}

.celebration-type {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary-light);
    color: var(--primary-color);
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: var(--radius-full);
    margin-bottom: 4px;
}

.celebration-type.solemnity {
    background: var(--gold-color);
    color: var(--text-color);
}

.celebration-type.feast {
    background: var(--secondary-color);
    color: var(--text-color);
}

.celebration-type.memorial {
    background: var(--primary-light);
    color: var(--primary-color);
}

.celebration-type.optional {
    background: var(--border-color);
    color: var(--text-muted);
}

.celebration-description {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.celebration-date {
    text-align: right;
    flex-shrink: 0;
}

.celebration-day {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.celebration-month {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

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

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

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

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

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

.settings-group-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-md);
}

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

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

.setting-item:first-of-type {
    padding-top: 0;
}

.setting-info {
    flex: 1;
    min-width: 0;
}

.setting-label {
    display: block;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 2px;
}

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

.setting-value {
    font-weight: 600;
    color: var(--primary-color);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    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-color: var(--border-color);
    transition: var(--transition-fast);
    border-radius: var(--radius-full);
}

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

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

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

/* FAQ Section in Home */
.faq-section {
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-xxl);
}

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

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

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



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

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

.faq-icon {
    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);
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.faq-answer p {
    margin: 0;
}

/* About */
.about-content {
    text-align: center;
}

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

.app-tagline {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.developer-credit {
    font-size: 0.875rem;
    color: var(--text-muted);
}

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

.b20-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ========================================
   MODALS
   ======================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: var(--overlay-color);
    animation: fadeIn var(--transition-fast);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp var(--transition-slow);
}

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

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

.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-title {
    font-size: 1.125rem;
    font-family: var(--font-display);
}

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

.btn-close:hover {
    background: var(--border-color);
    color: var(--text-color);
}

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    flex: 1;
}

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

/* Modal Day Detail */
.day-detail-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.day-detail-color {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
}

.day-detail-info h4 {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-xs);
}

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

.day-detail-section {
    margin-bottom: var(--spacing-md);
}

.day-detail-section h5 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.day-detail-section p {
    font-size: 0.9375rem;
    margin: 0;
}



/* ========================================
   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: var(--z-toast);
    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);
    background: var(--text-color);
    color: var(--bg-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: toastIn var(--transition-slow);
    pointer-events: auto;
}

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

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

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

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

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.toast.hiding {
    animation: toastOut var(--transition-fast) forwards;
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

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

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
}

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

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

.app-footer p:last-child {
    margin-bottom: 0;
}

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

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

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

.skeleton-text {
    height: 1em;
    margin-bottom: var(--spacing-sm);
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: var(--spacing-md);
}

.skeleton-card {
    height: 120px;
}

/* ========================================
   UTILITIES
   ======================================== */
.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;
}

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

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

.font-bold {
    font-weight: 700;
}

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

    .app-header,
    .bottom-nav,
    .app-footer,
    .toast-container {
        display: none !important;
    }

    body {
        padding: 0;
    }

    .section {
        display: block !important;
    }
}