/* styles.css */

/* --- Reset y Estilos Generales --- */
body {
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    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;
    user-select: none;
    transition: color 0.3s ease;
}

/* --- Secciones --- */
section {
    padding: 80px 0;
}

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

h2 { /* Estilo general para 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;
}

/* === Estilos Base para Botones (Redondos y Chicos) === */
.btn {
    display:flex;
    align-items: center;
    justify-content: center;
    width: 32px;   
    height: 32px;  
    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:hover {
    background-color: #286090;
    transform: translateY(-1px);
}

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

.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 {
  margin-top: 15px;
  align-self: flex-end; 
    margin-left: auto;   
}

/* --- Estilos de los videos --- */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin-bottom: 20px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- Otros Estilos de botones (con variables CSS) --- */
:root {
    --boton-color: #ff4c4c; /* Rojo */
    --boton-hover-color: #ff0707;
    --boton-secundario-color: transparent;
    --boton-secundario-hover-color: #f0f0f0;
}


.btn-rojo { 
    display: inline-flex; 
    align-items: center;
    justify-content: center;
    padding: 10px 20px; 
    background-color: var(--boton-color);
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease;
    line-height: 1; 
}
.btn-rojo:hover {
    background-color: var(--boton-hover-color);
}

.btn-secundario {
    display: inline-flex; 
    align-items: center;
    justify-content: center;
    background-color: var(--boton-secundario-color);
    color: #fff; 
    border: 2px solid #fff;
    padding: 8px 21px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    line-height: 1; 
}

.btn-secundario:hover {
    background-color: var(--boton-secundario-hover-color);
    color: #000;
    border-color: var(--boton-secundario-hover-color);
}

/* --- Estilos del pie de página --- */
footer {
    background-color: #edeef0;
    padding: 30px 0;
    color: #323e84;
    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 {
    display: flex;
    justify-content: flex-end; 
}

.footerlogo { 
    max-width: 220px;
}

/* --- Hero Section (index.html) --- */
.hero {
    background-image: url('img/IA_bienvenida.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    width: 100%;
    min-height: 500px;
    transition: background-image 0.3s ease;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 78, 161, 0.8) 0%, rgba(0, 78, 161, 0) 40%, rgba(0, 78, 161, 0.8) 100%);
    box-shadow: inset 0px 0px 80px rgba(0, 0, 0, 0.5);
    z-index: 1;
    border-radius: inherit;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

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

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

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

.hero .certificacion {
    background-color: #bb86fc;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.9em;
    font-weight: 600;
}

.hero .etiquetas {
    margin-bottom: 1.5rem;
}

.hero .etiqueta {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    display: inline-block;
    margin-right: 10px;
    font-size: 0.8em;
}

.hero .btn { 
    margin-bottom: 25px;
    width: auto; 
    height: auto; 
    min-width: 38px; 
    min-height: 38px; 
    padding: 10px 20px; 
}
.hero .btn-secundario {
    color: #fff;
    border: 2px solid #fff;
}
.hero .btn-secundario:hover {
    background-color: rgba(255, 255, 255, 0.9);
    color: #1c57b1;
    border-color: rgba(255, 255, 255, 0.9);
}


/* --- 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;
}

.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, color 0.3s ease;
}

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

.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, h3 { color: #fff; }
    .curso-cabecera h2 { color: #79c0d4; }
    strong { color: #f0f0f0; }
    .curso p strong { color: #79c0d4; }
    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(0, 0, 0, 0.3);
    }
    .curso:hover, .info-item:hover { box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4); }
    .contacto-rapido {
        background-color: #1A1A1A;
        border-top-color: #444;
        color: #ccc;
    }
    .contacto-rapido h2, .contacto-rapido p { color: #eee; }
    footer {
        background-color: #1A1A1A;
        color: #ccc;
    }
    footer .footer-info, footer .footer-social a, footer .footer-logo .footerlogo { color: #ccc; } 
    .hero::before {
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.8) 100%);
        box-shadow: inset 0px 0px 80px rgba(0, 0, 0, 0.7);
    }
    .hero .etiqueta { background-color: rgba(0, 0, 0, 0.2); }
    .hero .btn-secundario { color: #fff; border-color: #fff; }
    .hero .btn-secundario:hover {
        background-color: rgba(255, 255, 255, 0.9);
        color: #121212;
        border-color: rgba(255, 255, 255, 0.9);
    }
    .slider { background-color: #666; }
    .slider::before { background-color: #f0f0f0; }
    .checkbox:checked + .slider { background-color: #333; } 
    .checkbox:checked + .slider::before { background-color: #121212; }
    .toggle-icon { color: #fff; } 
}

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 h3 { color: #fff; }
body.dark-mode .curso-cabecera h2 { color: #79c0d4; }
body.dark-mode strong { color: #f0f0f0; }
body.dark-mode .curso p strong { color: #79c0d4; }
body.dark-mode a { color: #80c4de; }
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(0,0,0,0.3);
}
body.dark-mode .curso:hover, body.dark-mode .info-item:hover { box-shadow: 0 6px 15px rgba(0,0,0,0.4); }
body.dark-mode .contacto-rapido {
    background-color: #1A1A1A;
    border-top-color: #444;
    color: #ccc;
}
body.dark-mode .contacto-rapido h2, body.dark-mode .contacto-rapido p { color: #eee; }
body.dark-mode footer {
    background-color: #1A1A1A;
    color: #ccc;
}
body.dark-mode footer .footer-info, body.dark-mode footer .footer-social a, body.dark-mode footer .footer-logo .footerlogo { color: #ccc; }
body.dark-mode .hero::before {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.8) 100%);
    box-shadow: inset 0px 0px 80px rgba(0, 0, 0, 0.7);
}
body.dark-mode .hero .etiqueta { background-color: rgba(0, 0, 0, 0.2); }
body.dark-mode .hero .btn-secundario { color: #fff; border-color: #fff; }
body.dark-mode .hero .btn-secundario:hover {
    background-color: rgba(255, 255, 255, 0.9);
    color: #121212;
    border-color: rgba(255, 255, 255, 0.9);
}
body.dark-mode .slider { background-color: #666; }
body.dark-mode .slider::before { background-color: #f0f0f0; }
body.dark-mode .checkbox:checked + .slider { background-color: #333; }
body.dark-mode .checkbox:checked + .slider::before { background-color: #121212; }
body.dark-mode .toggle-icon { color: #fff; }

/* --- Media Queries (Responsive) --- */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        align-items: center;
    }
    .logo { margin-bottom: 10px; margin-right: 0; }
    nav ul {
        flex-direction: column;
        width: 100%;
        text-align: center;
    }
    nav ul li { margin: 5px 0; margin-left: 0; }
    .hero-content { padding: 50px 15px; }
    .hero h1 { font-size: 2.5em; }
    .hero p { font-size: 1.3em; }
    .info-grid { grid-template-columns: 1fr; }
    .curso-cabecera {
        flex-direction: column;
        align-items: flex-start;
    }
    .curso-imagen-container {
        width: 100%;
        height: auto; 
        aspect-ratio: 16 / 9; 
        max-height: 220px; 
        margin-bottom: 15px;
        border-radius: 6px; 
    }
    
    .curso-imagen-container img { 
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 6px;
    }
     .curso-cabecera h2 { font-size: 1.4em; }
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .footer-info, .footer-social, .footer-logo {
        margin-bottom: 15px;
        margin-right: 0;
    }
    .footer-logo { justify-content: center; }
    .footerlogo { max-width: 150px; } 
    .dark-mode-toggle { margin: 10px auto; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 2.2em; }
    .hero p { font-size: 1.1em; }
    .hero-content { padding: 40px 10px; }
    h1 { font-size: 2.5em; } 
    h2 { font-size: 1.6em; }
    .curso-cabecera h2 { font-size: 1.2em; }
    h3 { font-size: 1.4em; }
    .curso-imagen-container {
        max-height: 180px; 
    }
    .footerlogo { max-width: 120px; }
}