/* Estilos Generales */
:root {
  --primary: #008000;
  --secondary: #007200;
  --accent: #2196f3;
  --light: #f8f9fa;
  --dark: #212529;
  --success: #4caf50;
  --warning: #ff9800;
  --danger: #f44336;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { 
  scroll-behavior: smooth; 
  font-size: 16px;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  background-color: #f0f4f8;
  color: #333;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  color: var(--primary);
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
}

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Barra Lateral */
.sidebar {
  width: 300px;
  background: var(--primary);
  color: white;
  height: 100vh;
  position: fixed;
  padding: 20px;
  overflow-y: auto;
  box-shadow: 3px 0 10px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
  z-index: 1000;
}

.sidebar h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 15px 15px 40px; /* Ajuste aquí */
  border-bottom: 1px solid rgba(255,255,255,0.1);
  position: relative;
}

/* Desktop: eliminar espacio del ícono */
@media (min-width: 993px) {
  .sidebar h2 {
    padding-left: 15px; /* Elimina el espacio extra */
  }
}

/* Mobile: mantener espacio para el botón */
@media (max-width: 992px) {
  .sidebar.active .close-toggle {
    display: flex;
    left: 15px;
  }
}

/* Botones del Menú Toggle */
.menu-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  position: fixed;
  z-index: 1100;
  width: 40px;
  height: 40px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.mobile-toggle {
  top: 20px;
  left: 20px;
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  display: none;
}

.close-toggle {
  top: 15px;
  left: 15px;
  right: auto;
  color: white;
  display: none;
  position: absolute;
  background: rgba(255,255,255,0.2);
  z-index: 1101;
}


.menu-toggle:hover {
  background: rgba(0,0,0,0.1);
}

/* Enlaces y Dropdowns */
.sidebar a {
  color: white;
  text-decoration: none;
  padding: 10px 15px;
  margin: 5px 0;
  border-radius: 5px;
  display: block;
  transition: all 0.3s;
  font-size: 0.95rem;
  position: relative;
}

.sidebar a:hover { 
  background: rgba(255,255,255,0.15); 
  transform: translateX(5px);
}

.sidebar a.active { 
  background: var(--secondary); 
  font-weight: 600;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.sidebar a i {
  width: 24px;
  text-align: center;
}

.dropdown { 
  margin-left: 15px; 
  position: relative;
}

.dropdown-content { 
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding-left: 15px;
  border-left: 1px solid rgba(255,255,255,0.1);
  margin: 5px 0;
}

.dropdown.open .dropdown-content { 
  max-height: 2000px; 
}

.toggle { 
  cursor: pointer; 
  padding: 10px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-size: 0.95rem;
  transition: all 0.3s;
}

.toggle:hover {
  color: #aad3ff;
}

.toggle::after {
  content: '\f107';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  margin-left: auto;
  transition: transform 0.3s;
  font-size: 0.9rem;
}

.dropdown.open .toggle::after {
  transform: rotate(180deg);
}

/* Contenido Principal */
.content {
  margin-left: 320px;
  padding: 30px;
  width: calc(100% - 320px);
  min-width: calc(100% - 320px); /* Asegura que siempre ocupe al menos el ancho disponible */
  max-width: none; /* Elimina el límite máximo */
  transition: margin-left 0.3s;
  box-sizing: border-box; /* Incluye el padding en el cálculo del ancho */
  word-wrap: break-word; /* Permite que el texto largo se ajuste */
  overflow-wrap: break-word; /* Alternativa moderna para word-wrap */
}

.content-section {
  display: none;
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.08);
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.content-section.active-section {
  display: block;
}

/* Barra de búsqueda */
.search-container {
  position: relative;
  margin-bottom: 25px;
  color: #4caf50; /* texto en verde */
}

.search-container input {
  width: 100%;
  padding: 12px 20px 12px 45px;
  border: 1px solid #ddd;
  border-radius: 30px;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: all 0.3s;
}

.search-container input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(33, 150, 243, 0.2);
}

.search-container i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
}

/* Indicadores de Contenido */
.content-warning {
  font-size: 0.9em;
  color: var(--warning);
  margin-left: 10px;
  font-style: italic;
}

.empty-content {
  background: #fff8e1;
  padding: 30px;
  border-radius: 8px;
  text-align: center;
  color: #ff8f00;
  margin: 20px 0;
}

/* Estilos para contenido */
.content-image {
  width: 100%;
  max-width: 800px;
  border-radius: 8px;
  margin: 20px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 1px solid #eee;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 25px 0;
}

.feature {
  padding: 25px;
  background: #f8f9fa;
  border-radius: 10px;
  border-left: 4px solid var(--secondary);
  transition: transform 0.3s, box-shadow 0.3s;
}

.feature:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.feature i {
  font-size: 1.8rem;
  color: var(--secondary);
  margin-bottom: 15px;
  display: inline-block;
}

.feature h3 {
  margin-bottom: 10px;
  color: var(--primary);
}

.tip {
  background: #e3f2fd;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid var(--accent);
  margin: 25px 0;
}

.tip i {
  color: var(--accent);
  margin-right: 10px;
}

.step {
  counter-increment: step-counter;
  margin-bottom: 20px;
  padding-left: 40px;
  position: relative;
}

.step::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  background: var(--secondary);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s;
  text-decoration: none;
}

.btn:hover {
  background: #0d8aee;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
  margin-bottom: 25px;
}

.section-header i {
  font-size: 1.8rem;
  color: var(--secondary);
}

/* Resultados de búsqueda */
.search-results {
  background: white;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  padding: 15px;
  margin-top: 10px;
  display: none;
  position: absolute;
  width: 100%;
  z-index: 100;
  max-height: 300px;
  overflow-y: auto;
}

.search-results.active {
  display: block;
}

.result-item {
  padding: 10px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.result-item:last-child {
  border-bottom: none;
}

.result-item:hover {
  background: #f5f9ff;
}

.result-highlight {
  background: #fff9c4;
  padding: 0 3px;
  font-weight: 600;
}

.section-badge {
  background: var(--secondary);
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-left: 10px;
  font-weight: normal;
}

.fake-image {
  background: linear-gradient(45deg, #386641, #2d3e50);
  height: 200px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  margin: 20px 0;
}

.table-responsive {
  overflow-x: auto;
  margin: 20px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: #f8f9fa;
  font-weight: 600;
}

tr:hover {
  background-color: #f5f9ff;
}

.button-example {
  display: inline-block;
  padding: 8px 15px;
  margin: 5px;
  border-radius: 4px;
  background: #e0e0e0;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .content {
    margin-left: 0;
    width: 100%;
    padding: 20px;
  }
  
  .mobile-toggle {
    display: flex !important;
  }
  
  .sidebar.active .close-toggle {
    display: flex;
  }
  
  body.sidebar-active {
    overflow: hidden;
  }
  
  body.sidebar-active .mobile-toggle {
    display: none !important;
  }
}

@media (min-width: 993px) {
  .menu-toggle {
    display: none !important;
  }
}






/* Contenedor del Lightbox (ahora usa position: absolute) */
.lightbox {
  display: none;
  position: absolute; /* Cambiado de fixed a absolute */
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100vh; /* Asegura que cubra toda la altura visible */
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px 0; /* Espacio para evitar cortes al hacer scroll */
}

/* Imagen dentro del Lightbox (ajustes para scroll) */
.lightbox-img {
  max-width: 80%;
  max-height: 80vh; /* Limita la altura al viewport */
  object-fit: contain; /* Evita distorsión */
  margin: 20px 0; /* Espacio vertical */
}

/* Botón de cerrar (se mueve con el scroll) */
.close-btn {
  position: fixed; /* Fijo en la ventana, no en el lightbox */
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  cursor: pointer;
}

.close-btn:hover {
  color: #ccc;
}

/* Animación de zoom al abrir */
@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Animación de zoom al cerrar */
@keyframes zoomOut {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(0.8); opacity: 0; }
}




.steps-container {
  counter-reset: step-counter;
}

.step {
  counter-increment: step-counter;
}

.step::before {
  font-weight: bold;
}