/* =================================================================== */
/* KommuniK Academy - CSS Modernizado v2.1 (Full & Polished)          */
/* Diseño enfocado en claridad, profesionalismo y experiencia de usuario. */
/* =================================================================== */

/* ---------------------------------- */
/* 1. SISTEMA DE DISEÑO (VARIABLES)
/* ---------------------------------- */
:root {
    /* Paleta de Colores Moderna y Vibrante */
    --color-primary: #7c4dff;
    --color-primary-dark: #651fff;
    --color-accent: #ffab00;
    --color-background: #f8f9fa;
    --color-surface: #ffffff;
    --color-text: #2c3e50; /* Gris azulado oscuro */
    --color-text-light: #86909a; /* Para texto secundario */
    --color-border: #e9ecef;
    --color-success: #28a745;
    --color-error: #e74c3c;

    /* Tipografía */
    --font-body: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-heading: 'Lora', serif;

    /* Sistema de Sombras para Profundidad */
    --shadow-sm: 0 2px 8px rgba(44, 62, 80, 0.07);
    --shadow-md: 0 5px 15px rgba(44, 62, 80, 0.1);
    --shadow-lg: 0 10px 30px rgba(44, 62, 80, 0.15);

    /* Radios de Borde */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;

    /* Transiciones */
    --transition-fast: all 0.2s ease-out;
    --transition-smooth: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* ---------------------------------- */
/* 2. RESET Y ESTILOS BASE
/* ---------------------------------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-body);
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-background);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 500;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
}

ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
.container { width: 90%; max-width: 1140px; margin: 0 auto; padding: 0 15px; }
.section { padding: 100px 0; }
.text-center { text-align: center; }

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 600;
    text-align: center;
    margin-bottom: 60px;
    color: var(--color-text);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 2px;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
}

/* ---------------------------------- */
/* 3. COMPONENTES REUTILIZABLES
/* ---------------------------------- */
.btn {
    display: inline-block;
    padding: 14px 32px;
    background-color: var(--color-primary);
    color: #ffffff;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-5px) scale(1.03);
    box-shadow: var(--shadow-md);
}

.btn:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 3px;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--color-accent);
    color: var(--color-accent);
}

.btn-outline:hover {
    background-color: var(--color-accent);
    color: var(--color-surface);
}

/* ---------------------------------- */
/* 4. LAYOUT Y SECCIONES PRINCIPALES
/* ---------------------------------- */

/* Transformación global a mayúsculas */
.section-title, .hero-title, .hero-subtitle, .btn, .course-title, .advisory-title,
.footer-title, .testimonial-author, .cta-content h2, h3, .about-text p, .about-text h2,
.footer-logo h2, .footer-links a, .footer-contact span, .footer-bottom p {
    text-transform: uppercase;
}

/* --- Header y Navegación (ESTRUCTURA SIN MODIFICAR) --- */
header {
    background-color: #ffffff;
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.navbar { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; }
.logo { display: flex; align-items: center; }
.logo img { height: 70px; margin-right: 15px; background-color: transparent; border-radius: 50%; }
.logo h1 { font-size: 1.8rem; color: var(--color-primary); font-weight: 700; }
.nav-menu { display: flex; align-items: center; gap: 25px; }
.nav-item { margin: 0; }
.nav-link { color: var(--color-text-light); font-weight: 600; position: relative; padding: 5px 0; }
.nav-link::after { content: ''; position: absolute; width: 0; height: 2px; background: var(--color-primary); bottom: -5px; left: 0; transition: var(--transition-fast); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link:hover, .nav-link.active { color: var(--color-primary); }
.nav-button { 
    background-color: #FFD700; 
    color: #651fff !important; 
    padding: 6px 12px !important; 
    border-radius: 4px; 
    margin-left: 15px; 
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    font-size: 0.8rem;
    border: 1px solid #FFD700;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
    text-decoration: none !important;
    display: inline-block;
}
.nav-button:hover { 
    background-color: #651fff; 
    color: #FFD700 !important; 
    transform: translateY(-2px); 
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2); 
    border-color: #651fff;
}

.nav-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: 0.5s;
    z-index: -1;
}

.nav-button:hover::before {
    left: 100%;
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 100%; }
    100% { left: 100%; }
}
.hamburger { display: none; cursor: pointer; }
.bar { display: block; width: 25px; height: 3px; margin: 5px auto; background-color: var(--color-text); transition: all 0.3s ease-in-out; }
.hamburger.active .bar:nth-child(2) { opacity: 0; }
.hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to right, rgba(106, 27, 154, 0.85), rgba(124, 77, 255, 0.95)), url('../3e4f3603-b1a8-4aa5-8ec0-e65f7fa73e4d.jpg') no-repeat center center/cover;
    background-attachment: fixed;
    color: #ffffff;
    text-align: center;
    padding: 120px 15px 40px;
}
.hero-content { max-width: 850px; margin: 0 auto; }
.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.8rem, 8vw, 4.8rem);
    line-height: 1.1;
    margin-bottom: 20px;
    text-shadow: 0 3px 15px rgba(0,0,0,0.25);
    animation: fadeInDown 1s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    margin: 0 auto 40px auto;
    max-width: 700px;
    color: rgba(255, 255, 255, 0.9);
    animation: fadeInUp 1s cubic-bezier(0.165, 0.84, 0.44, 1) 0.3s;
    animation-fill-mode: both;
}
.hero-btns { animation: fadeIn 1s ease 0.6s; animation-fill-mode: both; }

/* --- About Section --- */
.about { background-color: var(--color-surface); }
.about-content { display: flex; align-items: center; justify-content: center; }
.about-text { max-width: 800px; margin: 0 auto; }
.about-image { flex: 1; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }

/* --- Courses & Advisory Cards --- */
.courses-container, .advisory-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 40px; }
.course-card, .advisory-card {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}
.course-card:hover, .advisory-card:hover { transform: translateY(-12px); box-shadow: var(--shadow-lg); }
.course-image { height: 200px; background: linear-gradient(45deg, var(--color-primary), var(--color-primary-dark)); display: flex; align-items: center; justify-content: center; color: #ffffff; font-size: 4rem; overflow: hidden; }
.course-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.course-card:hover .course-image img { transform: scale(1.05); }
.course-content, .advisory-card { padding: 30px; flex-grow: 1; }
.course-title, .advisory-title { font-size: 1.5rem; margin-bottom: 15px; color: var(--color-text); font-family: var(--font-body); font-weight: 600; }
.course-info { margin: 15px 0; }
.course-info li { display: flex; align-items: center; margin-bottom: 8px; color: var(--color-text-light); }
.course-info i { color: var(--color-primary); margin-right: 10px; width: 20px; text-align: center; }
.advisory-icon { font-size: 3rem; color: var(--color-primary); margin-bottom: 20px; }
.advisory-card .btn { margin-top: auto; }

/* --- Detailed Course Page --- */
.course-detail { background-color: var(--color-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); margin-bottom: 40px; }
.course-header { background: linear-gradient(45deg, var(--color-primary), var(--color-primary-dark)); color: #fff; padding: 40px; display: flex; align-items: center; border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-lg); }
.course-icon { min-width: 80px; height: 80px; background-color: rgba(255, 255, 255, 0.15); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; margin-right: 25px; }
.course-header h3 { font-size: 2rem; margin-bottom: 5px; }
.course-subtitle { opacity: 0.85; }
.course-body { padding: 40px; }
.course-description h4 { color: var(--color-primary); margin-top: 30px; margin-bottom: 15px; font-size: 1.4rem; border-bottom: 2px solid var(--color-border); padding-bottom: 10px; }
.course-description p, .course-description ul { margin-bottom: 20px; }
.course-description ul { padding-left: 20px; }
.course-description ul li { margin-bottom: 10px; position: relative; padding-left: 20px; }
.course-description ul li::before { content: '✓'; color: var(--color-primary); position: absolute; left: 0; font-weight: 600; }
.course-info-box { background-color: var(--color-background); border-radius: var(--radius-md); padding: 25px; margin: 30px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 25px; border-left: 4px solid var(--color-primary); }
.info-item { display: flex; align-items: flex-start; }
.info-item i { color: var(--color-primary); font-size: 1.5rem; margin-right: 15px; margin-top: 5px; }
.info-item h5 { margin-bottom: 5px; color: var(--color-text); }

/* --- FAQ Section --- */
.faq-container { max-width: 800px; margin: 0 auto; }
.faq-item { background-color: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: 15px; box-shadow: var(--shadow-sm); transition: var(--transition-fast); }
.faq-item:hover { border-color: var(--color-primary); }
.faq-item.active { box-shadow: var(--shadow-md); border-color: var(--color-primary); }
.faq-question { padding: 20px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.faq-question h4 { margin: 0; font-size: 1.1rem; }
.faq-question i { transition: transform 0.3s ease; }
.faq-answer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.4s ease; }
.faq-answer > div { overflow: hidden; }
.faq-answer p { padding: 0 20px 20px 20px; }
.faq-item.active .faq-answer { grid-template-rows: 1fr; }
.faq-item.active .faq-question i { transform: rotate(180deg); }

/* --- Testimonials Section --- */
.testimonials { background-color: var(--color-surface); }
.testimonial-slider { position: relative; max-width: 800px; margin: 0 auto; overflow: hidden; }
.testimonial-slide { text-align: center; padding: 30px; display: none; }
.testimonial-slide.active { display: block; animation: fadeIn 0.5s ease; }
.testimonial-text { font-style: italic; font-size: 1.2rem; margin-bottom: 25px; position: relative; color: var(--color-text-light); }
.testimonial-text::before { content: '“'; font-size: 3.5rem; color: var(--color-primary); opacity: 0.2; position: absolute; top: -20px; left: -10px; }
.testimonial-author { font-weight: 600; color: var(--color-text); }
.testimonial-controls, .testimonial-indicators { display: flex; justify-content: center; margin-top: 20px; }
.testimonial-btn { background-color: var(--color-primary); color: #fff; border: none; width: 45px; height: 45px; border-radius: 50%; margin: 0 10px; cursor: pointer; transition: var(--transition-fast); }
.testimonial-btn:hover { background-color: var(--color-primary-dark); transform: scale(1.1); }
.indicator { width: 12px; height: 12px; background-color: var(--color-border); border-radius: 50%; margin: 0 5px; cursor: pointer; transition: var(--transition-fast); }
.indicator.active { background-color: var(--color-primary); }

/* --- Contact Section --- */
.contact-content { display: grid; grid-template-columns: 1fr 1.5fr; gap: 60px; align-items: start; }
.contact-info-item { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 25px; }
.contact-icon { font-size: 1.5rem; color: var(--color-primary); }
.contact-form { background-color: var(--color-surface); padding: 40px; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.form-group { margin-bottom: 20px; }
.form-control {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--color-background);
    color: var(--color-text);
    transition: var(--transition-fast);
}
.form-control:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 4px rgba(124, 77, 255, 0.15); }
.form-control.error { border-color: var(--color-error); }
.error-message { color: var(--color-error); font-size: 0.9rem; margin-top: 5px; display: none; }
.map { height: 400px; border-radius: var(--radius-lg); overflow: hidden; margin-top: 40px; border: 1px solid var(--color-border); }

/* --- Footer (ESTRUCTURA SIN MODIFICAR) --- */
footer { background-color: #1a1a1a; color: rgba(255, 255, 255, 0.7); padding: 80px 0 30px; }
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; margin-bottom: 60px; }
.footer-logo { display: flex; align-items: center; margin-bottom: 20px; }
.footer-logo img { height: 55px; margin-right: 12px; background-color: white; border-radius: 50%; padding: 3px; }
.footer-logo h2 { font-size: 1.7rem; color: #ffffff; }
.footer-title { font-size: 1.2rem; font-weight: 600; color: #ffffff; margin-bottom: 25px; position: relative; padding-bottom: 10px; }
.footer-title::after { content: ''; position: absolute; left: 0; bottom: 0; width: 40px; height: 3px; background-color: var(--color-primary); }
.footer-links li { margin-bottom: 12px; }
.footer-links a { color: rgba(255, 255, 255, 0.7); transition: var(--transition-fast); }
.footer-links a:hover { color: var(--color-primary); padding-left: 8px; }
.footer-contact li { display: flex; align-items: flex-start; margin-bottom: 15px; }
.footer-contact i { margin-right: 15px; margin-top: 5px; color: var(--color-primary); }
.social-links { display: flex; gap: 15px; margin-top: 20px; }
.social-link { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background-color: rgba(255, 255, 255, 0.08); border-radius: 50%; transition: var(--transition-fast); }
.social-link:hover { background-color: var(--color-primary); transform: translateY(-3px); }
.footer-bottom { text-align: center; padding-top: 30px; border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 0.9rem; color: rgba(255, 255, 255, 0.5); }

/* ---------------------------------- */
/* 5. OTROS Y HELPERS
/* ---------------------------------- */
.whatsapp-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    transition: var(--transition-smooth);
}
.whatsapp-btn:hover { transform: scale(1.1) rotate(10deg); }

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.appear {
    opacity: 1;
    transform: translateY(0);
}

/* ---------------------------------- */
/* 6. ANIMACIONES Y MEDIA QUERIES
/* ---------------------------------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

@media screen and (max-width: 992px) {
    .container { width: 90%; }
    .courses-container, .advisories-container { grid-template-columns: repeat(2, 1fr); }
    .hero-title { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1.1rem; }
    .logo img { height: 60px; }
    .logo h1 { font-size: 1.5rem; }
    .nav-button { padding: 6px 10px !important; font-size: 0.75rem; margin-left: 10px; }
}

@media screen and (max-width: 768px) {
    .navbar { padding: 10px 0; }
    .logo img { height: 50px; margin-right: 10px; }
    .logo h1 { font-size: 1.5rem; }
    .nav-button { 
        margin: 15px auto;
        display: block;
        padding: 8px 15px !important;
        width: 60%;
        text-align: center;
        font-size: 0.85rem;
        max-width: 200px;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 85px; /* Altura ajustada de la barra de navegación */
        flex-direction: column;
        background-color: var(--color-surface);
        width: 100%;
        text-align: center;
        transition: left 0.3s ease;
        box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
        gap: 0;
        padding: 20px 0;
        z-index: 1000;
    }
    .nav-menu.active { left: 0; }
    .nav-item { margin: 0; width: 100%; }
    .nav-link { display: block; padding: 15px 0; }
    .nav-link::after { bottom: 5px; left: 50%; transform: translateX(-50%); }

    .hamburger { display: block; z-index: 1001; }
    .section { padding: 60px 0; }
    .hero { min-height: auto; padding-top: 120px; }
    .hero-content { text-align: center; }
    .hero-buttons { justify-content: center; }
    .footer-content { grid-template-columns: 1fr; }
    .footer-logo { justify-content: center; }
    .footer-logo img { height: 45px; }
    .footer-logo h2 { font-size: 1.5rem; }
}

@media screen and (max-width: 576px) {
    .hero-title { font-size: 2rem; }
    .hero-subtitle { font-size: 1rem; }
    .section-title { font-size: 1.8rem; }
    .logo img { height: 50px; }
    .logo h1 { font-size: 1.2rem; }
    .whatsapp-float { bottom: 20px; right: 20px; }
    .nav-button { 
        margin: 10px auto;
        display: inline-block;
        padding: 10px 20px !important;
        font-size: 0.9rem;
    }
}