/* public/css/style.css */

body {
    display: flex;
    background-color: #f8f9fa;
}

.sidebar {
    width: 250px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: -250px; /* Por defecto, el menú está oculto fuera de la pantalla */
    background-color: #0d6efd;
    padding-top: 1rem;
    z-index: 1030; /* Un z-index alto para que se muestre por encima de todo */
    transition: left 0.3s ease-in-out; /* Animación suave para aparecer/desaparecer */
}

/* Clase que se añade con JavaScript para MOSTRAR el menú en móviles */
.sidebar.active {
    left: 0;
}

.sidebar .navbar-brand {
    color: #fff;
    margin-bottom: 1.5rem;
    padding: 0 1.5rem;
    font-size: 1.5rem;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: #0b5ed7;
}

.sidebar .nav-link.active {
    color: #fff;
    font-weight: bold;
    background-color: #0a58ca;
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
}

.main-content {
    margin-left: 0; /* En móviles, el contenido ocupa todo el ancho */
    width: 100%;
    padding: 1rem;
    transition: margin-left 0.3s ease-in-out;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
    margin-bottom: 1.5rem;
}

#sidebar-toggle {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    color: #0d6efd;
}

.btn-logout {
    color: #6c757d;
    text-decoration: none;
}

/* Overlay para oscurecer el fondo en modo móvil */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1029;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* Media Query: Reglas para pantallas grandes (desktops, a partir de 992px) */
@media (min-width: 992px) {
    .sidebar {
        left: 0; /* En escritorio, el menú siempre está visible */
    }
    
    .main-content {
        margin-left: 250px; /* Empuja el contenido para dejar espacio al menú */
    }

    #sidebar-toggle {
        display: none; /* Oculta el botón hamburguesa en escritorio */
    }

    .sidebar-overlay {
        display: none !important; /* Nunca muestra el overlay en escritorio */
    }
}