/* Variables de color y tipografía */
:root {
  --primary: #afe607;
  --accent: #00D4FF;
  --bg: #F4F7FA;
  --white: #ffffff;
  --shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: #1F1F1F;
}


.dashboard-section {
  max-width: 1250px;
  margin: 3rem auto 5rem;
  background: var(--white);
  border-radius: 30px;
  box-shadow: rgba(0, 82, 180, 0.1) 0px 0px 3.75rem 0px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dashboard-header {
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: white;
}

.dashboard-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.dashboard-body {
  display: flex;
  flex-direction: row;
  min-height: 400px;
}

.dashboard-sidebar {
  background-color: #f1f5f9;
  padding: 2rem 1rem;
  width: 220px;
  border-right: 1px solid #e0e6ed;
}

.sidebar-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: none;
  border: none;
  border-radius: 8px;
  width: 100%;
  cursor: pointer;
  font-weight: 500;
  transition: 0.3s ease;
}

.sidebar-button i {
  font-size: 1.2rem;
  color: var(--primary);
}

.sidebar-button.active, .sidebar-button:hover {
  background:#121a2d;
  color: white;
}

.sidebar-button.active i,
.sidebar-button:hover i {
  color: white;
}

.dashboard-content {
  flex: 1;
  padding: 3rem;
  display: none;
}

.dashboard-content.active {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.resource-card {
  background: var(--white);
  border: 1px solid #e0e6ed;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.resource-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.resource-card .info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.info button {
  background: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s;
}

.info button:hover {
  background: var(--accent);
}
  
.resource-card {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.resource-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.08); 
}

.resource-link {
  background: var(--primary);
  color: var(--color-texto-black);
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: background 0.3s ease;
}

.resource-link:hover {
  background: var(--black);
  color: var(--primary);
}
    
   /* === Estilos responsivos mejorados === */
@media (max-width: 1024px) {
  .dashboard-section {
    margin: 0rem 2rem 3rem;
    border-radius: 8px;
  }
  
  .dashboard-header {
    padding: 1rem 1.5rem;
  }
  
  .dashboard-sidebar {
    width: 180px;
    padding: 1.5rem 0.5rem;
    box-sizing: border-box;
  }

  .dashboard-content.active {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

/* --------------------------------------------- */
/* Breakpoint: 768px (Tablets)                  */
/* --------------------------------------------- */
@media (max-width: 768px) {
  .dashboard-body {
    flex-direction: column;
  }

  .dashboard-sidebar {
    width: 100%;
    padding: 1rem !important;
    border-right: none;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
    background-color: #f8fafc;
  }

  .dashboard-content {
    padding: 1.5rem !important;
  }
  
  .dashboard-content.active {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
  }

  .resource-card {
    margin-bottom: 0;
  }
  
  /* Área táctil ampliada para botones */
  .sidebar-button,
  .resource-link {
    touch-action: manipulation;
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

/* Efectos de interacción */
  .sidebar-button:active,
  .resource-link:active {
    transform: scale(0.98);
  }

}

/* --------------------------------------------- */
/* Breakpoint: 576px (Móviles grandes)          */
/* --------------------------------------------- */
@media (max-width: 576px) {
  .dashboard-header {
    padding: 0.8rem 1rem !important;
  }
  
  .dashboard-header h2 {
    font-size: 1.25rem;
  }

  .dashboard-sidebar {
    padding: 0.8rem !important;
    gap: 0.4rem;
  }

  .sidebar-button {
    flex: 1 1 calc(33% - 4px);
    padding: 0.6rem 0.3rem !important;
    font-size: 0.8rem;
    min-height: 40px;
  }

  .sidebar-button i {
    font-size: 0.9rem;
    margin-right: 0.2rem;
  }

  .dashboard-content {
    padding: 1rem !important;
  }
  
  .resource-card {
    border-radius: 8px;
  }
  
  .info h4 {
    font-size: 0.95rem;
  }
  
  .resource-link {
    padding: 0.5rem !important;
    font-size: 0.85rem;
  }
  
  .sidebar-button {
    margin-bottom: 0rem;
  }
  
}

/* --------------------------------------------- */
/* Breakpoint: 480px (Móviles medianos)         */
/* --------------------------------------------- */
@media (max-width: 480px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.8rem !important;
  }
  
  .dashboard-header h2 {
    font-size: 1rem;
  }

  .dashboard-sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 0.8rem 0.5rem !important;
  }

  .dashboard-content.active {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .resource-link {
    font-size: 0.82rem;
  }
  
  .section-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
    margin-top: 5rem;
  }
  
 .dashboard-section {
    margin: 2rem 1rem 2rem;
  }
  
 .section-header {
    margin-top: 2rem!important;
  }
}

/* --------------------------------------------- */
/* Breakpoint: 360px (Móviles pequeños)         */
/* --------------------------------------------- */
@media (max-width: 360px) {
  .sidebar-button {
    font-size: 0.75rem;
    padding: 0.5rem 0.2rem !important;
    min-height: 36px;
  }

  .sidebar-button i {
    margin-right: 0.1rem;
  }

  .dashboard-content {
    padding: 0.8rem !important;
  }
  
  .info h4 {
    font-size: 0.9rem;
  }
  
  .resource-link {
    font-size: 0.8rem;
  }
}

/* ============================================= */
/* MEJORAS ESPECÍFICAS PARA MÓVILES             */
/* ============================================= */

/* Asegura padding consistente en todos los lados */
  .dashboard-section {
    overflow-x: hidden;
}

  .dashboard-sidebar {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Feedback visual para botones activos */
  .sidebar-button.active {
    position: relative;
}

  .sidebar-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: white;
    border-radius: 3px 3px 0 0;
}

/* Corrección para el menú en modo móvil */
@media (max-width: 768px) {
  .dashboard-sidebar::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(to right, transparent, #e0e6ed, transparent);
  }
  
  .section-header h1 {
    font-size: 1.8rem;
  }
  
  .section-header p {
    font-size: 1rem;
  }
  
}

/* Ajuste fino para el grid en diferentes tamaños */
@media (min-width: 481px) and (max-width: 768px) {
  .dashboard-content.active {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* Efecto de carga para mejor percepción de performance */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.dashboard-content {
  animation: fadeIn 0.3s ease-out;
}

/* Estilos para el título y subtítulo */
.section-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 0 1rem;
  margin-top: 5rem;
}

.section-header h1 {
  font-size: 2.2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.section-header p {
  font-size: 1.1rem;
  color: #555;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.5;
}
