/* --- Variables y Reset --- */
:root {
    --primary-blue: #002D62; /* Azul Bandera Profundo */
    --primary-red: #CE1126;  /* Rojo Bandera Vibrante */
    --accent-dark: #1a1a1a;
    --text-light: #f4f4f4;
    --text-dark: #333333;
    --gray-bg: #f0f2f5;
    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    line-height: 1.6;
    background-color: #fff;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Botones --- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
}
.btn-primary:hover { background-color: #001f44; }

.btn-accent {
    background-color: var(--primary-red);
    color: white;
}
.btn-accent:hover { background-color: #a30d1d; transform: translateY(-3px); }

.btn-outline {
    border: 2px solid white;
    color: white;
    background: transparent;
}
.btn-outline:hover { background: white; color: var(--primary-blue); }

.btn-dark {
    background-color: var(--accent-dark);
    color: white;
}

/* --- Navbar --- */
.navbar {
    background-color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.logo-sub {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-red);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links li a {
    font-weight: 600;
    color: var(--primary-blue);
    font-size: 0.95rem;
    text-transform: uppercase;
}
.nav-links li a.btn {
    color: white; 
}
.nav-links li a:hover { color: var(--primary-red); }

.hamburger { display: none; font-size: 1.5rem; cursor: pointer; }

/* --- Hero Section --- */
.hero {
    height: 85vh;
    background-image: url('https://pool.jyrsolutions.com/img/home.jpg?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    text-align: center;
}

.overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Degradado Dominicano: Azul a Rojo con transparencia */
    background: linear-gradient(135deg, rgba(0, 45, 98, 0.85), rgba(206, 17, 38, 0.7));
}

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 5rem;
    line-height: 1.1;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.text-red { color: #ff4d4d; /* Un rojo más claro para resaltar sobre fondo oscuro */ }

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px auto;
    font-weight: 300;
}

.hero-buttons { display: flex; gap: 20px; justify-content: center; }

/* --- Location Finder Bar --- */
.location-finder {
    background-color: var(--primary-blue);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: -5px; /* Eliminar espacio blanco */
}

.location-finder .container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.location-finder h3 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-size: 1.5rem;
}

/* --- Stats Section (Style Challenge) --- */
.stats-section {
    padding: 5rem 0;
    background-color: var(--gray-bg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: left;
}

.stat-box {
    background: white;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border-bottom: 5px solid var(--primary-red);
    transition: transform 0.3s;
}

.stat-box:hover { transform: translateY(-5px); }

.stat-box h2 {
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--primary-blue);
    line-height: 1;
}

.stat-box p {
    font-weight: 700;
    text-transform: uppercase;
    margin: 10px 0 5px 0;
    font-size: 1.1rem;
}

.stat-box .sub-text {
    font-size: 0.9rem;
    color: #666;
}

/* --- News Section --- */
.news-section { padding: 5rem 0; }
.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    text-transform: uppercase;
    color: var(--primary-blue);
    margin-bottom: 2rem;
    text-align: center;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.news-card {
    background: white;
    border: 1px solid #eee;
}

.news-img {
    height: 200px;
    background-size: cover;
    background-position: center;
}

.news-content { padding: 20px; }
.news-content .date { font-size: 0.8rem; color: var(--primary-red); font-weight: 700; }
.news-content h3 { margin: 10px 0; font-size: 1.3rem; color: var(--primary-blue); }
.read-more {
    display: inline-block;
    margin-top: 15px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent-dark);
}

/* --- Host Section (B2B) --- */
.host-section {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('https://pool.jyrsolutions.com/img/trofeo.jpeg?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-attachment: fixed;
    padding: 6rem 0;
    color: white;
    text-align: center;
}
.logo-img {
    height: 45px;       /* Altura igual al texto anterior para no descuadrar */
    width: auto;        /* Mantiene la proporción original de la imagen */
    display: block;     /* Evita espacios extra debajo de la imagen */
    margin-bottom: 5px; /* Pequeño espacio entre el logo y el texto de abajo */
    object-fit: contain; /* Asegura que la imagen se vea completa */
}

/* Aseguramos que el contenedor alinee todo a la izquierda */
.logo {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start; 
}
.host-content h2 {
    font-family: var(--font-heading);
    font-size: 3rem;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.host-content p {
    max-width: 600px;
    margin: 0 auto 2rem auto;
    font-size: 1.2rem;
}

/* --- Footer --- */
.footer {
    background-color: #0f172a; /* Azul muy oscuro */
    color: white;
    padding: 4rem 0 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand h2 { font-family: var(--font-heading); font-size: 2rem; color: var(--primary-red); }
.footer-links ul li { margin-bottom: 10px; }
.footer-links ul li a { color: #ccc; }
.footer-links ul li a:hover { color: white; padding-left: 5px; }

.footer-social a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    margin-right: 10px;
    transition: 0.3s;
}
.footer-social a:hover { background: var(--primary-blue); }

.footer-bottom {
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
    color: #888;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hamburger { display: block; }
    .hero h1 { font-size: 3rem; }
    .hero-buttons { flex-direction: column; }
    .btn { width: 100%; text-align: center; }
}


/* Botón sutil para ver resultados */
.btn-closed { 
    background: white; 
    color: #555; 
    border: 1px solid #ccc; 
    padding: 8px 15px; 
    border-radius: 5px; 
    text-decoration: none; 
    font-size: 0.9rem;
    transition: 0.2s;
}
.btn-closed:hover {
    background: #f0f0f0;
    color: #333;
    border-color: #bbb;
}

/* Header de Pagina */
.page-header {
    background: #1a1a1a;
    color: white;
    padding: 4rem 0 2rem;
    text-align: center;
    border-bottom: 3px solid #e63946;
}

/* Grid de Torneos */
.tournaments-section { padding: 50px 0; background: #f4f4f4; }
.tournament-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* Tarjetas */
.tournament-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
    border: 1px solid #ddd;
}
.tournament-card:hover { transform: translateY(-5px); border-color: #e63946; }

.card-header {
    background: #222;
    padding: 15px;
    display: flex;
    justify-content: space-between;
}
.badge { padding: 5px 10px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; text-transform: uppercase; }
.status-open { background: #2ecc71; color: white; }
.status-closed { background: #95a5a6; color: white; }
.type-badge { color: #ccc; font-size: 0.9rem; }

.card-body { padding: 20px; }
.card-body h3 { font-family: 'Oswald', sans-serif; margin-bottom: 15px; font-size: 1.4rem; }
.meta-info p { color: #666; margin-bottom: 5px; font-size: 0.95rem; }
.prize-info { margin-top: 15px; padding-top: 15px; border-top: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.prize-info strong { color: #e63946; font-size: 1.1rem; }

.card-footer { background: #f9f9f9; padding: 15px; text-align: center; }
.btn-card { background: none; border: none; color: #1a1a1a; font-weight: bold; cursor: pointer; }

/* MODAL STYLES */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0; top: 0; 
    width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}
.modal-content {
    background-color: #fefefe;
    margin: 5% auto; 
    padding: 0;
    border: 1px solid #888;
    width: 90%; max-width: 800px;
    border-radius: 8px;
    position: relative;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown { from {top: -50px; opacity: 0;} to {top: 0; opacity: 1;} }

.close-modal {
    color: #aaa; float: right; font-size: 28px; font-weight: bold; margin: 10px 20px; cursor: pointer;
}
.close-modal:hover { color: #000; }

/* Estilos dentro de la ficha (Modal) */
.ficha-header { background: #1a1a1a; color: white; padding: 20px; border-radius: 8px 8px 0 0; display: flex; justify-content: space-between; align-items: center; }
.ficha-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; padding: 20px; }
.premios-box { background: #f8f9fa; padding: 15px; border-radius: 8px; margin-top: 20px; }
.premio-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #eee; }
.gold { color: #d4af37; font-weight: bold; }

.team-list { list-style: none; padding: 0; max-height: 300px; overflow-y: auto; }
.team-list li { padding: 10px; border-bottom: 1px solid #eee; display: flex; align-items: center; gap: 10px; }
.ficha-actions { padding: 20px; text-align: center; border-top: 1px solid #eee; }

@media (max-width: 768px) {
    .ficha-grid { grid-template-columns: 1fr; }
}
/* Estilos Específicos para el contenido del Modal cargado vía AJAX */
.ficha-header {
    background: #0f1e3d !important; /* Azul Navy */
    color: white;
    padding: 30px;
    border-bottom: 4px solid #d90429; /* Rojo */
}

.ficha-header h2 {
    font-family: 'Oswald', sans-serif;
    margin: 0;
    font-size: 2rem;
}

.premios-box h3 {
    color: #0f1e3d;
    border-bottom: 2px solid #d90429;
    padding-bottom: 10px;
    display: inline-block;
}

.gold { color: #d90429; font-weight: 800; font-size: 1.1rem; } /* Rojo para resaltar el 1ro */
.silver, .bronze { color: #555; }

.btn-primary {
    background-color: #0f1e3d;
    border: none;
    padding: 12px 25px;
    color: white;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    transition: all 0.3s;
}
.btn-primary:hover {
    background-color: #d90429;
    box-shadow: 0 5px 15px rgba(217, 4, 41, 0.4);
}
