/* components.css - COMPONENTES REUTILIZABLES CON TEMA OSCURO + NFL */
/* VERSIÓN LIMPIA - ELIMINADO CÓDIGO MUERTO */

/* ===== ESTILOS BASE ===== */
* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-primary);
    line-height: 1.6;
}

/* ===== LAYOUT PRINCIPAL - ESTRUCTURA DARKPAN ===== */
.container-fluid {
    background: var(--bg-dark);
}

.sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-primary);
    min-height: 100vh;
}

.content {
    background: var(--bg-dark);
    min-height: 100vh;
}

/* ===== BOTONES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    gap: 8px;
}

.btn-primary {
    background: var(--gradient-gold);
    color: var(--gray-dark);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--gradient-gold);
    color: var(--gray-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--nfl-blue);
}

.btn-secondary:hover {
    background: var(--nfl-blue);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-outline-light {
    border: 2px solid var(--text-primary);
    color: var(--text-primary);
    background: transparent;
}

.btn-outline-light:hover {
    background: var(--text-primary);
    color: var(--bg-dark);
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-primary);
    transition: all var(--transition-normal);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--nfl-blue);
}

.bg-card {
    background: var(--bg-card) !important;
}

.bg-secondary {
    background: var(--bg-secondary) !important;
}

/* ===== FORMULARIOS ===== */
.form-control {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    border-radius: var(--radius-md);
}

.form-control:focus {
    background: var(--bg-secondary);
    border-color: var(--nfl-blue);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(1, 51, 105, 0.25);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* ===== TABLAS DE PRONÓSTICOS ===== */
.prediction-table {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border-primary);
}

.table-header {
    background: var(--nfl-blue);
    color: var(--white);
    padding: var(--space-md);
    text-align: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.table-row {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr auto auto auto !important;
    gap: 1px;
    background: var(--border-primary);
}

.table-row:not(.table-columns-header):nth-child(even) {
    background: var(--bg-secondary);
}

.table-cell {
    background: var(--bg-card);
    padding: var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    color: var(--text-primary);
}

.table-columns-header {
    background: var(--nfl-blue);
    color: var(--white);
    font-weight: 700;
}

.table-columns-header .table-cell {
    background: transparent !important;
    color: var(--white) !important;
}

/* CORRECCIÓN CRÍTICA: RESPONSIVE TABLAS */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
}

/* Logos de equipos en tablas */
.team-logo {
    width: 40px;
    height: 40px;
    margin-right: 12px;
    border-radius: 50%;
    object-fit: cover;
}

.team-name {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

/* ===== COLORES PROTOUCH ===== */
.protouch-L {
    background: rgba(1, 51, 105, 0.2);
    color: var(--nfl-blue);
    font-weight: 700;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--nfl-blue);
}

.protouch-V {
    background: rgba(213, 10, 10, 0.2);
    color: var(--nfl-red);
    font-weight: 700;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--nfl-red);
}

.protouch-D {
    background: rgba(255, 215, 0, 0.2);
    color: var(--gold);
    font-weight: 700;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--gold);
}

/* ===== MENÚ DE USUARIO EN HEADER ===== */
.user-menu-container {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: background-color var(--transition-normal);
    color: var(--text-primary);
}

.user-menu-trigger:hover {
    background-color: var(--bg-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--nfl-blue), var(--nfl-red));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: bold;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-email {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform var(--transition-normal);
    color: var(--text-primary);
}

.user-menu-trigger.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 0.5rem 0;
    z-index: 1000;
    display: none;
}

.user-dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--transition-normal);
    font-size: 0.9rem;
    font-family: var(--font-primary);
}

.dropdown-item:hover {
    background-color: var(--bg-hover);
    color: var(--nfl-blue);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-primary);
    margin: 0.25rem 0;
}

/* ===== SPINNER ===== */
.spinner-border {
    color: var(--nfl-blue);
}

/* ===== BETA BADGE ===== */
.beta-badge {
    display: inline-block;
    background: var(--gradient-gold);
    color: var(--gray-dark);
    padding: 8px 20px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

/* ===== NAVBAR ===== */
.navbar-nav .nav-link {
    color: var(--text-secondary);
    transition: color var(--transition-normal);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--nfl-blue);
}

.navbar-brand {
    color: var(--nfl-blue) !important;
}

/* ===== MODALES ===== */
.tutiradapro-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background: var(--bg-card);
    margin: 10% auto;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    position: relative;
}

.close-modal {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: var(--space-md);
    top: var(--space-md);
}

.close-modal:hover {
    color: var(--text-primary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .table-row {
        grid-template-columns: 1fr 1fr !important;
        grid-template-areas: 
            "team-team team-result"
            "team-vs team-protouch";
    }
    
    .team-name {
        grid-area: team-team;
        justify-content: flex-start;
        padding: var(--space-sm);
    }
    
    .table-cell:nth-child(2) {
        grid-area: team-vs;
        font-size: 0.8rem;
        color: var(--text-muted);
    }
    
    .table-cell:nth-child(4) {
        grid-area: team-result;
        font-weight: 600;
    }
    
    .table-cell:nth-child(5) {
        grid-area: team-protouch;
    }
    
    .table-cell:nth-child(3),
    .table-cell:nth-child(6) {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .team-logo {
        width: 30px;
        height: 30px;
        margin-right: 8px;
    }
}