/* styles.css */

/* --- Reset y Estilos Generales --- */

body {
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
  background-color: var(--bg-color);
  color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Contenedor Principal --- */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Encabezado (Header) --- */

header {
    background-color: #1c57b1;
    color: #fff;
    padding: 20px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 100;
    transition: background-color 0.3s ease;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    flex: 0 0 auto;
    margin-right: 20px;
}

.header-logo {
    max-width: 200px;
    height: auto;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
}

nav ul li {
    margin-left: 20px;
}

nav a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    transition: color 0.3s ease, border-bottom 0.3s ease;
    padding: 10px 15px;
    display: inline-block;
}

nav a:hover {
    color: #48b8d0;
}

/* --- Botón de Modo Oscuro --- */

.dark-mode-toggle {
    margin-left: auto;
    margin-right: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.checkbox {
    display: none;
}

.slider {
    position: relative;
    cursor: pointer;
    width: 60px;
    height: 30px;
    background-color: #ccc;
    transition: background-color 0.4s ease;
    border-radius: 30px;
    display: inline-block;
}

.slider::before {
    content: "";
    position: absolute;
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: transform 0.4s ease, background-color 0.4s ease;
    border-radius: 50%;
}

.checkbox:checked + .slider {
    background-color: #444;
}

.checkbox:checked + .slider::before {
    transform: translateX(30px);
    background-color: #000;
}

.toggle-icon {
    color: #ffffff;
    font-size: 1.2rem;
    transition: color 0.3s ease;
    user-select: none;
}


/* --- Secciones --- */

section {
    padding: 80px 0;
}

h1 {
    font-size: 3.5em;
    margin-bottom: 40px;
    text-align: center;
    color: #333;
    font-weight: 700;
    transition: color 0.3s ease;
}

h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #333;
    font-weight: 700;
    transition: color 0.3s ease;
}

h3 {
    font-size: 1.8em;
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
    transition: color 0.3s ease;
}

/* --- Tarjetas de Curso --- */
.curso-container {
    display: flex;
    flex-direction: column;
  
    gap: 20px; 
}

.curso {
  
    width: 100%;   
    box-sizing: border-box;
    border: 1px solid #ddd;
    padding: 12px 15px; 
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.curso:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.curso-cabecera {
 display: flex;
    align-items: center; 
    margin-bottom: 10px;
}

.curso-imagen-container {
width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0; 
    margin-right: 12px; 
}

.curso-cabecera h2 {
 margin: 0;
    font-size: 1.5em;
    line-height: 1.3;
    color: #337ab7; 
    text-align: left;
    font-weight: 700;
    transition: color 0.3s ease;
    flex-grow: 1;    
    margin-right: 10px; 
}

.curso p {
    margin-bottom: 8px; 
    text-align: left;
    line-height: 1.5; 
}

.curso-detalles p:last-of-type {
    margin-bottom: 0;
}

.curso p strong {
    color: #337ab7;
    transition: color 0.3s ease;
}

/* === Estilos para el Acordeón de Detalles === */
.curso-detalles {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.curso-detalles.visible {
    max-height: 1000px;
    margin-top: 10px; 
    padding-bottom: 1px;
}

.btn {
  display: inline-block; 
  padding: 10px 15px;
  background-color: #337ab7;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  text-align: center;
  cursor: pointer;
  margin-top: 10px; 
}

.btn:hover {
  background-color: #286090;
  transform: translateY(-1px); 
}

.btn:active {
  transform: translateY(0px); 
}

/* Estilos para los SVGs dentro de los botones */
.btn svg {
    display: block; 
  margin: auto;

}

/* === Botón para Mostrar/Ocultar Detalles (+ / -) === */
.btn-toggle-detalles {

    flex-shrink: 0;   
}

/* === Botón para Ingresar a la Capacitación (flecha) === */
.btn-ingresar {
    display: block; 
    margin-top: 15px;   
    margin-left: auto; 
    margin-right: 0;    
}


/* === Estilos para el Acordeón de Detalles === */
.curso-detalles {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-in-out;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.curso-detalles.visible {
  max-height: 1000px; 
  margin-top: 15px;  
  padding-bottom: 1px; 
}


.curso .btn {
  display: inline-flex; 
  align-items: center;
  justify-content: center;
  
  /* HACIÉNDOLOS MÁS CHICOS Y REDONDOS */
  width: 34px;         
  height: 34px;        
  padding: 0;           
  border-radius: 50%; 
  
  background-color: #337ab7;
  color: white;        
  text-decoration: none;
  border: none;        
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  line-height: 1;      
}

.curso .btn:hover {
    background-color: #286090;
}




.btn-toggle-detalles {
    margin-top: auto; 
    align-self: flex-start; 
}

/* El botón "Ingresar a la capacitación" está dentro de .curso-detalles */
.btn-ingresar {
  margin-top: 15px;
  align-self: flex-end; 
    margin-left: auto;  

}

.curso-detalles {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-in-out;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.curso-detalles.visible {
  max-height: 1000px; 
  margin-top: 15px;   
  padding-bottom: 15px; 
}

/* Estilos para los SVGs dentro de los botones */
.btn svg {
 
}

/* === Botón para Mostrar/Ocultar Detalles (+ / -) === */
.btn-toggle-detalles {
  margin-top: auto;      
  align-self: flex-start; 
}

/* === Botón para Ingresar a la Capacitación (flecha) === */
.btn-ingresar {

  display: block;        
  margin-top: 20px;       
  margin-left: 0;         

}


/* === Estilos para el Acordeón de Detalles === */
.curso-detalles {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-in-out;
 
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.curso-detalles.visible {
  max-height: 1000px; 
  margin-top: 15px;   
  padding-bottom: 1px; 
}


.curso .btn {
  display: inline-flex; 
  align-items: center;
  justify-content: center;
  width: 34px;          
  height: 34px;         
  padding: 0;           
  border-radius: 50%;   
  
  background-color: #337ab7;
  color: white;        
  text-decoration: none;
  border: none;         
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  line-height: 1;       
}

.btn-toggle-detalles {
   
  margin-top: auto;       
  align-self: flex-start;
}

/* === Botón para Ingresar a la Capacitación (flecha) === */
.btn-ingresar {
  display: block;         
  margin-top: 20px;       
  margin-left: 0;
}

.curso .btn:hover {
    background-color: #286090;
}


/* --- Botones --- */

:root {
    --boton-color: #ff4c4c;
    --boton-hover-color: #ff0707;
    --bg-color: white;
    --text-color: black;
}

[data-theme="dark"] {
    --bg-color: black;
    --text-color: white;
  }

.btn {
    background-color: var(--boton-color);
    color: #FFF;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
}

.btn:hover {
    background-color: var(--boton-hover-color);
}

/* --- Footer --- */

footer {
    background-color: #f5f5f5;
    padding: 30px 0;
    color: #555;
    font-size: 14px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-info {
    flex: 1 1 300px;
    margin-right: 20px;
    text-align: left;
}

.footer-info p {
    margin: 5px 0;
}

.footer-social {
    flex: 0 0 auto;
    margin-right: 20px;
    display: flex;
    align-items: center;
}

.footer-icon {
    height: 24px;
    margin: 0 5px;
    vertical-align: middle;
}

.footer-logo {
    flex: 0 0 auto;
    text-align: right;
}

.logofooter {
    max-width: 180px;
    height: auto;
}

/* --- Hero Section (index.html) --- */

.hero {
    position: relative;
    width: 100%;
    min-height: 500px; 
    overflow: hidden;  
    
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Fondo negro con opacidad para oscurecer la imagen */
    background: rgba(0, 0, 0, 0.9); 
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 1;              
    border-radius: inherit;  
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 100px 20px;
    text-align: center;
    color: white;
}

/* --- Estilos del carrusel --- */

.hero-carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;    
    transition: opacity 1.5s ease-in-out; 
   
}

.hero-image.active {
    opacity: 1;       
}


/* Estilos adicionales para el título, párrafo y botón (ajusta según tu diseño) */
.hero-content h1 {
    font-size: 3em;       
    margin-bottom: 20px;   
}

.hero-content p {
    font-size: 1.2em;    
    margin-bottom: 30px;  
}

.hero h1 {
    font-size: 4em;
    margin-bottom: 30px;
    color: #fff;
    transition: color 0.3s ease;
}

.hero p {
    font-size: 1.5em;
    margin-bottom: 50px;
    color: #fff;
    transition: color 0.3s ease;
}

.hero .btn {
    margin-bottom: 25px;
}

/* --- Info Section (index.html) --- */

.info {
    padding: 80px 0;
    text-align: center;
    position: relative;
    z-index: 1;
}

.info h2 {
    font-size: 2.5em;
    margin-bottom: 50px;
    color: #333;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
}

.info-item {
    padding: 30px;
    border: 1px solid #eee;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.info-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.info-icon {
    width: 60px;
    height: auto;
    margin-bottom: 20px;
}

/* --- Contacto Rápido (index.html) --- */

.contacto-rapido {
    padding: 50px 0;
    text-align: center;
    background-color: #f5f5f5;
    border-top: 1px solid #eee;
    position: relative;
    z-index: 50;
    transition: background-color 0.3s ease, border-top-color 0.3s ease;
}

.contacto-rapido h2 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #333;
}

.contacto-rapido p {
    margin-bottom: 10px;
}

/* --- Modo Oscuro --- */


@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
        color: #eee;
    }

    header {
        background-color: #1c57b1;
    }

    h1, h2, .curso h2, h3, strong {
        color: #fff;
    }


     .curso p strong{
        color: #fff;
    }

    a {
        color: #80c4de;
    }

      nav a {
        color: #fff; 
    }

    nav a:hover {
        color: #48b8d0;
    
    }

    .curso, .info-item {
        background-color: #1f1f1f;
        border-color: #444;
        box-shadow: 0 2px 5px rgba(255, 255, 255, 0.1);
    }
    .curso:hover,
    .info-item:hover {
       box-shadow: 0 6px 15px rgba(255, 255, 255, 0.15);
    }

    .contacto-rapido {
        background-color: #1A1A1A;
        border-top-color: #444;
    }
      footer{
        background-color: #1A1A1A;
         color: #fff;
    }

    .dark-mode-toggle button {
        color: #ddd;
    }

    .hero::before {
      box-shadow: inset 0px 8px 16px -4px rgba(255,255,255,0.3);
    }
    /* Estilos del slider para modo oscuro (preferencia del sistema) */
     .slider {
        background-color: #666;  /* Gris  */
    }
     .slider::before {
        background-color: #fff;
    }
      .checkbox:checked + .slider {
        background-color: #444;
    }

    .checkbox:checked + .slider::before {
        background-color: #000;  
    }
      .toggle-icon-moon {
     color: #ffffff;
    }
     .toggle-icon-sun{
      color:#ffffff;
    }
}

/* --- Modo Oscuro (Anulación Manual - botón) --- */



body.dark-mode {
    background-color: #121212;
    color: #eee;
}

body.dark-mode header {
    background-color: #1c57b1;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode .curso h2,
body.dark-mode h3,
body.dark-mode strong {
    color: #fff;
}

body.dark-mode .curso p strong{
   color: #fff;
}

body.dark-mode a {
    color: #ffffff;
}

body.dark-mode nav a {
     color: #fff; 
}


body.dark-mode nav a:hover
{
    color: #48b8d0;
    
}

body.dark-mode .curso,
body.dark-mode .info-item {
    background-color: #1f1f1f;
    border-color: #444;
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.1);
}

body.dark-mode .curso:hover,
body.dark-mode .info-item:hover {
    box-shadow: 0 6px 15px rgba(255, 255, 255, 0.15);
}

body.dark-mode .contacto-rapido {
    background-color: #1A1A1A;
    border-top-color: #444;
}

body.dark-mode footer{
   background-color: #1A1A1A;
    color: #fff;
}
body.dark-mode .hero::before{
   box-shadow: inset 0px 8px 16px -4px rgba(0, 0, 0, 0.3);/*Sombra en blanco*/
}
/* Estilos del slider para modo oscuro (anulación manual) */
body.dark-mode  .slider {
    background-color: #666;
}

body.dark-mode .slider::before {
    background-color: #fff;
}
body.dark-mode .checkbox:checked + .slider {
    background-color: #444;
}

body.dark-mode .checkbox:checked + .slider::before {
     background-color: #000;
}
 body.dark-mode .toggle-icon-moon {
    color: #ffffff;
 }
 body.dark-mode .toggle-icon-sun {
    color:#fff;
 }

/* --- Media Queries (Responsive) --- */

/* Para tablets y pantallas medianas */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        align-items: center;
    }

    .logo {
        margin-bottom: 10px;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        text-align: center;
    }

    nav ul li {
        margin: 5px 0;
    }

    .hero-content {
        text-align: center;
        padding: 50px 15px;
    }

    .hero h1 {
        font-size: 2.5em;
    }

    .hero p {
        font-size: 1.3em;
    }

    .info-grid {
        grid-template-columns: 1fr; 
    }

    /* Footer responsivo */
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-info,
    .footer-social,
    .footer-logo {
        margin-bottom: 15px;
    }

    .footer-logo img {
        max-width: 150px;
    }
    
    .dark-mode-toggle {
        margin: 10px 0;
    }
}

/* Para móviles pequeños */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.2em;
    }

    .hero p {
        font-size: 1.1em;
    }

    .hero-content {
        padding: 40px 10px;
    }

    h2 {
        font-size: 1.4em;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    /* Footer en móviles */
    .footer-content {
        text-align: center;
    }

    .footer-logo img {
        max-width: 120px; 
    }
}
