/* public/styles.css */

/* 1. RESETEO Y DISEÑO BASE */
body {
  font-family: Gideon Roman;
  background-color: #f0f2f5;
  margin: 0;
  padding: 0;
  color: #333;
}
button, 
input, 
select, 
textarea, 
.nav-link {
  font-family: 'Gideon Roman', serif; 
  -webkit-font-smoothing: antialiased; 
}

/* El contenedor maestro usa Flexbox para alinear la barra lateral y el contenido */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Estilos para el contenedor de login */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f0f2f5;
}
.login-box {
  width: 100%;
  max-width: 400px;
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  border-top: 6px solid #f7acad;
  text-align: center;
}
.error-message {
  color: #e74c3c;
  background-color: #fde8e8;
  padding: 10px;
  border-radius: 6px;
  display: none;
  margin-bottom: 15px;
  font-size: 14px;
}


/*  Estilos del Guardián de Carga */
.loader-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(255, 255, 255, 0.95); /* Velo blanco semi-transparente */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999; /* Asegura que tape la barra lateral y todo el contenido */
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* El círculo giratorio usando tus colores corporativos */
.loader-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f0f2f5;
  border-top: 5px solid #f78385; /* Tu color salmón intenso */
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader-text {
  margin-top: 20px;
  font-size: 18px;
  color: #2c3e50;
  font-weight: 600;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 2. ESTILOS DE LA BARRA LATERAL (Escritorio) */
.sidebar {
  width: 260px;
  position: fixed;        /* <-- La congela a la izquierda */
  top: 0;
  left: 0;
  height: 100vh;          /* <-- Fuerza a que mida el alto total de la pantalla */
  z-index: 100;           /* <-- Asegura que quede siempre por encima al hacer scroll */
  
  /* Tus estilos originales que se ven espectaculares */
  background-color: #f7acad;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* <-- Empuja el botón de Cerrar Sesión abajo automáticamente */
  padding: 25px 15px;
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
  box-sizing: border-box;
  box-shadow: 2px 2px 2px #888888;
}



.sidebar-brand {
  margin: 15px;
}

.sidebar-nav {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1; /* Hace que el menú ocupe el espacio disponible empujando el footer abajo */
}

/* Los botones de navegación de la barra lateral */
.nav-link {
  background: none;
  border: none;
  color: #ecf0f1;
  text-align: left;
  padding: 12px 15px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.nav-link:hover, .nav-link.active {
  background-color: #f78385;
  color: #ffffff;
  padding-left: 20px; /* Efecto sutil de desplazamiento al pasar el cursor */
}

.sidebar-footer select {
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  background-color: #fdfdfd;
  color: rgb(0, 0, 0);
  border: 1px solid #7f8c8d;
  border-shadow: inset 0 4px 3px rgba(0,0,0,0.1);
}

/* 3. ÁREA DE CONTENIDO PRINCIPAL */
.main-content {
  margin-left: 260px;     /* <-- Empuja todo el contenido a la derecha de la barra */
  padding: 40px;
  width: calc(100% - 260px); /* Resta el ancho de la barra para que no se desarme el ancho total */
  box-sizing: border-box;
  min-height: 100vh;
}

/* SISTEMA SPA: Oculta los paneles que no tengan la clase .active */
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* 4. COMPONENTES: TARJETAS Y FORMULARIOS */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); 
  gap: 20px;
  margin-top: 25px;
}

.card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  border-top: 4px solid #b5b5b5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}


.card-title { font-size: 12px; font-weight: bold; color: #7f8c8d; text-transform: uppercase; }
.card-value { font-size: 24px; font-weight: bold; margin-top: 10px; color: #2c3e50; }

/* Form Step internal system */
.form-step { display: none; }
.form-step.active { display: block; }

.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
input[type="text"], 
input[type="tel"], 
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"], 
textarea, 
select {
  width: 100%; 
  padding: 12px; 
  border: 1px solid #ccc; 
  border-radius: 6px; 
  box-sizing: border-box;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px; /* Espacio para que el texto no tape la flecha */
}
textarea { height: 100px; resize: vertical; }

/* Estiliza la caja contenedora del input file */
input[type="file"] {
  width: 100%;
  padding: 10px;
  background-color: #ffffff;
  border: 1px solid #ccc;
  border-radius: 8px;           /* Tus esquinas redondeadas */
  box-sizing: border-box;
  margin-bottom: 15px;
  font-size: 14px;
}

/* Tunear directamente el botón interno 'Choose File' del navegador */
input[type="file"]::file-selector-button {
  background-color: #f7acad;    /* El rosa de tu marca */
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 15px;
  font-weight: bold;
  transition: background-color 0.2s;
}

/* Efecto hover para el botón interno */
input[type="file"]::file-selector-button:hover {
  background-color: #f59698;
}

.conditional-field {
  display: none; margin-bottom: 10px; border-radius: 4px;
}
.radio-group { display: flex; gap: 20px; margin-top: 5px; }

/* Botones genéricos */
.btn {
  background-color: #f7acad; color: white; border: none; padding: 12px 20px; font-size: 15px;
  font-weight: bold; border-radius: 6px; cursor: pointer; width: 100%; transition: background 0.2s;
}
.btn:hover { background-color: #f78385; }
.btn-secondary { background-color: #95a5a6; }
.btn-secondary:hover { background-color: #7f8c8d; }
.btn-success { background-color: #f7acad; }
.btn-success:hover { background-color: #f78385; }
.step-indicator { display: flex; justify-content: space-between; margin-bottom: 25px; background: #e0e0e0; border-radius: 6px; padding: 6px; }
.step-dot { font-size: 13px; font-weight: bold; color: #7f8c8d; padding: 4px 12px; }
.step-dot.active { background: #f78385; color: white; border-radius: 4px; }
.step-navigation { display: flex; gap: 15px; margin-top: 25px; }
/* Cambia el color del círculo y del puntito interno al seleccionar */
input[type="radio"] {
  accent-color: #f7acad;   /* Reemplaza el azul clásico de Windows por tu rosa corporativo */
  width: 18px;             /* Opcional: Le da un tamaño un poco más cómodo para hacer clic */
  height: 18px;
  cursor: pointer;
  vertical-align: middle;  /* Lo alinea perfectamente a la altura del texto 'Sí' o 'No' */
}

/* ==========================================================================
   5. RESPONSIVE DESIGN (MEDIA QUERIES PARA CELULARES)
   ========================================================================== */
@media (max-width: 768px) {
  /* Modificamos el contenedor maestro para que se apile verticalmente */
  .app-wrapper {
    flex-direction: column;
  }

  /* La barra lateral deja de ser vertical y pasa a ser un menú superior horizontal */
  .sidebar {
    position: static;      /* Resetea la posición fija de escritorio */
    width: 100%;
    height: auto;          /* Altura automática en lugar de 100vh */
    padding: 15px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  }

  /* Centrar el logo y reducir separación vertical con las secciones en móvil */
  .sidebar-brand {
    text-align: center;
    margin: 0 0 5px 0;
  }

  .sidebar-brand img {
    margin: 0 auto !important;
    display: block;
  }

  .sidebar-nav {
    flex-direction: row; /* Elementos uno al lado del otro */
    flex-wrap: wrap;    /* Si no caben, bajan de línea solos */
    margin-top: 8px;    /* Menos separación con el logo */
    margin-bottom: 18px; /* Más separación con el selector de idioma */
    gap: 5px;
    flex-grow: 0;       /* Evita estiramientos innecesarios */
  }

  .nav-link {
    font-size: 13px;
    padding: 8px 12px;
    flex-grow: 1;
    text-align: center; /* Centrado cómodo para pantallas táctiles */
  }

  .nav-link:hover, .nav-link.active {
    padding-left: 12px; /* Evita que se mueva hacia la derecha al hover en mobile */
  }

  .main-content {
    margin-left: 0;        /* Resetea el margen de la barra lateral */
    width: 100%;           /* Ocupa todo el ancho */
    padding: 20px;         /* Reducimos el margen para aprovechar la pantalla pequeña */
  }

  /* Ajusta el dashboard para celulares */
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

/* ==========================================================================
   6. SISTEMA DE TOAST NOTIFICATIONS (POP-UPS ELEGANTES)
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background-color: #2c3e50;
  color: #ffffff;
  padding: 14px 24px;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-left: 5px solid #f7acad; /* Color característico de Pinceladas */
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.toast-success {
  border-left-color: #2ecc71;
}

.toast.toast-error {
  border-left-color: #e74c3c;
}

.toast.toast-warning {
  border-left-color: #f1c40f;
}

.toast.toast-info {
  border-left-color: #3498db;
}