:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --accent-color: #8b0000; /* Rojo litúrgico */
    --secondary-text: #555555;
    --header-bg: #f8f9fa;
    --border-color: #eeeeee;
    --font-size-base: 18px;
    --line-height: 1.6;
}

.theme-dark {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --accent-color: #ff4d4d;
    --secondary-text: #b0b0b0;
    --header-bg: #1e1e1e;
    --border-color: #333333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header & Navigation */
.main-header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
}

.header-actions button, #btn-menu {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 5px 10px;
}

.date-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px;
    gap: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--accent-color);
}

.date-selector button {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 1.2rem;
    padding: 0 10px;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    display: flex;
    transition: opacity 0.3s;
}

.sidebar.hidden {
    display: none;
}

.sidebar-content {
    background-color: var(--bg-color);
    width: 280px;
    height: 100%;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-overlay {
    flex-grow: 1;
    background-color: rgba(0,0,0,0.5);
}

.sidebar h3 {
    margin-bottom: 20px;
    color: var(--accent-color);
}

.sidebar ul {
    list-style: none;
}

.sidebar .hour-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 15px 10px;
    border: none;
    background: none;
    color: var(--text-color);
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar .hour-btn.active {
    font-weight: bold;
    color: var(--accent-color);
    background-color: var(--header-bg);
}

/* Reader Area */
.reader-container {
    flex-grow: 1;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.liturgy-article {
    padding-bottom: 80px;
}

.liturgy-article h2 {
    color: var(--accent-color);
    font-size: 1.5rem;
    margin: 20px 0 10px 0;
    text-align: center;
}

.antifona {
    font-style: italic;
    color: var(--accent-color);
    margin: 10px 0;
    display: block;
}

.antifona::before {
    content: "Ant. ";
    font-weight: bold;
}

.salmo-titulo {
    font-weight: bold;
    display: block;
    margin-top: 15px;
}

.texto-oracion {
    margin-bottom: 20px;
}

.verso {
    display: block;
    margin-bottom: 5px;
}

/* Footer */
.main-footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background-color: var(--header-bg);
    border-top: 1px solid var(--border-color);
    padding: 10px 0;
}

.quick-nav {
    display: flex;
    justify-content: space-around;
}

.quick-nav .hour-btn {
    background: none;
    border: none;
    color: var(--secondary-text);
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: bold;
}

.quick-nav .hour-btn.active {
    color: var(--accent-color);
}

.loader {
    text-align: center;
    padding: 50px;
    font-style: italic;
    color: var(--secondary-text);
}

/* Ajustes de accesibilidad */
button:active {
    opacity: 0.7;
}

/* PWA Install Button */
.sidebar-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 20px 0;
}

.install-btn {
    width: 100%;
    padding: 15px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s;
}

.install-btn:active {
    transform: scale(0.98);
}

.btn-alt {
    background-color: #2c3e50 !important;
    margin-top: 10px;
}

.hidden {
    display: none !important;
}

/* Modal de Avisos */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
}

.modal-content {
    background: var(--bg-color);
    color: var(--text-color);
    width: 90%;
    max-width: 500px;
    padding: 25px;
    border-radius: 12px;
    position: relative;
    z-index: 1001;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.modal-header h3 {
    color: var(--accent-color);
}

#close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--secondary-text);
    cursor: pointer;
}

.modal-body {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 25px;
    white-space: pre-wrap;
}

.modal-footer {
    text-align: right;
}