/* =================================================================== */
/*                      1. ROOT & GLOBAL STYLES                        */
/* =================================================================== */

:root {
    /* Color Palette */
    --primary-color: #4f46e5; /* Indigo */
    --secondary-color: #d946ef; /* Fuchsia */
    --accent-color: #10b981; /* Emerald */
    --accent-color-dark: #059669;

    /* Text Colors */
    --text-color-dark: #1f2937; /* Cool Gray 800 */
    --text-color-light: #f9fafb; /* Cool Gray 50 */
    --text-color-medium: #6b7280; /* Cool Gray 500 */

    /* Background Colors */
    --bg-light: #ffffff;
    --bg-dark: #111827; /* Cool Gray 900 */
    --bg-gradient: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --bg-card: #ffffff;
    --border-color: #e5e7eb; /* Cool Gray 200 */

    /* Typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'DM Sans', sans-serif;

    /* Spacing & Sizing */
    --header-height: 80px;
    --container-padding: 0 2rem;
    --section-padding: 5rem 0;
    --card-border-radius: 8px;
    --button-border-radius: 6px;
}

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

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

body {
    font-family: var(--font-body);
    color: var(--text-color-dark);
    background-color: var(--bg-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-color-dark);
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
p { margin-bottom: 1.25rem; color: var(--text-color-medium); }
a { color: var(--primary-color); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--secondary-color); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* =================================================================== */
/*                 2. LAYOUT & CONTAINER STYLES                        */
/* =================================================================== */

.main-container {
    overflow-x: hidden;
}

.content-section {
    padding: var(--section-padding);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-color-dark);
    text-shadow: none;
}

.section-subtitle {
    text-align: center;
    max-width: 600px;
    margin: -2rem auto 3rem auto;
    font-size: 1.1rem;
}

.gradient-bg {
    background: var(--bg-gradient);
    color: var(--text-color-light);
}

.gradient-bg .section-title,
.gradient-bg h3,
.gradient-bg p {
    color: var(--text-color-light);
}
.gradient-bg .section-title {
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.asymmetric-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--container-padding);
}

@media (min-width: 768px) {
    .asymmetric-layout {
        grid-template-columns: repeat(2, 1fr);
    }
}

.section-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.6); /* --bg-dark with opacity */
    z-index: 1;
}

.section-content-wrapper {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--container-padding);
}

/* Scroll Animation Base State */
.animate__animated {
    opacity: 0;
}

/* =================================================================== */
/*                    3. HEADER & NAVIGATION                           */
/* =================================================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--container-padding);
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--text-color-dark);
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease-in-out;
}

.nav-links a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color-dark);
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        flex-direction: column;
        justify-content: center;
        gap: 2.5rem;
        background: var(--bg-light);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    }

    .nav-links.active {
        right: 0;
    }

    .menu-toggle {
        display: block;
    }

    .menu-toggle.active .bar:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active .bar:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
}

/* =================================================================== */
/*                     4. BUTTONS & FORMS                              */
/* =================================================================== */

/* Global Button Styles */
.cta-button, .submit-button, .link-button, .event-register-button {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 700;
    padding: 0.8rem 2rem;
    border-radius: var(--button-border-radius);
    border: 2px solid transparent;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.cta-button, .submit-button {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.cta-button:hover, .submit-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 70, 239, 0.4);
}

/* Contact Form */
.contact-form {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    position: relative;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
    width: 100%;
    padding: 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-color-light);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--button-border-radius);
    transition: border-color 0.3s ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.contact-form select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.contact-form label {
    position: absolute;
    top: -0.75rem;
    left: 0.75rem;
    background: var(--bg-dark);
    padding: 0 0.5rem;
    color: var(--accent-color);
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contact-form input:focus + label,
.contact-form textarea:focus + label,
.contact-form input:not(:placeholder-shown) + label,
.contact-form textarea:not(:placeholder-shown) + label {
    opacity: 1;
}

.submit-button {
    width: 100%;
    max-width: 300px;
    margin: 1rem auto 0 auto;
    background: var(--accent-color);
}
.submit-button:hover {
    background: var(--accent-color-dark);
}

/* =================================================================== */
/*                        5. SECTION STYLES                            */
/* =================================================================== */

/* --- Hero Section --- */
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-color-light);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Parallax effect */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(17, 24, 39, 0.8) 0%, rgba(17, 24, 39, 0.4) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: var(--container-padding);
}

.hero-title {
    color: var(--text-color-light);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    color: var(--text-color-light);
    opacity: 0.9;
}

/* --- Methodology & Accordion --- */
.accordion-block {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.accordion-item {
    border: 2px solid var(--border-color);
    border-radius: var(--card-border-radius);
    overflow: hidden;
}
.accordion-header {
    width: 100%;
    background: var(--bg-light);
    border: none;
    padding: 1.5rem;
    text-align: left;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}
.accordion-header:hover {
    background-color: #f3f4f6; /* Cool Gray 100 */
}
.accordion-icon {
    font-size: 1.5rem;
    font-weight: bold;
    transition: transform 0.3s ease-in-out;
}
.accordion-item.active .accordion-icon {
    transform: rotate(45deg);
}
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
    background: #f9fafb; /* Cool Gray 50 */
}
.accordion-content p {
    padding: 1.5rem;
    margin-bottom: 0;
}
.accordion-item.active .accordion-content {
    max-height: 500px; /* Adjust as needed */
}

/* --- Innovation & Cards --- */
.innovation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--container-padding);
}
.card, .innovation-card, .instructor-card {
    background: var(--bg-card);
    border-radius: var(--card-border-radius);
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    text-align: center;
}
.card:hover, .innovation-card:hover, .instructor-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.card-image, .image-container {
    height: 200px;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-image img, .image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.card:hover .card-image img,
.innovation-card:hover .card-image img {
    transform: scale(1.05);
}
.card-content {
    padding: 1.5rem;
    flex-grow: 1; /* Allows footer content to stick to bottom if cards are uneven */
    display: flex;
    flex-direction: column;
}
.card-content h3 {
    margin-bottom: 0.5rem;
}
.card-content p {
    font-size: 0.95rem;
}

/* --- Instructors & Carousel --- */
.carousel-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    padding: 0 4rem; /* Space for nav buttons */
}
.instructor-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 2rem;
    padding-bottom: 1rem; /* for scrollbar */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.instructor-carousel::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}
.instructor-card {
    flex: 0 0 100%;
    max-width: 100%;
    scroll-snap-align: center;
}
@media (min-width: 600px) {
    .instructor-card {
        flex: 0 0 48%;
        max-width: 48%;
    }
}
@media (min-width: 992px) {
    .instructor-card {
        flex: 0 0 31%;
        max-width: 31%;
    }
}
.instructor-card .image-container {
    height: 250px;
}
.instructor-card h4 {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255,255,255,0.8);
    border: 2px solid var(--border-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-color-dark);
    transition: all 0.3s ease;
}
.carousel-nav:hover {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    border-color: var(--primary-color);
}
.carousel-nav.prev { left: 0; }
.carousel-nav.next { right: 0; }

/* --- Case Studies --- */
#casos-de-exito { position: relative; }
.case-studies-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
@media (min-width: 768px) {
    .case-studies-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.case-study-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem;
    border-radius: var(--card-border-radius);
    color: var(--text-color-light);
}
.testimonial-quote {
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--accent-color);
    padding-left: 1.5rem;
}
.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.testimonial-author img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
}
.testimonial-author span {
    line-height: 1.3;
}

/* --- Gallery --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--container-padding);
}
.gallery-item {
    overflow: hidden;
    border-radius: var(--card-border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.gallery-item:hover img {
    transform: scale(1.1);
}

/* --- Events --- */
.events-list {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: var(--container-padding);
}
.event-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 2rem;
    border-radius: var(--card-border-radius);
    transition: background-color 0.3s ease;
}
.event-item:hover {
    background: rgba(255, 255, 255, 0.25);
}
@media (min-width: 768px) {
    .event-item {
        flex-direction: row;
        align-items: center;
    }
}
.event-date {
    flex-shrink: 0;
    text-align: center;
    font-family: var(--font-heading);
    color: var(--text-color-light);
    background: var(--accent-color);
    border-radius: var(--card-border-radius);
    padding: 0.5rem 1rem;
    line-height: 1;
}
.event-date span {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}
.event-details {
    flex-grow: 1;
}
.event-details h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}
.event-details p {
    margin-bottom: 0.5rem;
    opacity: 0.9;
}
.event-location {
    font-weight: bold;
    opacity: 0.8;
}
.event-register-button {
    background: none;
    border: 2px solid var(--text-color-light);
    color: var(--text-color-light);
    padding: 0.6rem 1.5rem;
    margin-left: auto;
}
.event-register-button:hover {
    background: var(--text-color-light);
    color: var(--primary-color);
}

/* --- Research --- */
.research-image-block img {
    border-radius: var(--card-border-radius);
    box-shadow: 10px 10px 0px var(--primary-color);
}
.link-button {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: bold;
}
.link-button:hover {
    background: var(--primary-color);
    color: var(--text-color-light);
    transform: translateY(-2px);
}

/* --- External Resources --- */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--container-padding);
}
.resource-card {
    border: 2px solid var(--border-color);
    padding: 2rem;
    border-radius: var(--card-border-radius);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.resource-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.resource-card h3 a {
    color: var(--text-color-dark);
}
.resource-card h3 a:hover {
    color: var(--primary-color);
}
.resource-card p {
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* --- Media --- */
.media-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--container-padding);
}
.media-logos img {
    height: 40px;
    width: auto;
    opacity: 0.6;
    filter: grayscale(100%);
    transition: opacity 0.3s ease, filter 0.3s ease;
}
.media-logos img:hover {
    opacity: 1;
    filter: grayscale(0%);
}

/* =================================================================== */
/*                        6. FOOTER STYLES                             */
/* =================================================================== */

.site-footer {
    background: var(--bg-dark);
    color: var(--text-color-light);
    padding: 4rem 0 2rem 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--container-padding);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-column h3, .footer-column h4 {
    color: var(--text-color-light);
    margin-bottom: 1.5rem;
}
.footer-column h3 {
    font-size: 1.5rem;
}
.footer-column p {
    color: var(--text-color-medium);
    margin-bottom: 0;
}

.footer-column ul li {
    margin-bottom: 0.75rem;
}

.footer-column ul a {
    color: var(--text-color-medium);
}

.footer-column ul a:hover {
    color: var(--text-color-light);
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid #374151; /* Cool Gray 700 */
    padding-top: 2rem;
    text-align: center;
    color: var(--text-color-medium);
    font-size: 0.9rem;
}

/* =================================================================== */
/*                     7. PAGE-SPECIFIC STYLES                         */
/* =================================================================== */

/* For success.html */
.success-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100vh;
    background: var(--bg-gradient);
    color: var(--text-color-light);
    padding: 2rem;
}
.success-page h1 {
    color: var(--text-color-light);
    margin-bottom: 2rem;
}
.success-page .cta-button {
    background-color: var(--accent-color);
}
.success-page .cta-button:hover {
    background-color: var(--accent-color-dark);
}

/* For privacy.html & terms.html */
.static-page-content {
    padding-top: calc(var(--header-height) + 3rem);
    padding-bottom: 3rem;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
}
.static-page-content h1 {
    margin-bottom: 2rem;
}
.static-page-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}
.static-page-content ul {
    list-style: disc;
    padding-left: 1.5rem;
}
.gradient-bg .section-title, .gradient-bg h3, .gradient-bg p {
    color: #7a7c7f;
}