/* ============================================
   RESET Y CONFIGURACIÓN BASE
   ============================================ */

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

:root {
    --primary-color: #FF6D00; /* Naranja vibrante (estilo McLaren/KTM), neutral pero muy deportivo */
    --secondary-color: #121212; /* Gris grafito muy oscuro, evita el negro puro */
    --accent-color: #FF9100; /* Naranja más claro para brillos */
    --text-dark: #E0E6EB; /* Gris claro para el texto principal sobre fondos oscuros */
    --text-light: #A9B0B8; /* Gris medio para texto secundario o menos prominente */
    --background-light: #1E1E1E; /* Gris oscuro para fondos de secciones o tarjetas */
    --white: #F8F9FA; /* Blanco roto para elementos que necesitan contraste */
    --black: rgba(0, 0, 0, 0.7); /* Negro semitransparente para superposiciones */
    --shadow: rgba(0, 0, 0, 0.4); /* Sombra más pronunciada para dar profundidad */
    --gradient: linear-gradient(135deg, #E65100 0%, #FF9100 100%); /* Gradiente naranja deportivo */
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --modal-background: rgba(0, 0, 0, 0.9); /* Fondo oscuro para el modal, para que las imágenes resalten más */
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
    background-color: var(--secondary-color);
}

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

h4 {
    font-size: 1.25rem;
    font-weight: 500;
}

p {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

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

/* ============================================
   LOADING SCREEN
   ============================================ */

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1C2025 0%, #0B0F14 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader {
    text-align: center;
}

.camera-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.loader p {
    font-size: 1.1rem;
    color: var(--text-dark);
    font-weight: 500;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* ============================================
   HEADER Y NAVEGACIÓN
   ============================================ */

.header {
    background-color: var(--secondary-color);
    box-shadow: 0 2px 10px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

.logo-image-wrapper {
    position: relative;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Asegura que la imagen completa sea visible sin distorsión */
}

.logo i {
    font-size: 1.8rem;
}

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

.nav-link {
    color: var(--text-dark);
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

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

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    margin: 5px 0;
    transition: var(--transition);
    border-radius: 2px;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    background: var(--gradient);
    color: var(--secondary-color);
    padding: 80px 20px;
    text-align: center;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none"><path d="M0,60 C300,120 300,0 600,60 C900,120 900,0 1200,60 L1200,120 L0,120 Z" fill="rgba(255,255,255,0.05)"/></svg>');
    background-repeat: repeat-x;
    animation: wave 15s linear infinite;
    opacity: 0.3;
}

@keyframes wave {
    0% { transform: translateX(0); }
    100% { transform: translateX(1200px); }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    opacity: 0.9;
    font-weight: 300;
    line-height: 1.8;
}

.cta-button {
    display: inline-block;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    padding: 12px 35px;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid var(--secondary-color);
}

.cta-button:hover {
    background-color: transparent;
    color: var(--secondary-color);
    transform: translateY(-2px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   EVENTS SECTION
   ============================================ */

.events-section {
    padding: 60px 20px;
    background-color: var(--background-light);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

/* ============================================
   SEARCH Y FILTERS
   ============================================ */

.search-filters-container {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-bar {
    flex: 1;
    min-width: 250px;
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px var(--shadow);
    padding: 0 15px;
}

.search-bar i {
    color: var(--text-light);
    font-size: 1rem;
}

#search-input {
    flex: 1;
    border: none;
    padding: 12px 10px;
    outline: none;
    width: 250px;
    font-family: inherit;
    font-size: 0.95rem;
    background-color: transparent;
    color: var(--text-dark);
}

.search-container {
    display: flex;
    align-items: center;
    background-color: var(--background-light);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px var(--shadow);
    padding: 0 15px;
}

.search-input {
    border: none;
    padding: 12px 10px;
    outline: none;
    width: 250px;
    font-family: inherit;
    font-size: 0.95rem;
    background-color: transparent;
    color: var(--text-dark);
}

.filter-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: var(--background-light);
    padding: 0 15px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px var(--shadow);
}

.filter-select {
    border: none;
    padding: 12px 10px;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    background-color: transparent;
    color: var(--text-dark);
}

/* ============================================
   EVENTS GRID
   ============================================ */

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

.event-card {
    background-color: var(--background-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.6s ease both;
}

.event-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.event-thumbnail {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.event-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.event-card:hover .event-thumbnail img {
    transform: scale(1.05);
}

.event-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    color: var(--white);
}

.event-category {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    width: fit-content;
}

.event-date {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
}

.event-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.event-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    line-height: 1.3;
}

.event-card-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.event-card-location i {
    color: var(--primary-color);
}

.event-card-summary {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.5;
    flex: 1;
}

.event-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.85rem;
    color: var(--text-light);
}

.event-card-athlete {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.event-card-athlete i {
    color: var(--primary-color);
}

.event-gallery-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.event-gallery-count i {
    color: var(--accent-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-light);
}

/* ============================================
   EVENT MODAL
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-background);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-content {
    background-color: var(--background-light);
    border-radius: var(--border-radius);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
    z-index: 10;
}

.modal-close:hover {
    background-color: var(--accent-color);
    transform: rotate(90deg);
}

.modal-header {
    padding: 2rem;
    background: var(--gradient);
    color: #1C2025; /* Letras oscuras sobre gradiente claro */
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #1C2025;
}

.event-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: rgba(28, 32, 37, 0.8);
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
}

.metadata-item i {
    font-size: 1rem;
    color: var(--background-light);
}

.modal-description {
    padding: 2rem;
    border-bottom: 1px solid var(--shadow);
}

.modal-description p {
    color: var(--text-dark);
    line-height: 1.8;
}

.modal-gallery {
    padding: 2rem;
    position: relative;
}

.modal-image-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-image {
    max-width: 100%;
    max-height: 500px;
    border-radius: var(--border-radius);
    object-fit: contain;
    background-color: var(--background-light);
}

.modal-image-counter {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--white);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.modal-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-prev,
.modal-next {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
}

.modal-prev:hover,
.modal-next:hover {
    background-color: var(--accent-color);
    transform: scale(1.1);
}

/* ============================================
   CONTACT SECTION
   ============================================ */

.contact-section {
    padding: 80px 20px;
    background-color: var(--secondary-color);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

.contact-info h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.contact-info p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    color: var(--primary-color);
    transition: var(--transition);
}

.contact-link:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--text-light);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    background-color: var(--background-light);
    color: var(--text-dark);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 128, 0, 0.1);
}

.submit-button {
    background: var(--gradient);
    color: var(--secondary-color);
    padding: 12px 30px;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 3rem 20px 1rem;
}

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

.footer-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--background-light);
    color: var(--text-dark);
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 900px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        box-shadow: 0 10px 27px var(--shadow);
        z-index: 1000;
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .search-filters-container {
        flex-direction: column;
    }

    .search-bar {
        width: 100%;
    }

    .filters-container {
        width: 100%;
    }

    .events-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 1.5rem;
    }

    .modal-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .hero {
        padding: 60px 20px;
        min-height: 400px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .events-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .event-card {
        margin-bottom: 1rem;
    }

    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .modal-image {
        max-height: 300px;
    }

    .event-metadata {
        gap: 0.5rem;
    }

    .metadata-item {
        font-size: 0.85rem;
    }

    .logo .logo-text {
        display: none;
    }

    .logo {
        font-size: 1.2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.25rem;
    }

    .cta-button {
        padding: 10px 25px;
        font-size: 0.9rem;
    }

    .search-bar {
        min-width: 100%;
    }

    .event-card-content {
        padding: 1rem;
    }

    .modal-nav {
        gap: 0.5rem;
    }

    .modal-prev,
    .modal-next {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .contact-details {
        gap: 0.75rem;
    }

    .footer-content {
        gap: 1.5rem;
    }
}

/* ============================================
   ANIMACIONES ADICIONALES
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.event-card:nth-child(1) { animation-delay: 0.1s; }
.event-card:nth-child(2) { animation-delay: 0.2s; }
.event-card:nth-child(3) { animation-delay: 0.3s; }
.event-card:nth-child(n+4) { animation-delay: 0.4s; }
