html, body {
    height: 100%;
}

/* --------------------------------- */
/* Layout Principal de la Aplicación */
/* --------------------------------- */
.page-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

#sidebar {
    width: 280px;
    flex-shrink: 0;
    transition: margin-left 0.3s ease-in-out;
    position: fixed; /* Clave para el layout móvil */
    height: 100%;
    z-index: 1000;
}

#content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    transition: margin-left 0.3s ease-in-out; /* Animación suave */
    margin-left: 280px; /* Deja espacio para el sidebar en escritorio */
}

    #content-wrapper main {
        flex-grow: 1;
        overflow-y: auto;
        padding: 1.5rem;
    }

/* --------------------------------- */
/* Estilos para Vista Móvil (Responsive) */
/* --------------------------------- */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -280px; /* Oculto por defecto en móvil */
    }

    #content-wrapper {
        margin-left: 0; /* El contenido ocupa toda la pantalla */
    }

    /* Cuando el menú está activado en móvil */
    body.sidebar-toggled #sidebar {
        margin-left: 0; /* Muestra el menú */
    }
}


/* --------------------------------- */
/* Estilos para Landing y Autenticación */
/* --------------------------------- */

.landing-hero, .auth-bg {
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: relative;
}

.landing-hero {
    height: 100vh;
    width: 100%;
    color: white;
}

    .landing-hero::before, .auth-bg::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1;
    }

    .landing-hero::before {
        background: rgba(0, 0, 0, 0.5);
    }

.auth-bg::before {
    background-color: rgba(0, 0, 0, 0.4);
}

.landing-content, .auth-container {
    position: relative;
    z-index: 2;
}

.landing-content {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 2.5rem;
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: none;
}

    .auth-card .form-control, .auth-card .form-floating > label, .auth-card .btn-primary {
        padding: 1rem;
        border-radius: 0.5rem;
        font-weight: 600;
    }

/*
---------------------------------
Estilos específicos para la página de Citas
---------------------------------
*/
#calendar {
    background-color: white;
    padding: 1rem; /* Reducido para móviles */
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.legend-color-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 1px solid #ddd;
    margin-right: 8px;
    border-radius: 50%;
    vertical-align: middle;
}

.fc-event {
    cursor: pointer;
    font-size: 0.8em;
    padding: 2px 4px;
}

/* Ajustes responsivos para el calendario en TABLETAS */
@media (max-width: 768px) {
    .fc .fc-toolbar-title {
        font-size: 1.25em;
    }

    .fc-dayGridMonth-button, .fc-timeGridWeek-button {
        display: none;
    }
}

/* Ajustes responsivos para el calendario en MÓVILES (más específico) */
@media (max-width: 576px) {
    /* --- INICIO: LÓGICA DE APILAMIENTO VERTICAL --- */
    .fc .fc-toolbar.fc-header-toolbar {
        display: flex;
        flex-direction: column; /* Apila los elementos verticalmente */
        align-items: center; /* Centra los elementos */
    }

    .fc .fc-toolbar-chunk {
        margin-bottom: 0.75rem; /* Añade espacio entre los grupos apilados */
    }
    /* --- FIN: LÓGICA DE APILAMIENTO VERTICAL --- */

    .fc .fc-toolbar-title {
        font-size: 1.2em; /* Un poco más grande para darle jerarquía */
    }

    .fc .fc-button {
        padding: .25rem .5rem;
        font-size: .8rem;
    }

    .fc .fc-col-header-cell-cushion {
        font-size: 0.8em;
        padding: 2px;
    }
}

@media (min-width: 768px) {
    #calendar {
        padding: 20px; /* Padding original para pantallas más grandes */
    }
}
