body { font-family: Arial, sans-serif; margin: 20px; background-color: #f0f0f0; }
        h1, h2 { text-align: center; color: #333; }
        table { width: 100%; border-collapse: collapse; margin-bottom: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
        th, td { border: 1px solid #ccc; padding: 10px; text-align: left; }
        th { background-color: #555; color: white; }
        .origenes { background-color: #e6f3ff; }
        .exodo-monarquia { background-color: #e6ffe6; }
        .reinos-divididos { background-color: #fff7e6; }
        .post-exilio { background-color: #f2e6ff; }
        .profetas { background-color: #f0f0f0; }
        .tanaj-link { color: #0056b3; text-decoration: underline; cursor: pointer; font-weight: bold; }
        .tanaj-link:hover { color: #003d82; }

        /* Estilos para Tikkun */
        .tikkun-container {
            height: calc(100vh - 250px); /* Ajustar altura según sea necesario */
            overflow-y: auto;
        }
        #tikkun-table {
            width: 100%;
            table-layout: fixed;
        }
        #tikkun-table th, #tikkun-table td {
            padding: 8px;
            text-align: right;
            vertical-align: top;
            word-wrap: break-word;
        }
        #tikkun-table th:first-child, #tikkun-table td:first-child {
            text-align: left;
            direction: ltr;
        }
        #tikkun-table .hebrew-text {
            font-size: 1.2em; /* Tamaño de fuente más grande para hebreo */
            direction: rtl;
        }
        #col-verse-ref.hidden,
        #col-nikud.hidden,
        #col-no-nikud.hidden {
            visibility: collapse;
        }

/* --- Reset & Base Styles --- */
:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --text-color: #333;
    --bg-color: #fff;
    --border-color: #e0e0e0;
    --header-bg: #f8f9fa;
    --sidebar-bg: #f4f4f4;
    --font-sans: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-serif: 'Georgia', serif;

    /* Default Section Colors */
    --section-bg-color: var(--bg-color);
    --section-text-color: var(--text-color);
    --section-border-color: var(--primary-color);

    font-size: 1em; /* Set 1em as the standard base font size */
}

/* Global box-sizing for consistent layout */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-y: scroll;
}

html, body {
    height: 100%;
    margin: 0;
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--section-text-color);
    background-color: var(--section-bg-color);
    overflow-x: hidden;
    transition: background-color 0.3s ease;
    word-wrap: break-word; /* Prevent overflow from long words */
}

/* --- Main Layout --- */
.main-container {
    display: flex;
    height: 100%;
}

.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1001;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out, width 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Make the entire sidebar scrollable */
}

.sidebar.open {
    transform: translateX(0);
    box-shadow: 3px 0 15px rgba(0,0,0,0.1);
    width: 280px; /* Full width when open */
}

.sidebar.collapsed {
    width: 60px; /* Width when collapsed (icon-only) */
    transform: translateX(0); /* Always visible on desktop */
    box-shadow: none;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.collapsed .sidebar-header h3 {
    display: none; /* Hide title when collapsed */
}

.main-nav {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-content {
    padding: 1rem;
    /* overflow-y: auto; This is now on the main .sidebar */
    flex-grow: 1; /* This makes the content fill the available space */
}

.sidebar.collapsed .sidebar-content {
    display: none; /* Hide content when collapsed */
}

.content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: margin-left 0.3s ease-in-out;
}

.content-area {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: auto; /* Permitir el desplazamiento horizontal si es necesario */
    padding: 1rem;
    border: 2px solid var(--section-border-color);
    border-radius: 8px;
    margin: 1rem;
    background-color: var(--bg-color);
    transition: border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* --- Página de Inicio --- */
.home-page-layout {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
    padding: 2rem;
}

.content-column {
    flex: 1;
    max-width: 30%;
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.content-column h2 {
    font-size: 1.4rem;
    color: var(--primary-text-color);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
}

.content-list {
    list-style: none;
    padding: 0;
    max-height: 60vh; /* Adjust height as needed */
    overflow-y: auto;
}

.content-list-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.content-list-item:hover {
    background-color: var(--accent-color);
    color: rgb(235, 121, 121);
    transform: translateX(5px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.content-list-item.current-parasha {
    border: 2px solid var(--accent-color);
    font-weight: bold;
}

/* Desktop view: persistent sidebar */
@media (min-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .content-wrapper {
        margin-left: 0;
        transition: margin-left 0.3s ease-in-out;
    }
    body.sidebar-open .content-wrapper {
        margin-left: 280px;
    }
    #sidebar-close-btn {
        display: block; 
    }
}

/* Mobile view: full sidebar slide */
@media (max-width: 991px) {
    .sidebar {
        width: 280px; /* Full width on mobile */
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar.collapsed {
        transform: translateX(-100%); /* Collapsed means hidden on mobile */
    }
    .sidebar-header h3 {
        display: block; /* Always show title on mobile */
    }
    .sidebar-content {
        display: block; /* Always show content on mobile */
    }
    .content-wrapper {
        margin-left: 0; /* No margin on mobile */
    }
    #sidebar-open-btn {
        display: block; /* Show hamburger on mobile */
        background-color: #dde4e9; /* More visible background */
        border: 1px solid #b8c5d0; /* Stronger border */
        border-radius: 4px;
        padding: 0.75rem; /* Bigger padding */
        font-size: 1.8rem; /* Bigger icon */
    }
    #sidebar-close-btn {
        display: block; /* Show close button on mobile */
    }
}

/* --- Top Bar --- */
.top-bar {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 0;
    flex-shrink: 0;
}

.top-bar-header {
    display: flex;
    align-items: center;
    padding: 0.2rem 1rem; /* Reduced padding for a smaller bar */
    cursor: pointer;
}

@media (max-width: 991px) {
    .top-bar-header .top-bar-title,
    .top-bar-header #top-bar-toggle-btn {
        display: none; /* Hide title and toggle button on mobile */
    }
    .top-bar-content {
        max-height: none; /* Always open on mobile */
        overflow: visible;
        padding-top: 0.5rem;
        padding-bottom: 1rem;
    }
}



.top-bar-title {
    font-weight: bold;
    font-size: 0.8rem; /* Smaller font size */
    margin: 0 auto;
    color: #555;
}

#top-bar-toggle-btn {
    transition: transform 0.3s ease;
}

#top-bar-toggle-btn.open {
    transform: rotate(180deg);
}

.top-bar-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.controls-line {
    display: flex;
    flex-wrap: nowrap; /* Keep items on a single line */
    overflow-x: scroll; /* Forzar la barra de desplazamiento horizontal */
    align-items: center;
    gap: 0.5rem; /* Space between controls */
    padding-bottom: 0.5rem; /* Add some padding for scrollbar */
}

.controls-line select,
.controls-line input[type="text"] {
    flex-shrink: 0; /* Prevent items from shrinking */
    min-width: 80px; /* Minimum width for select/input */
    max-width: 180px; /* Max width to prevent overflow */
    padding: 0.3rem 0.5rem; /* Smaller padding */
    font-size: 0.8rem; /* Smaller font size */
    white-space: nowrap; /* Keep text on a single line */
    overflow: hidden; /* Hide overflowing text */
    text-overflow: ellipsis; /* Add ellipsis to overflowing text */
}

.controls-line .chapter-nav {
    display: flex;
    align-items: center;
    gap: 0.2rem; /* Smaller gap for chapter navigation buttons */
}

.controls-line .chapter-nav button {
    padding: 0.2rem 0.4rem; /* Even smaller buttons */
    font-size: 0.7rem;
}

/* General select and input styles, adjusted for compactness */
select, input[type="text"], button {
    padding: 0.4rem 0.6rem; /* Slightly reduced padding */
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem; /* Slightly reduced font size */
    font-family: inherit;
}

.top-bar-content.open {
    max-height: 500px;
    padding-top: 0.5rem;
    padding-bottom: 1rem;
}

.icon-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

/* --- Main Navigation (in Sidebar) --- */
.nav-item-group {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    margin-bottom: 5px; /* Add margin between button groups */
}

.nav-item-sub {
    flex-grow: 1;
    text-align: center;
    padding: 0.8rem 0.2rem; /* Increased padding for a larger click area */
    font-size: 0.9rem; /* Increased font size */
    text-decoration: none;
    color: #FFFFFF; /* White text for high contrast */
    border: 1px solid #555;
    transition: all 0.3s ease;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7); /* Text shadow for readability */
}

.nav-item-sub:hover { 
    transform: scale(1.05); /* Slight zoom on hover */
    filter: brightness(1.1); /* Brighten on hover */
}

.nav-item-sub.active {
    transform: scale(1.05);
    border-width: 2px;
    border-color: #fff; /* White border for active state */
    box-shadow: 0 0 20px rgba(255, 255, 255, 1); /* Even more pronounced glow effect */
    filter: brightness(1.5); /* Significantly brighter background */
    border-bottom: 4px solid var(--primary-color); /* Stronger bottom border */
}

/* Group 1 Colors */
.nav-item-sub[data-tab-id="home"] { background-color: #00796B; } /* Teal */
.nav-item-sub[data-tab-id="calendar"] { background-color: #5E35B1; } /* Deep Purple */
.nav-item-sub[data-tab-id="search"] { background-color: #D84315; } /* Deep Orange */

/* Standalone Button Color */
.nav-item-sub[data-tab-id="text"] { background-color: #1565C0; } /* Blue */

/* Group 2 Colors */
.nav-item-sub[data-tab-id="tikkun"] { background-color: #C2185B; } /* Pink */
.nav-item-sub[data-tab-id="info"] { background-color: #6A1B9A; } /* Purple */
.nav-item-sub[data-tab-id="vista"] { background-color: #283593; } /* Indigo */

#tab-content-vista {
    flex-grow: 1; 
    padding: 0;
    height: 100%;
}

#tab-content-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* --- Tab Content --- */
.tab-content {
    display: none;
    width: 100%;
    margin: 0 auto; /* Center content within content-area */
    padding: 1rem;
    overflow-x: auto; /* Permitir el desplazamiento horizontal si es necesario */
}
.tab-content.active {
    display: block;
    flex-grow: 1;
}

#tab-content-info {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* --- Section Specific Colors --- */
body[data-active-tab="home"] { --section-bg-color: #e0f7fa; --section-text-color: #006064; --section-border-color: #00bcd4; }
body[data-active-tab="text"] { --section-bg-color: #e8f5e9; --section-text-color: #333; --section-border-color: #4caf50; }
body[data-active-tab="tikkun"] { --section-bg-color: #fff3e0; --section-text-color: #333; --section-border-color: #ff9800; }
body[data-active-tab="info"] { --section-bg-color: #ede7f6; --section-text-color: #333; --section-border-color: #673ab7; }
body[data-active-tab="search"] { --section-bg-color: #ffebee; --section-text-color: #c62828; --section-border-color: #f44336; }
body[data-active-tab="calendar"] { --section-bg-color: #f3e5f5; --section-text-color: #6a1b9a; --section-border-color: #9c27b0; }

/* --- Controls --- */
.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.control-group label {
    font-weight: bold;
    white-space: nowrap;
}
select, input[type="text"], button {
    padding: 0.5rem 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
}
button {
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
button:hover {
    background-color: var(--primary-hover);
}

/* --- Sidebar Tools --- */
.tool-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}
.tool-section:last-child {
    border-bottom: none;
}
.tool-section h3 {
    margin-top: 0;
    margin-bottom: 0.8rem;
    color: #555;
    font-size: 1rem;
}
.sidebar-button {
    display: block;
    width: 100%;
    margin-bottom: 0.5rem;
    text-align: left;
}

/* --- Text Display --- */
#text-display h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}
.language-block {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
    width: 100%;
    overflow-x: auto;
}
.verse-line {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 0; /* Removed extra space */
    padding-bottom: 0; /* Removed extra space */
    border-bottom: none; /* Removed border */
}
.verse-number {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    font-size: 0.8em;
    flex-shrink: 0;
}
.lang-text {
    flex-grow: 1;
    /* Responsive font size: min 16px, preferred 4vw, max 22px */
    font-size: clamp(1rem, 4vw, 1.375rem);
    line-height: 1.6; /* Use a relative line-height */
    word-wrap: break-word; /* Ensure text wraps */
    overflow-wrap: break-word; /* Ensure text wraps */
}

.lang-hebreo_con_nikud, .lang-hebreo_sin_nikud {
    text-align: right;
    direction: rtl;
    /* Responsive font size: min 19.2px, preferred 5vw, max 26.84px */
    font-size: clamp(1.2rem, 5vw, 1.6775rem);
    line-height: 1.6; /* Use a relative line-height */
}

/* --- Calendar --- */
.calendar-container {
    max-width: 900px;
    margin: 1rem auto;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 100%;
}
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    margin-bottom: 10px;
}
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}
.calendar-day {
    border: 1px solid #eee;
    padding: 0.5rem;
    min-height: 100px;
    font-size: 0.85rem;
    text-align: left;
}
.calendar-day.today {
    background-color: #e6f7ff;
}
.gregorian-date { font-weight: bold; }
.hebrew-date { font-size: 0.8em; color: #666; }
.holiday, .parasha { font-size: 0.85em; margin-top: 5px; }
.holiday { color: #d32f2f; font-weight: bold; cursor: pointer; }
.parasha { color: #1976d2; cursor: pointer; }

/* --- Search --- */
.search-controls-container {
    background-color: #ffffff;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    width: 100%;
}
.search-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

/* --- Tikkun --- */
.tikkun-controls {
    margin-bottom: 1rem;
}

.form-check-label {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 0.5rem;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
}

.form-check-label.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

#tikkun-table {
    width: 100%;
}

.col-hidden {
    display: none;
}

.verse-tnumber {
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 0.8em;
}

.tikkun-container {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: #ffffff;
    padding: 1rem;
    border-radius: 8px;
    width: 100%;
}
@media (min-width: 768px) {
    .tikkun-container {
        flex-direction: row;
    }
}
.tikkun-column {
    flex: 1;
    border: 1px solid var(--border-color);
    padding: 1rem;
    overflow-y: auto;
}

/* --- Modals --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1002;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}
.modal.show {
    display: flex;
}
.modal-content {
    background-color: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
}
.close-button {
    float: right;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
}

/* --- Themes --- */
body.dark-theme {
    --text-color: #e0e0e0;
    --bg-color: #1e1e1e;
    --border-color: #333;
    --header-bg: #2c2c2c;
    --sidebar-bg: #2c2c2c;
}
body.sepia-theme {
    --text-color: #5b4636;
    --bg-color: #f4f1ea;
    --border-color: #dcd6c9;
    --header-bg: #e9e4d9;
    --sidebar-bg: #e9e4d9;
}

/* Large screens: Horizontal tab bar */
@media (min-width: 768px) {
    .tab-bar {
        flex-direction: row;
        justify-content: flex-start; /* Align tabs to the start */
        padding: 5px 10px; /* Adjust padding for horizontal layout */
        border-bottom: none; /* Remove bottom border if it's not needed */
    }

    .tab-bar button {
        margin-right: 10px; /* Space between horizontal tabs */
        margin-bottom: 0; /* Remove bottom margin from vertical layout */
    }
}

/* Verse rendering: No extra line space */
#text-display p {
    margin-bottom: 0; /* Remove default paragraph margin */
    line-height: 1.4; /* Adjust line height for readability, or remove if not needed */
}







@media (min-width: 992px) {
    .top-bar-header {
        cursor: default; /* No pointer on large screens */
    }
    .top-bar-title,
    #top-bar-toggle-btn {
        display: none; /* Hide title and toggle button on large screens */
    }
    .top-bar-content {
        max-height: none; /* Always open on large screens */
        overflow: visible;
        padding-top: 0.5rem;
        padding-bottom: 1rem;
    }
}

/* --- Utility & Other --- */
.hidden {
    display: none;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
}
.sidebar-overlay.active {
    display: block;
}

/* Cursor pointers for interactive elements */
.parasha-link, .fiesta-link,
.bookmark-icon, .note-icon,
.delete-item-btn,
.sidebar-button,
.control-group button,
.radio-group label,
.language-checkboxes label,
.switch-label,
.clickable-history-item, .clickable-bookmark-item, .clickable-note-item, .clickable-search-result {
    cursor: pointer;
}



/* Horizontal Navigation Container */
.horizontal-nav-container {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 0.5rem 1rem;
    display: block; /* Ensure it's displayed by default */
}

.horizontal-nav-container .main-nav {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0;
    border-bottom: none;
}

.horizontal-nav-container .main-nav::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome, Safari, and Opera */
}

.horizontal-nav-container .nav-item-sub {
    flex-grow: 1;
    text-align: center;
    padding: 0.6rem 0.2rem;
    font-size: 0.8rem;
    text-decoration: none;
    color: #FFFFFF;
    border: 1px solid #555;
    transition: all 0.3s ease;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7); /* Text shadow for readability */
}

@media (max-width: 991px) {
    .horizontal-nav-container .nav-item-sub {
        padding: 0.2rem 0.05rem; /* Even smaller padding for mobile */
        font-size: 0.55rem; /* Even smaller font size for mobile */
    }
}

.horizontal-nav-container .nav-item-sub:hover {
    transform: scale(1.05); /* Slight zoom on hover */
    filter: brightness(1.1); /* Brighten on hover */
}

.horizontal-nav-container .nav-item-sub.active {
    transform: scale(1.05);
    border-width: 2px;
    border-color: #fff; /* White border for active state */
    box-shadow: 0 0 20px rgba(255, 255, 255, 1); /* Even more pronounced glow effect */
    filter: brightness(1.5); /* Significantly brighter background */
    border-bottom: 4px solid var(--primary-color); /* Stronger bottom border */
}

/* Group 1 Colors */
.horizontal-nav-container .nav-item-sub[data-tab-id="home"] { background-color: #00796B; } /* Teal */
.horizontal-nav-container .nav-item-sub[data-tab-id="calendar"] { background-color: #5E35B1; } /* Deep Purple */
.horizontal-nav-container .nav-item-sub[data-tab-id="search"] { background-color: #D84315; } /* Deep Orange */

/* Standalone Button Color */
.horizontal-nav-container .nav-item-sub[data-tab-id="text"] { background-color: #1565C0; } /* Blue */

/* Group 2 Colors */
.horizontal-nav-container .nav-item-sub[data-tab-id="tikkun"] { background-color: #C2185B; } /* Pink */
.horizontal-nav-container .nav-item-sub[data-tab-id="info"] { background-color: #6A1B9A; } /* Purple */
.horizontal-nav-container .nav-item-sub[data-tab-id="vista"] { background-color: #283593; } /* Indigo */

/* Hide sidebar navigation on large screens */
@media (min-width: 992px) {
    .sidebar .main-nav {
        display: none;
    }
}

/* Custom button styles */
#prev-chapter-btn,
#next-chapter-btn,
#sidebar-open-btn,
#sidebar-close-btn {
    background-color: #007bff;
    color: white !important; /* Use important to override existing styles if necessary */
    border-radius: 4px;
    padding: 0.5rem;
    border: 1px solid #0056b3;
    transition: background-color 0.2s ease;
}

#prev-chapter-btn:hover,
#next-chapter-btn:hover,
#sidebar-open-btn:hover,
#sidebar-close-btn:hover {
    background-color: #0056b3;
}

/* Ensure mobile styles are also applied */
@media (max-width: 991px) {
    #sidebar-open-btn {
        padding: 0.3rem; /* Smaller padding */
        font-size: 1.2rem; /* Smaller font size */
    }
}

#text-display .lang-text {
    color: #000000 !important;
}



/* Class to hide columns */
.col-hidden {
    display: none;
}

.tikkun-verse-num {
    width: 80px;
    max-width: 80px;
}

@media (max-width: 767px) {
    .controls-line {
        gap: 0.3rem; /* Reduce gap between controls */
    }

    .controls-line select,
    .controls-line input[type="text"] {
        min-width: 60px; /* Reduce min-width */
        max-width: 120px; /* Reduce max-width */
        padding: 0.2rem 0.4rem; /* Reduce padding */
        font-size: 0.7rem; /* Reduce font size */
    }

    .controls-line .chapter-nav button {
        padding: 0.1rem 0.3rem; /* Further reduce button padding */
        font-size: 0.6rem; /* Further reduce button font size */
    }

    .controls-line .chapter-range-input {
        max-width: 100px; /* Specifically target the range input */
    }
}

@media (max-width: 767px) {
    #tab-content-vista table,
    #tab-content-calendar .calendar-container {
        min-width: 0; /* Remove the min-width on smaller screens */
    }

    #tab-content-vista table td,
    #tab-content-vista table th {
        white-space: normal; /* Allow text to wrap */
        word-break: break-word; /* Break words only when necessary */
        font-size: 0.8rem; /* Reduce font size */
    }

    .calendar-day {
        min-height: 80px; /* Reduce min-height */
        font-size: 0.7rem; /* Reduce font size */
    }
}

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

@media (max-width: 991px) {
    .home-page-layout {
        flex-direction: column !important; /* Forzar el apilamiento vertical */
        gap: 1rem;
        padding: 1rem;
    }

    .content-column {
        max-width: 100%;
    }
}

.sidebar-toggle-btn {
    position: absolute;
    top: 15px;
    left: 100%;
    z-index: 1000;
    background: var(--header-bg);
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 5px 5px 0;
    padding: 10px 8px;
    cursor: pointer;
    transition: left 0.3s ease-in-out;
}

.sidebar.open .sidebar-toggle-btn {
    left: 100%;
}
#verse-of-the-day-container {
    padding: 20px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin: 20px;
}

#verse-of-the-day-container .verse-title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
}

#verse-of-the-day-container .verse-text {
    font-size: 1.1em;
    margin-bottom: 10px;
}

#verse-of-the-day-container .verse-ref {
    font-style: italic;
}
@media (max-width: 480px) {
    .controls-line {
        gap: 0.2rem;
    }

    .controls-line select,
    .controls-line input[type="text"] {
        min-width: 50px;
        max-width: 90px;
        font-size: 0.6rem;
    }

    .horizontal-nav-container .nav-item-sub {
        font-size: 0.45rem;
        padding: 0.2rem 0.02rem;
    }

    .content-area {
        padding: 0.5rem;
        margin: 0.5rem;
    }
}