/* ============================================================================
   1. IMPORTACIÓN DE FUENTES
============================================================================ */

/* Importa fuentes modernas como en React Native */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

/* ============================================================================
   2. RESET Y ESTILOS GLOBALES
============================================================================ */ 

/* AplicAR BOX-SIZING GLOBAL */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Estilos base del cuerpo - TEMA PREMIUM APP */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 400;
    font-style: normal;
    background-color: #0A0E21; /* Fondo marino profundo de la app */
    color: #FFFFFF;
    overflow-x: hidden;
    padding-bottom: 60px;
    /* Patrón de puntos sutil de la app */
    background-image:
        radial-gradient(rgba(0, 229, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    position: relative;
}

/* Efecto de TV retro global - Suavizado */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 229, 255, 0.02) 2px,
        rgba(0, 229, 255, 0.02) 4px
    );
    pointer-events: none;
    z-index: 1;
}

/* Ocultar elementos visualmente accesibles para lectores de pantalla */
.hidden-name {
    visibility: hidden;
    position: absolute;
    height: 0;
    overflow: hidden;
}
.market-title h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: #00E5FF;
  text-align: center;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

/* ============================================================================
   3. TIPOGRAFÍA - ESTILO PREMIUM
============================================================================ */

/* Encabezados */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
    margin: 20px 0;
    padding: 15px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 2;
    font-weight: 700;
}

h1 {
    font-size: 1.8em;
    color: #00E5FF;
    border: none;
    font-weight: 800;
}

h2 {
    font-size: 1.5em;
    color: #FF3D71; /* Rosa moderno de la app */
}

h3 {
    font-size: 1.2em;
    color: #00FF94; /* Verde beneficio de la app */
}

/* Enlaces */
a {
    color: #00E5FF;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

a:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
    transform: scale(1.02);
}

/* ============================================================================
   4. TABLAS - ESTILO GLASSMORPHISM
============================================================================ */

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: rgba(26, 31, 60, 0.8);
    color: #FFFFFF;
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    z-index: 2;
    font-family: 'Inter', sans-serif;
    backdrop-filter: blur(10px);
}

th, td {
    padding: 14px 10px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 229, 255, 0.1);
    background-color: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

th {
    background: rgba(0, 229, 255, 0.1);
    color: #00E5FF;
    text-transform: uppercase;
    font-size: 0.9em;
    font-weight: 700;
    border: none;
}

td {
    background-color: transparent;
}

table tbody tr:hover td {
    background: rgba(0, 229, 255, 0.05);
}

/* Colores para cambios de precios - tema app */
.price-up, .positive-change, .pl-positive {
    color: #00FF94;
}

.price-down, .negative-change, .pl-negative {
    color: #FF3D71;
}

.neutral-change {
    color: #00E5FF;
}

/* ============================================================================
   5. BOTONES - ESTILO PREMIUM
============================================================================ */

/* Estilos generales para botones */
button, .styled-button {
    font-family: 'Inter', sans-serif;
    padding: 14px 24px;
    margin: 10px 5px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #00E5FF;
    color: #0A0E21;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
    position: relative;
    z-index: 2;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
}

button:hover, .styled-button:hover {
    background: #33EBFF;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.4);
    color: #0A0E21;
}

/* Botones específicos */
.btn-positive.styled-button,
.styled-button.buy-button {
    background: #00FF94 !important;
    color: #0A0E21 !important;
    box-shadow: 0 4px 15px rgba(0, 255, 148, 0.3) !important;
}

.btn-negative.styled-button,
.styled-button.short-button {
    background: #FF3D71 !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 15px rgba(255, 61, 113, 0.3) !important;
}

/* ============================================================================
   6. FORMULARIOS Y CAMPOS DE BÚSQUEDA - ESTILO PREMIUM
============================================================================ */

/* Campo de búsqueda */
#sticky-search-input,
#ranking-search-input,
#search-input {
    width: 100%;
    padding: 15px 45px;
    font-size: 15px;
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 16px;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    background: rgba(26, 31, 60, 0.8);
    color: #FFFFFF;
    backdrop-filter: blur(10px);
}

#sticky-search-input:focus,
#ranking-search-input:focus,
#search-input:focus {
    border-color: #00E5FF;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
    outline: none;
}

/* ============================================================================
   7. LAYOUT Y CONTENEDORES - GLASSMORPHISM
============================================================================ */

/* Contenedor principal */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 95%;
    max-width: 1200px;
    margin: auto auto 50px auto;
    padding: 25px;
    background: rgba(26, 31, 60, 0.7);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    position: relative;
    z-index: 2;
}

/* ============================================================================
   9. PARTIDOS (GAMES) - DESPLAZAMIENTO HORIZONTAL
============================================================================ */

.games-scroll-container {
    width: 100%;
    overflow-x: auto;
    display: flex;
    gap: 16px;
    padding: 10px 0 20px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.games-scroll-container::-webkit-scrollbar {
    display: none;
}

.game-card.individual-team-card {
    flex: 0 0 220px;
    height: 130px;
    background: rgba(26, 31, 60, 0.9);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 24px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.game-card.individual-team-card:hover {
    background: rgba(26, 31, 60, 0.95);
    border-color: rgba(0, 229, 255, 0.5);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 229, 255, 0.2);
}

.card-background-logo {
    position: absolute;
    right: -15px;
    bottom: -15px;
    width: 120%;
    height: 120%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: right bottom;
    opacity: 0.25;
    z-index: 1;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26, 31, 60, 0.3) 0%, rgba(26, 31, 60, 0.7) 100%);
    z-index: 2;
}

.card-content {
    position: relative;
    z-index: 3;
    text-align: center;
    width: 100%;
}

.game-card.individual-team-card .team-name {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: #FFFFFF;
    font-size: 16px;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.game-card.individual-team-card .game-time-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(10, 14, 33, 0.5);
    border: 1px solid rgba(0, 229, 255, 0.4);
    padding: 6px 16px;
    border-radius: 100px;
    color: #00E5FF;
    font-size: 12px;
    font-weight: 700;
}

.game-card.individual-team-card .game-time-badge.live {
    background: rgba(255, 61, 113, 0.1);
    border-color: #FF3D71;
    color: #FF3D71;
}

.live-dot {
    width: 8px;
    height: 8px;
    background-color: #FF3D71;
    border-radius: 50%;
    margin-right: 6px;
    display: inline-block;
    box-shadow: 0 0 8px #FF3D71;
}

/* Imagen de fondo sutil para la card de juego */
.game-card .team-bg-logo {
    position: absolute;
    width: 120px;
    height: 120px;
    opacity: 0.1;
    z-index: 0;
    right: -20px;
    bottom: -20px;
    pointer-events: none;
}

/* Contenedor de tarjetas */
.stock-card-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 10px;
    width: 100%;
}

/* Contenedor de la tarjeta de stock - Inspirado en image_1768586453362.png */
.stock-card {
    display: flex;
    align-items: center;
    background: rgba(26, 31, 60, 0.6);
    border: 1px solid rgba(0, 229, 255, 0.15);
    border-radius: 20px;
    padding: 12px 16px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 70px;
}

/* Imagen del stock - Circular con borde */
.stock-image {
    width: 45px;
    height: 45px;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(10, 14, 33, 0.5);
    padding: 4px;
    border: 1px solid rgba(0, 229, 255, 0.2);
    margin-right: 12px;
    flex-shrink: 0;
}

/* Información del stock */
.stock-info {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    gap: 8px;
}

.stock-main-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.stock-title .market-link-text {
    color: #FFFFFF;
    text-decoration: none;
}

.stock-card:active {
    background: rgba(26, 31, 60, 0.9);
    transform: scale(0.98);
}

.stock-symbol {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 10px;
    color: #00E5FF;
    background: rgba(0, 229, 255, 0.1);
    padding: 4px 10px;
    border-radius: 8px;
    display: inline-block;
    flex-shrink: 0;
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.stock-price-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
    justify-content: center;
}

.stock-price-wrapper {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stock-price {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #FFFFFF;
    line-height: 1;
}

@media screen and (max-width: 480px) {
    .stock-card {
        padding: 8px 12px;
        min-height: 60px;
    }
    .stock-info {
        gap: 4px;
    }
    .stock-main-info {
        gap: 4px;
    }
    .stock-title {
        display: block;
        font-size: 11px;
        max-width: 80px;
        margin-bottom: 2px;
    }
    .stock-symbol {
        font-size: 11px;
        padding: 3px 8px;
    }
    .stock-price {
        font-size: 14px;
    }
    .stock-price-wrapper {
        padding: 3px 8px;
    }
    .stock-image {
        width: 36px;
        height: 36px;
        margin-right: 8px;
    }
    .stock-price-info {
        gap: 4px;
    }
    .stock-change-badge {
        padding: 3px 8px;
        font-size: 10px;
        border-radius: 6px;
        min-width: fit-content;
    }
}

.stock-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 4px;
}

.stock-symbol-wrapper {
    flex-shrink: 0;
}

.stock-change-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 12px;
}

.stock-change-badge.positive {
    background: rgba(0, 255, 148, 0.15);
    color: #00FF94;
}

.stock-change-badge.negative {
    background: rgba(255, 61, 113, 0.15);
    color: #FF3D71;
}

/* Flecha lateral opcional */
.stock-card::after {
    content: "〉";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
    display: none; /* Se activa en hover o si hay espacio */
}

@media screen and (min-width: 768px) {
    .stock-card-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
}
