/* Design System & Variables */
:root {
    /* Palette - Professional & Healing */
    --primary: #329fa2; /* Fresh Teal - Healing, Balance */
    --primary-dark: #268588; /* Darker shade for hover */
    --secondary: #00688d; /* Deep Blue - Trust, Stability */
    --secondary-light: #0080ad; /* Lighter shade for hover */
    --accent: #E9C46A; /* Warm Gold - Hope/Highlights */
    --background: #F8FAFB; /* Clean Off-white */
    --surface: #FFFFFF;
    --text-main: #2D3436;
    --text-muted: #636E72;
    
    /* Typography */
    --font-main: 'Outfit', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    
    /* Modern Shadows & Radius */
    --shadow-sm: 0 4px 6px rgba(50, 159, 162, 0.05);
    --shadow-md: 0 8px 24px rgba(50, 159, 162, 0.12);
    --shadow-lg: 0 16px 32px rgba(0, 104, 141, 0.15);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 32px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--secondary);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utilities */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.btn {
    display: inline-block;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary));
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

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

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

.section-padding {
    padding: var(--spacing-xl) 0;
}

.text-center {
    text-align: center;
}

.section-title {
    font-size: 2.75rem;
    margin-bottom: var(--spacing-sm);
    position: relative;
    display: inline-block;
    color: var(--secondary);
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 6px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    margin: 12px auto 0;
    border-radius: 4px;
}

.section-subtitle {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto var(--spacing-lg);
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #329fa2; /* Updated to user requested color */
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    transition: transform 0.3s ease-in-out; /* Smooth transition for hide/show */
}

.header-hidden {
    transform: translateY(-100%);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
}

.logo span {
    color: var(--primary);
}

.logo-img {
    height: 55px; /* Increased size for web version */
    display: block;
}

.nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    flex-direction: column;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.nav-links.active {
    display: flex;
}

.nav-links a {
    font-weight: 500;
    color: var(--secondary);
    display: block;
    padding: 1rem;
}

.nav-links a:hover {
    color: var(--primary);
}

.mobile-toggle {
    display: block;
    font-size: 1.5rem;
    cursor: pointer;
    color: white; /* Updated to white as requested */
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding-top: 80px;
}

/* Background Animation */
.hero::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background: linear-gradient(rgba(38, 70, 83, 0.7), rgba(38, 70, 83, 0.7)), url('Fotos/Centro/biblioteca-de-medios-1.png');
    background-size: cover;
    background-position: center;
    z-index: -1;
    animation: heroFloat 30s ease-in-out infinite alternate;
}

@keyframes heroFloat {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.1) translate(-2%, -2%); }
}

/* Modern Content Entrance */
.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    color: white;
    opacity: 0;
    animation: fadeUpBlur 1s ease-out forwards;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-md);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    animation: fadeUpBlur 1s ease-out 0.3s forwards;
}

.hero-buttons {
    opacity: 0;
    animation: fadeUpBlur 1s ease-out 0.6s forwards;
}

@keyframes fadeUpBlur {
    0% {
        opacity: 0;
        transform: translateY(30px);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* About / Team */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.team-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-align: center;
    padding-bottom: var(--spacing-md);
}

.team-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
}

.team-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    margin-bottom: var(--spacing-sm);
}

.team-card h3 {
    margin-bottom: 0.5rem;
    color: var(--secondary);
}

.team-card p {
    color: var(--primary);
    font-weight: 500;
}

/* Beca Section Animation */
#beca {
    background: linear-gradient(-45deg, #329fa2, #00688d, #268588, #329fa2);
    background-size: 400% 400%;
    color: white;
    animation: gradientBG 15s ease infinite;
    position: relative;
    overflow: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#beca .section-title {
    color: white !important;
    border-bottom-color: var(--accent) !important;
}

/* New CTA Button with Shimmer & Float */
#beca .btn-cta-pulse {
    background: var(--accent);
    color: #2D3436; /* Darker text for better contrast on gold */
    padding: 16px 48px;
    font-size: 1.2rem;
    font-weight: 800;
    border: none;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    animation: floatBtn 3s ease-in-out infinite;
    z-index: 1;
}

#beca .btn-cta-pulse:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    background: #e0bb5a;
    color: #000;
}

/* Shimmer Effect */
#beca .btn-cta-pulse::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transition: 0.5s;
    animation: shimmer 3s infinite 2s; /* Delayed start */
}

@keyframes shimmer {
    0% { left: -100%; }
    20% { left: 100%; }
    100% { left: 100%; }
}

@keyframes floatBtn {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Therapies & Workshops */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.service-card {
    background: var(--surface);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.05);
}

.service-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
}

.service-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: var(--spacing-sm);
}

.service-card h3 {
    margin-bottom: var(--spacing-sm);
}

/* Metrics / Resultados */
.metrics-grid { align-items: stretch; }
.metric-card { background: transparent; padding: var(--spacing-sm); }
.metric-value { display: block; }

/* Metodología Redesign */
#terapias .methodology-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin-bottom: var(--spacing-lg);
}

/* Striking Title Animation */
#terapias .section-title {
    background: linear-gradient(90deg, var(--secondary), var(--primary), var(--accent), var(--secondary));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientTextFlow 5s ease-in-out infinite, titlePulse 3s ease-in-out infinite;
    display: inline-block;
}

@keyframes gradientTextFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.block-card { 
    background: var(--surface); 
    padding: 2.5rem 2rem; 
    border-radius: 24px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
    z-index: 1;
    text-align: center;
    /* Constant Float Animation */
    animation: cardFloat 6s ease-in-out infinite;
}

/* Staggered Animation Delays for organic feel */
.block-card:nth-child(1) { animation-delay: 0s; }
.block-card:nth-child(2) { animation-delay: 1.5s; }
.block-card:nth-child(3) { animation-delay: 3s; }
.block-card:nth-child(4) { animation-delay: 4.5s; }

@keyframes cardFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.block-card:hover {
    transform: translateY(-20px) scale(1.02); /* Override float on hover */
    box-shadow: 0 20px 40px rgba(50, 159, 162, 0.15);
    animation-play-state: paused; /* Pause float so user can focus */
}

.block-card:hover::before {
    transform: scaleX(1);
}

/* Specific Icon Style for Methodology */
.block-card .service-icon {
    font-size: 2rem;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    width: 80px;
    height: 80px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 20px rgba(50, 159, 162, 0.25);
    transition: all 0.5s ease;
    transform: rotate(0deg);
}

.block-card:hover .service-icon {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
    transform: rotate(10deg) scale(1.1);
    box-shadow: 0 15px 30px rgba(0, 104, 141, 0.3);
}

.block-card h3 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    color: var(--text-main);
    font-weight: 700;
}

.block-card p {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Galería / Carrusel */
.carousel { position: relative; overflow: hidden; border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.carousel-track { display: flex; transition: transform 0.5s ease; }
.carousel-item { min-width: 100%; }
.carousel-item img { width: 100%; height: 420px; object-fit: cover; }
.carousel-control { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.4); color: #fff; border: none; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.carousel-control.prev { left: 12px; }
.carousel-control.next { right: 12px; }

/* Equipo resumido */
.team-group { background: var(--surface); padding: var(--spacing-md); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }

/* FAQ */
.faq-item { 
    background: var(--surface); 
    padding: var(--spacing-md); 
    border-radius: var(--radius-md); 
    box-shadow: var(--shadow-sm); 
    cursor: pointer;
    transition: var(--transition);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.faq-question h4 {
    margin-bottom: 0 !important; /* Override inline styles if any */
    flex: 1;
    padding-right: 1rem;
}

.faq-toggle-icon {
    color: var(--primary);
    transition: transform 0.3s ease;
    font-size: 1.2rem;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease-out, opacity 0.3s ease, margin-top 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px; /* Allows content to show */
    opacity: 1;
    margin-top: 1rem;
}

.faq-item.active .faq-toggle-icon {
    transform: rotate(45deg);
}

/* Ubicación */
.map-wrapper { margin-top: var(--spacing-sm); }

/* Contacto directo */

/* Scholarship Section */
.scholarship {
    background-color: var(--secondary);
    color: white;
    position: relative;
    overflow: hidden;
}

.scholarship-content {
    position: relative;
    z-index: 2;
}

.scholarship h2 {
    color: var(--accent);
}

.scholarship p {
    color: rgba(255,255,255,0.9);
}

/* Contact Form */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
}

.contact-info h3 {
    margin-bottom: var(--spacing-sm);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.contact-item i {
    color: var(--primary);
    font-size: 1.5rem;
}

.contact-form {
    background: var(--surface);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--secondary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: var(--radius-sm);
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
}

/* Footer */
footer {
    background: #329fa2;
    color: white;
    padding: var(--spacing-lg) 0 var(--spacing-md);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-col h4 {
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
}

.footer-links a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    /* Nav links styles are now global (hamburger menu everywhere) */
    
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Modern Testimonials - Optimized */
.testimonials-section {
    background-color: var(--secondary);
    position: relative;
    padding-bottom: 6rem; /* Extra space */
}

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

.testimonial-card {
    background: #ffffff;
    padding: 2rem 2.5rem;
    border-radius: 16px;
    /* Optimized Shadow: Small, sharp, no large blur radius */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: transform 0.3s ease; /* Removed box-shadow transition for performance */
    border: none;
    border-top: 6px solid var(--accent); /* Design feature: Top Accent Border */
}

.testimonial-card:hover {
    transform: translateY(-5px);
    /* No shadow change on hover to prevent repaint lag */
}

.testimonial-quote-icon {
    font-family: "Georgia", serif;
    font-size: 4rem;
    line-height: 1;
    position: absolute;
    bottom: 20px; /* Moved to bottom right for different look */
    right: 20px;
    color: var(--primary);
    opacity: 0.1;
    pointer-events: none;
}

.testimonial-text {
    font-size: 1.1rem;
    color: #2D3436;
    line-height: 1.7;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
    font-style: normal; /* Changed to normal for better readability */
    font-weight: 400;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid #eee;
    padding-top: 1.5rem;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--background); /* Solid color instead of gradient for perf */
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    border: 2px solid var(--primary);
}

.author-info h4 {
    color: var(--secondary);
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
    font-weight: 700;
}

.author-info span {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: block;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* Full Screen Video Styles */
.video-full-container {
    width: 100%;
    height: 70vh; /* Takes 70% viewport height */
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.video-full-container video {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensures video is fully visible without cropping */
    display: block;
}

/* Ensure mobile adaptation */
@media (max-width: 768px) {
    .video-full-container {
        height: 70vh; /* Forces 70% height on mobile too */
    }
}
