/* panel_guardias/assets/css/style.css */

/* =========================================
   1. TIPOGRAFÍA Y VARIABLES GLOBALES
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
  --primary-color: #c60000;
  --sidebar-width-normal: 260px;
  --sidebar-width-collapsed: 80px;
}

body {
  font-family: 'Poppins', sans-serif;
  overflow-x: hidden; /* Evita scroll horizontal general */
}

/* =========================================
   2. ESTILOS DE LOGIN (Glassmorphism)
   ========================================= */
body.login-page {
  min-height: 100vh;
  background: radial-gradient(circle at top, #1a1a1a, #000000);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f1f1f1;
  margin: 0;
}

.login-card {
  background: rgba(30, 30, 30, 0.6);
  backdrop-filter: blur(20px);
  border-radius: 1rem;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.login-card img {
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.6));
}

.login-card input.form-control {
  background: rgba(255,255,255,0.06);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 0.5rem;
  padding: .7rem;
}

.login-card input.form-control:focus {
  background: rgba(255,255,255,0.09);
  outline: none;
  box-shadow: none;
  border-color: rgba(255,255,255,0.12);
}

.btn-login {
  background-color: var(--primary-color);
  border: none;
  color: white;
  font-weight: 600;
  border-radius: 0.6rem;
  padding: .6rem .9rem;
}

.btn-login:hover {
  background-color: #e00000;
}

@media (max-width: 575px) {
  .login-card { padding: 1.6rem; max-width: 340px; }
}

/* =========================================
   3. ESTILOS GENERALES DEL PANEL
   ========================================= */
body[data-bs-theme="dark"] {
  background: #0b0b0b;
  color: #eaeaea;
}

.table-dark th, .table-dark td {
  vertical-align: middle;
}

.container .btn { border-radius: .6rem; }


/* =========================================
   4. SIDEBAR (MENÚ LATERAL)
   ========================================= */

/* --- A. Estructura Principal --- */
.sidebar {
    width: var(--sidebar-width-normal);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Animación fluida */
    overflow-x: hidden;
    flex-shrink: 0;
    z-index: 1000;
}

/* --- B. LOGO RESPONSIVO (LA SOLUCIÓN) --- */
/* El contenedor define el espacio disponible */
.sidebar .logo-container {
    height: 70px; /* Altura fija reservada */
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

/* La imagen se adapta a ese espacio sin deformarse */
.sidebar .img-logo {
    max-height: 100%;   /* No salirse de los 70px */
    max-width: 90%;     /* No tocar los bordes laterales */
    width: auto;
    height: auto;
    object-fit: contain; /* CLAVE: Evita que se aplaste */
    transition: all 0.3s ease;
}

/* --- C. Wrapper del Contenido --- */
#main-wrapper {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    width: 100%;
}


/* =========================================
   5. ESTADO COLAPSADO (Menú "Delgadito")
   ========================================= */
   
/* Cuando el wrapper tiene la clase .sidebar-collapsed */
.sidebar-collapsed .sidebar {
    width: var(--sidebar-width-collapsed) !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
}

/* 1. Ocultar textos con suavidad */
.sidebar-collapsed .sidebar .sidebar-text,
.sidebar-collapsed .sidebar .nav-header {
    display: none !important;
    opacity: 0;
    width: 0;
}

/* 2. Centrar Iconos */
.sidebar-collapsed .sidebar .nav-link {
    text-align: center;
    justify-content: center !important;
    padding: 12px 0;
}

.sidebar-collapsed .sidebar .nav-link i {
    font-size: 1.5rem; /* Iconos un poco más grandes */
    margin-right: 0 !important;
}

/* 3. LOGO PEQUEÑO (FORZADO) */
.sidebar-collapsed .sidebar .logo-container {
    height: 50px !important; /* Reducimos la altura del contenedor */
    padding: 0 !important;
    margin-bottom: 0.5rem !important;
}

.sidebar-collapsed .sidebar .img-logo {
    max-height: 35px !important; /* Forzar altura pequeña */
    max-width: 35px !important;  /* Forzar ancho pequeño */
}

/* 4. Botones Inferiores (SOS / Salir) */
.sidebar-collapsed .sidebar .btn {
    padding: 0.375rem 0;
    justify-content: center !important;
}

.sidebar-collapsed .sidebar .btn i {
    margin: 0 !important;
}


/* =========================================
   6. AJUSTES MÓVILES
   ========================================= */
@media (max-width: 768px) {
    /* En móviles, el sidebar empieza como "flotante" */
    .sidebar {
        position: fixed;
        height: 100%;
        left: 0;
        top: 0;
    }
    
    /* Si COLAPSAMOS en móvil, en realidad lo OCULTAMOS (-100%) */
    .sidebar-collapsed .sidebar {
        left: -100%; 
        width: 0 !important;
        padding: 0 !important;
    }
}