/* =========================================
   1. VARIABLES Y CONFIGURACIÓN GLOBAL
   ========================================= */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
    scroll-padding-top: 72px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 60px;
    font-family: 'Montserrat', sans-serif;
}

h1, h2, h3, h4, h5, h6, .monse {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

.page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* Focus global para accesibilidad */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* =========================================
   2. CONTENEDORES PRINCIPALES (Responsivos)
   ========================================= */
.home-container, .form-container {
    background: #F2F2F2;
    padding: 0;
    margin: 20px auto;
    width: 95%; /* Margen lateral del 2.5% en móviles */
    max-width: 410px; /* Tamaño ideal unificado */
    box-shadow: 0px 10px 15px rgba(50, 50, 50, 0.2);  
    overflow: visible;
}

/* Ajuste para formularios específicos que requieren padding interno */
.form-container {
    padding: 20px;
    border-radius: 10px;
}

@media (min-width: 720px) {
    .home-container, .form-container, .chart-container {
        width: fit-content;
        max-width: none;
        min-width: 410px;
    }
}

/* =========================================
   3. TIPOGRAFÍA Y SEPARADORES
   ========================================= */
.headers {
    text-align: left;
    font-size: 20px;
    font-weight: normal;
    color: #A3832F;
    margin: 8px 0;
}

.subheader {
    font-size: 15px;
    color: #091828;
    margin: 1px 0;
}

.divider {
    width: 100%;
    border: 1.5px solid #CDA434;
    margin: 20px 0;
}

/* Estrechar margen entre header y su divider */
.headers + .divider,
.headers-divider-container .divider {
    margin-top: 0px;
    margin-bottom: 20px;
}

.subheader-divider {
    width: 75%;
    border: 0.5px solid #0c2138;
    margin: 0 0 10px 0;
}

.mini-div {
    border: 0.5px solid #bec2c6;
    margin-bottom: 10px;
}

/* =========================================
   4. BOTONES CUSTOM
   ========================================= */
.button-div {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.custom-button {
    width: 100%;
    max-width: 200px;
    height: 38px;
    margin: auto;
    font-size: 16px;
    border: 2px solid;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .custom-button:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* Variantes de botones */
.goldenButton {
    color: #CDA434;
    border-color: #CDA434;
    background: #F2F2F2;
}

    .goldenButton:hover:not(:disabled) {
        background: #CDA434;
        color: #F2F2F2;
    }

.redButton {
    color: #c9303b;
    border-color: #c9303b;
    background: #F2F2F2;
}

    .redButton:hover:not(:disabled) {
        background: #c9303b;
        color: #F2F2F2;
    }

.blueButton {
    color: #091828;
    border-color: #091828;
    background: #F2F2F2;
}

    .blueButton:hover:not(:disabled) {
        background: #091828;
        color: #F2F2F2;
    }

.whiteButton {
    color: #FFF;
    border-color: #FFF;
    background: transparent;
}

    .whiteButton:hover:not(:disabled) {
        background: rgba(255,255,255,0.3);
    }

.button-table-div {
    margin-top: 0 !important;
    padding: 10px !important;
}

.table-button {
    height: 31px;
}
/* =========================================
   5. FORMULARIOS E INPUTS
   ========================================= */
.form-input {
    background: #F2F2F2;
    border: 2px solid #091828;
    border-radius: 8px;
    width: 100%;
    height: 38px;
    padding: 5px 10px;
    margin-bottom: 10px;
    box-shadow: 0px 2px 5px rgba(0,0,0,0.1);
    font-family: 'Montserrat', sans-serif;
    box-sizing: border-box;
}

    .form-input:focus {
        border-color: #CDA434;
        outline: none;
    }

input[type="time"].form-input {
    padding: 0 10px;
    align-items: center;
}

.field-validation-error {
    color: #dc3545;
    font-size: 0.875em;
    margin: -5px 0 10px 5px;
    display: block;
}

/* =========================================
   6. TABLAS RESPONSIVAS
   ========================================= */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

    .table th, .table td {
        padding: 12px 8px;
        text-align: left;
    }

    .table tbody tr:hover td {
        background-color: #f5f5f5;
        cursor: pointer;
    }

    .table tr.selected td {
        background-color: #7B7B7B !important;
        color: #FFF !important;
    }

.number-cell {
    text-align: center;
    font-family: monospace;
}

/* =========================================
   7. LOADER / OVERLAY
   ========================================= */
#loader-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.loader {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* =========================================
   8. ANULACIÓN DE BOOTSTRAP
   ========================================= */
.container {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
}

main.pb-3 {
    padding-bottom: 0 !important;
}

.schedule-separator {
    padding: 0 6px;
}

@media (max-width: 400px) {
    .carousel-container {
        margin: 0 31px !important;
    }

    .schedule-separator {
        display: block;
        height: 0;
        padding: 0;
        color: transparent;
    }

    .schedule {
        text-align: right;
        line-height: 1.4;
    }
    .schedule-list .divider {
        margin: 5px 0 !important;
    }

    #image-preview{
        margin-left: 0px !important;
    }
}

@media (max-width: 330px) {
    .carousel-container{
        margin: 0 8px !important;
    }

    .schedule-separator {
        display: block;
        height: 0;
        padding: 0;
        color: transparent;
    }
    .schedule-list .divider {
        margin: 5px 0 !important;
    }

    .schedule {
        text-align: right;
        line-height: 1.4;
    }

    .foto-flex {
        flex-direction: column !important;
        align-items: center !important;
    }
}