@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&family=Outfit:wght@400;700;900&display=swap');

:root {
    --bg-color: #1e3a8a;
    --text-color: #f8fafc;
    --text-muted: #cbd5e1;
    --primary-color: #38bdf8;
    --secondary-color: #7dd3fc;
    --glass-bg: rgba(30, 64, 175, 0.6);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

/* Glassmorphism Utilities */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
}

/* Navbar */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

header.scrolled {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.5rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 1px;
}

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

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
}

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

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

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 2rem;
    position: relative;
    background: radial-gradient(circle at center, #2563eb 0%, #1e3a8a 100%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
    opacity: 0.15;
    top: -200px;
    left: -200px;
    border-radius: 50%;
    filter: blur(60px);
}

.hero::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary-color) 0%, transparent 70%);
    opacity: 0.1;
    bottom: -150px;
    right: -150px;
    border-radius: 50%;
    filter: blur(60px);
}

.hero-content {
    max-width: 800px;
    z-index: 10;
    animation: fadeIn 1s ease-out;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    line-height: 1.1;
    background: linear-gradient(to right, #fff, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.6);
    color: #fff;
}

/* Sections */
section {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Tutorials & Manuals (Cards) */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.card {
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
}

.card-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.card h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Gallery / Media Grid */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.media-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/9;
    cursor: pointer;
}

.media-item img, .media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.media-item:hover img, .media-item:hover video {
    transform: scale(1.05);
}

.media-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 64, 175, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Allows clicks to pass through to the video */
}

.media-item:hover .media-overlay {
    opacity: 1;
}

.media-item.is-playing .media-overlay {
    opacity: 0 !important;
}

.media-title {
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.media-item:hover .media-title {
    transform: translateY(0);
}

/* Videos section */
.video-container {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--glass-shadow);
    margin-bottom: 2rem;
}

.video-container video {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

/* Footer */
footer {
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid var(--glass-border);
    padding: 3rem 2rem;
    text-align: center;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.partner-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.partner-placeholder {
    width: 150px;
    height: 60px;
    background: var(--glass-bg);
    border: 1px dashed var(--glass-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-weight: bold;
    font-size: 0.8rem;
}

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

.participant-logo {
    max-height: 80px;
    max-width: 100%;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.participant-logo:hover {
    transform: scale(1.05);
}

.footer-logo {
    max-height: 50px;
    max-width: 100%;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px;
    border-radius: 6px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-logo:hover {
    opacity: 1;
}

/* Slider (Difusión) */
.slider-container {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 100%;
}

.slider-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1.5rem;
    padding: 1rem 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
    scroll-behavior: smooth;
    flex: 1;
}

.slider-track::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.slider-item {
    flex: 0 0 calc(33.333% - 1rem); /* Show 3 items at a time */
    min-width: 300px;
    scroll-snap-align: center;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.slider-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.slider-item:hover img {
    transform: scale(1.05);
}

.slider-item:hover .media-overlay {
    opacity: 1;
}

.slider-btn {
    background: var(--glass-bg);
    color: #fff;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 10;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin: 0 0.5rem;
}

.slider-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 900px) {
    .slider-item { flex: 0 0 calc(50% - 1rem); }
}
@media (max-width: 768px) {
    header {
        position: relative !important;
        background: rgba(15, 23, 42, 0.95) !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--glass-border);
        padding: 1rem 0;
    }
    .hero {
        min-height: auto;
        padding: 2.5rem 1.5rem 4rem 1.5rem;
    }
    .hero-content img {
        max-width: 85% !important;
    }
    .nav-links {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(15, 23, 42, 0.96);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        padding: 1.5rem 2rem;
        border-bottom: 1px solid var(--glass-border);
        gap: 1.2rem;
        text-align: center;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links a {
        display: block;
        padding: 0.6rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .nav-links li:last-child a {
        border-bottom: none;
    }

    .mobile-menu-btn {
        display: block;
        font-size: 1.8rem;
        width: 40px;
        height: 40px;
        line-height: 40px;
        text-align: center;
        user-select: none;
        transition: transform 0.2s ease;
    }
    .mobile-menu-btn:active {
        transform: scale(0.9);
    }
}

@media (max-width: 600px) {
    .slider-item { flex: 0 0 85%; min-width: 85%; }
    .slider-btn { display: none; } /* Hide buttons on mobile, user can swipe */
    .slider-track { gap: 1rem; }
    
    .grid-cards {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 1.5rem;
    }
    .grid-cards .card {
        width: 92% !important;
        margin: 0 auto;
    }
    .card {
        padding: 1.5rem 1rem;
    }
    .media-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    .participants-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    section {
        padding: 3rem 1.25rem;
    }
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.1rem;
    }
    .hero p {
        font-size: 1rem;
    }
    .hero p[style*="font-size"] {
        font-size: 1.2rem !important;
    }
}

/* Participantes Grid */
.participants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    text-align: center;
}

.participant-category h3 {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.clickable {
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.clickable:hover {
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.4);
    transform: scale(1.05) translateY(-5px);
}

/* Modals */
.glass-modal {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    color: var(--text-color);
    padding: 0;
    width: 90%;
    max-width: 500px;
    margin: auto;
    max-height: 90vh;
    overflow-y: auto;
}

.glass-modal::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    padding: 2rem;
    position: relative;
    text-align: center;
}

.modal-content h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.modal-content p {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--primary-color);
}

/* Image Modals */
.image-modal {
    background: transparent;
    border: none;
    padding: 0;
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: none;
    overflow: visible;
    margin: auto;
}

.image-modal::backdrop {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.image-modal img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    display: block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.image-modal .close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    line-height: 1;
    z-index: 100;
    transition: background 0.3s ease, color 0.3s ease;
}

.image-modal .close-btn:hover {
    background: rgba(0, 0, 0, 0.85);
    color: var(--primary-color);
}
