/* ====================================================
   DIFUTBOL CLUBES - MOBILE APP UI/UX
==================================================== */

:root {
    --primary-color: #38bdf8;
    --primary-dark: #0284c7;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #10b981;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Quita el destello azul en móviles al tocar */
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: 2rem; /* Espacio para el scroll en móviles */
}

/* ------------------------------------
   1. PANTALLA DE CARGA (LOADER)
------------------------------------ */
.loader-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-dark);
    display: flex; justify-content: center; align-items: center;
    z-index: 9999;
    transition: opacity 0.4s ease;
}

.spinner {
    width: 60px; height: 60px;
    border: 6px solid var(--glass-border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* ------------------------------------
   2. CABECERA Y BUSCADOR (APP BAR)
------------------------------------ */
header {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-header {
    display: flex;
    flex-direction: column; /* Apilado en móviles */
    gap: 1rem;
}

.logo {
    display: flex; align-items: center; justify-content: center;
    gap: 0.5rem; font-size: 1.3rem; font-weight: 800; color: var(--primary-color);
}

.search-bar {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.4rem 0.5rem;
    transition: all 0.3s ease;
    width: 100%;
}

.search-bar:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
    background: rgba(255, 255, 255, 0.1);
}

.search-bar input {
    background: transparent; border: none; color: white;
    padding: 0.5rem 1rem; outline: none; width: 100%;
    font-size: 0.95rem; font-weight: 500;
}

.search-bar input::placeholder { color: var(--text-muted); }

.search-bar button {
    background: var(--primary-color); border: none; color: var(--bg-dark);
    width: 42px; height: 42px; border-radius: 50%;
    cursor: pointer; transition: transform 0.2s;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}
.search-bar button:active { transform: scale(0.9); }

/* ------------------------------------
   3. ESTILOS DE CRISTAL (GLASSMORPHISM)
------------------------------------ */
.glass {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
}

/* ------------------------------------
   4. PERFIL DEL CLUB (HERO)
------------------------------------ */
.club-hero {
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(15, 23, 42, 0.8));
    padding: 2rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.club-hero::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.2), transparent 60%);
    pointer-events: none;
}

.club-header {
    display: flex; flex-direction: column; align-items: center; gap: 1rem; position: relative; z-index: 2;
}

.club-badge-container {
    width: 120px; height: 120px;
    display: flex; align-items: center; justify-content: center;
}

.club-badge { width: 100%; height: 100%; object-fit: contain; }

.club-stats { justify-content: center; margin-top: 0.5rem; }
.stat-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; display: block;}
.stat-value { font-size: 1rem; color: var(--primary-color); }

/* ------------------------------------
   5. DISEÑO DE TARJETAS (CARDS)
------------------------------------ */
.card-section {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
}

/* ------------------------------------
   6. RESPONSIVE GRID (PENSADO PARA MÓVIL)
------------------------------------ */
.content-grid {
    display: grid;
    grid-template-columns: 1fr; /* Móvil por defecto: Todo en 1 columna */
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* En tablets horizontales y PC, se divide en 2 columnas */
@media (min-width: 992px) {
    .content-grid { grid-template-columns: 350px 1fr; align-items: start; }
    .nav-header { flex-direction: row; justify-content: space-between; }
    .search-bar { width: 400px; }
    .club-header { flex-direction: row; text-align: left; }
    .club-stats { justify-content: flex-start; }
}

/* ------------------------------------
   7. MODALES (VENTANAS EMERGENTES)
------------------------------------ */
.modal-content {
    background-color: var(--bg-dark) !important;
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.modal-header .btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.8;
}

/* Ajustes de los botones de pestañas del modal (Tabs) para que no se aplasten en móvil */
.nav-pills-custom {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5px !important;
}
.nav-pills-custom::-webkit-scrollbar { display: none; }
.nav-pills-custom .nav-link { white-space: nowrap; }

/* ------------------------------------
   8. UTILIDADES MÓVILES
------------------------------------ */
.hover-scale { transition: transform 0.2s ease, box-shadow 0.2s ease; }
.hover-scale:active { transform: scale(0.96); } /* Efecto de hundimiento al tocar en móvil */

/* Ajuste de scroll suave */
html { scroll-behavior: smooth; }