/* ==========================================================================
   Variables y Reseteo Base
   ========================================================================== */
:root {
    --bg-main: #131b2f;      /* Azul marino profundo de fondo */
    --bg-card: #ffffff;
    --accent-red: #d32f2f;   /* Rojo de los botones y separadores */
    --text-light: #ffffff;
    --text-dark: #333333;
    --text-muted: #666666;
    
    /* Colores de equipos de ejemplo */
    --team-navy: #002D62;
    --team-orange: #FD5A1E;
    --team-blue: #005A9C;
    --team-teal: #00A3E0;
    --team-red: #BD3039;
    --team-dark-navy: #0B243C;
    --team-maroon: #8A2432;
    --team-light-green: #005C5C;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
    -webkit-touch-callout: none; /* Desactiva menú de pulsación larga en iOS */
    -webkit-user-select: none;   /* Safari */
    -khtml-user-select: none;    /* Konqueror HTML */
    -moz-user-select: none;      /* Firefox */
    -ms-user-select: none;       /* IE/Edge */
    user-select: none;           /* Estándar */
}

img {
    pointer-events: none; /* Evita que las imágenes se puedan arrastrar o guardar */
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

body {
    background-color: var(--bg-main);
    color: var(--text-light);
}

/* Contenedor principal móvil */
.semanaos-app-container {
    max-width: 480px; /* Ancho típico de móvil para el panel */
    margin: 0 auto;
    background-color: var(--bg-main);
    min-height: 100vh;
}

/* ==========================================================================
   Header y Hero
   ========================================================================== */
.hero-header {
    position: relative;
    width: 100%;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.header-bg {
    grid-area: 1 / 1;
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    margin: 0;
}

.hero-content {
    grid-area: 1 / 1;
    z-index: 2;
    padding: 3rem 1.5rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    justify-content: center;
    background: linear-gradient(to bottom, rgba(19, 27, 47, 0.4), rgba(19, 27, 47, 0.8));
}

.logo-wrapper {
    width: 200px;
    margin-bottom: 1rem;
}

.main-logo {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0px;
    margin-top: 20px;
}

.title-de {
    font-weight: 300;
    font-style: italic;
}

/* ==========================================================================
   Controles (Días y Búsqueda)
   ========================================================================== */
.controls-section {
    padding: 1rem 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--bg-main);
}

.day-selector {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.day-btn {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: none;
    background-color: var(--bg-card);
    color: var(--accent-red);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.day-btn.active {
    background-color: var(--accent-red);
    color: var(--text-light);
}

.search-sort-bar {
    display: flex;
    gap: 0.5rem;
}

.search-container {
    flex: 1;
}

.search-input {
    width: 100%;
    padding: 0.8rem 1rem;
    background-color: #ffffff00;
    border: 1px solid #ffffff;
    color: var(--text-light);
    font-size: 16px;
    border-radius: 3px;
    -webkit-appearance: none;
    appearance: none;
}

.search-input::placeholder {
    color: #8899b6;
}

.sort-btn {
    padding: 0.8rem 1rem;
    background-color: var(--bg-card);
    color: var(--text-dark);
    border: none;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

/* ==========================================================================
   Tarjetas de Partidos (Cronograma)
   ========================================================================== */
.schedule-list {
    padding: 0 1rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.match-card {
    background-color: var(--bg-card);
    border: 1px solid #ffffff;
    display: flex;
    height: 80px; /* Altura fija para mantener proporción de recortes */
    overflow: hidden;
    position: relative;
    border-radius: 3px;
}

.match-divider {
    height: 1px;
    width: 100%;
    background-image: linear-gradient(to right, var(--accent-red) 4px, transparent 4px);
    background-size: 6px 1px;
    background-repeat: repeat-x;
    margin: 8px 0; 
}

/* --- Área Visual de los Equipos --- */
.teams-visual {
    width: 45%;
    position: relative;
    overflow: hidden;
}

.team-bg {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-left-bg {
    clip-path: polygon(0 0, calc(50% + 10px) 0, calc(50% - 10px) 100%, 0 100%);
    z-index: 1;
}

.team-right-bg {
    clip-path: polygon(calc(50% + 10px + 1px) 0, 100% 0, 100% 100%, calc(50% - 10px + 1px) 100%);
    z-index: 1;
}

.team-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.team-left-bg .team-logo {
    transform: translateX(-25%);
}

.team-right-bg .team-logo {
    transform: translateX(25%);
}

/* Modificadores de color de equipo basados en tus clases HTML */
.bg-navy { background-color: var(--team-navy); }
.bg-orange { background-color: var(--team-orange); }
.bg-blue { background-color: var(--team-blue); }
.bg-teal { background-color: var(--team-teal); }
.bg-red { background-color: var(--team-red); }
.bg-dark-navy { background-color: var(--team-dark-navy); }
.bg-maroon { background-color: var(--team-maroon); }
.bg-light-green { background-color: var(--team-light-green); }

/* --- El Círculo VS Central --- */
.vs-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    background-color: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.vs-badge span {
    color: var(--text-dark);
    font-weight: 800;
    font-size: 0.75rem;
    font-style: normal;
    line-height: 1;
    text-align: center;
    letter-spacing: -0.02em;
}

/* --- Detalles del Partido (Lado Derecho) --- */
.match-details {
    width: 55%;
    padding: 0.6rem 0.8rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border-left: 1px solid #e6e6e6;
}

.time-location-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.time-badge {
    background-color: #1a263f;
    color: var(--text-light);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
}

.location-text {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.sport-name {
    color: var(--text-dark);
    font-size: 1rem;
    padding: 0.25rem 0rem;
    font-weight: 800;
    margin-bottom: 2px;
    line-height: 1.1;
}

/* ==========================================================================
   Footer Institucional
   ========================================================================== */
.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem 0rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 1rem;
    padding-bottom: 1rem;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    width: 100px;
    height: auto;
}

.footer-info p {
    font-size: 8px;
    color: var(--text-light);
    line-height: 1.4;
    font-weight: 500;
}

.footer-divider-v {
    width: 1px;
    height: 40px;
    background-color: rgba(255,255,255,0.2);
    margin: 0 1rem;
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.social-links {
    display: flex;
    gap: 0.8rem;
}

.social-btn {
    color: var(--text-light);
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
}

.social-btn:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.credits {
    font-size: 0.55rem;
    color: var(--text-muted);
}

.credits a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
}

.credits a:hover {
    text-decoration: underline;
}

/* Ajustes para móviles muy pequeños */
@media (max-width: 400px) {
    .app-footer {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    .footer-left {
        flex-direction: column;
    }
    .footer-divider-v {
        display: none;
    }
    .footer-right {
        align-items: center;
    }
}

/* ==========================================================================
   Botón Scroll to Top
   ========================================================================== */
.scroll-top-btn {
    position: fixed;
    bottom: 50px;
    right: 16px;
    width: 40px;
    height: 40px;
    background-color: var(--bg-main);
    border: 2px solid #ffffff;
    border-radius: 3px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    pointer-events: none;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-top-btn:active {
    background-color: rgba(255,255,255,0.1);
}

.captain-btn {
    position: fixed;
    bottom: 50px;
    left: 16px;
    padding: 10px 20px;
    background-color: var(--bg-main);
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 14px;
    border: 2px solid #ffffff;
    border-radius: 3px;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    pointer-events: none;
    cursor: pointer;
    letter-spacing: 0.5px;
}

.captain-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.captain-btn:active {
    transform: scale(0.95);
}

/* ==========================================================================
   Nuevas Vistas de Participantes (Vertical y All Teams)
   ========================================================================== */

.teams-vertical-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 1rem 0;
    justify-content: center;
}

.team-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 1rem;
}

.team-list-logo-wrap {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px var(--bg-main);
}

.team-list-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-list-logo-wrap span {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    color: #fff;
    font-size: 14px;
}

.team-list-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #111;
}

.team-all-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.team-all-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Modificar match-card para permitir altura dinámica con la lista vertical */
.match-card {
    min-height: 110px;
    height: auto;
}