/* ==================== VARIABLES LOCALES ==================== */
:root {
    --color-dark-bg: #1a1a1a;
    --color-card-bg: #242424;
    --color-card-hover: #2a2a2a;
    --color-success: #4CAF50;
    --color-warning: #FFC107;
    --color-danger: #F44336;
    --color-border: rgba(128, 218, 71, 0.1); /* ✅ NUEVA */
    --color-muted: #9e9e9e; /* ✅ NUEVA */
}

/* ==================== TARJETAS GENERALES CON HOVER ==================== */
.hover-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
}

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(128, 218, 71, 0.2);
}

/* ==================== TARJETAS DE ESTADÍSTICAS ==================== */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1.5rem;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
    text-align: center;
}

.stat-card:hover {
    transform: scale(1.05);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(40%, -40%);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* ==================== TARJETAS DE GRUPOS ==================== */
.group-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.group-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(128, 218, 71, 0.25);
    border-color: var(--color-green);
}

.group-card.user-group {
    border: 2px solid var(--color-green);
    box-shadow: 0 6px 20px rgba(128, 218, 71, 0.35);
    background: linear-gradient(180deg, #242424 0%, rgba(128, 218, 71, 0.05) 100%);
}

/* ==================== HEADER DEL GRUPO ==================== */
.group-header {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    padding: 18px 20px;
    border-bottom: 1px solid var(--color-border);
}

.group-header.user-group-header {
    background: linear-gradient(135deg, rgba(128, 218, 71, 0.2) 0%, rgba(128, 218, 71, 0.1) 100%);
    border-bottom: 1px solid var(--color-green);
}

.group-header h5 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.badge-user-group {
    background: var(--color-green);
    color: #1a1a1a;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

/* ==================== TABLA DE POSICIONES ==================== */
.standings-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.standings-table thead {
    background: rgba(128, 218, 71, 0.08);
}

.standings-table thead th {
    color: var(--color-light-green);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 12px 10px;
    border-bottom: 2px solid rgba(128, 218, 71, 0.2);
}

.standings-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.standings-table tbody tr:hover {
    background: rgba(128, 218, 71, 0.08);
}

.standings-table tbody tr:last-child {
    border-bottom: none;
}

.user-team-row {
    background: linear-gradient(90deg, rgba(128, 218, 71, 0.15) 0%, rgba(128, 218, 71, 0.05) 100%);
    border-left: 3px solid var(--color-green) !important;
}

.user-team-row:hover {
    background: linear-gradient(90deg, rgba(128, 218, 71, 0.25) 0%, rgba(128, 218, 71, 0.1) 100%);
}

.standings-table tbody td {
    padding: 14px 10px;
    color: var(--color-light);
    font-size: 0.9rem;
}

/* ==================== ELEMENTOS DE LA TABLA ==================== */
.position-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(128, 218, 71, 0.15);
    color: var(--color-green);
    font-weight: 700;
    font-size: 0.95rem;
    border: 2px solid rgba(128, 218, 71, 0.3);
}

.user-team-row .position-badge {
    background: var(--color-green);
    color: #1a1a1a;
    border-color: var(--color-green);
}

.team-name {
    color: var(--color-light);
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.4;
}

.user-team-row .team-name {
    color: var(--color-green);
    font-weight: 700;
}

.qualified-badge {
    background: linear-gradient(135deg, var(--color-success) 0%, #66BB6A 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stat-cell {
    color: var(--color-light);
    font-weight: 500;
}

.stat-wins {
    color: var(--color-success);
    font-weight: 600;
}

.stat-draws {
    color: var(--color-warning);
    font-weight: 600;
}

.stat-losses {
    color: var(--color-danger);
    font-weight: 600;
}

.goal-diff-positive {
    color: var(--color-success);
    font-weight: 700;
}

.goal-diff-negative {
    color: var(--color-danger);
    font-weight: 700;
}

.goal-diff-neutral {
    color: var(--color-muted);
    font-weight: 500;
}

.points-cell {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-green);
}

.user-team-row .points-cell {
    color: var(--color-green);
    text-shadow: 0 0 10px rgba(128, 218, 71, 0.5);
}

/* ==================== FOOTER DEL GRUPO ==================== */
.group-footer {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--color-border);
    padding: 12px;
    text-align: center;
}

.group-footer small {
    color: var(--color-muted);
    font-size: 0.8rem;
}

/* ==================== LEYENDA ==================== */
.legend-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 10px;
}

.legend-card .card-body {
    padding: 12px 20px;
}

.legend-item {
    color: var(--color-muted);
    font-size: 0.85rem;
}

.legend-item strong {
    color: var(--color-light);
}

/* ==================== DEBUG CARDS ==================== */
.debug-card {
    background: #1a1a1a;
    border: 2px solid #ff6b6b;
    border-radius: 12px;
}

.debug-card-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px 10px 0 0;
}

.debug-section {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.debug-team-border-user {
    background: #1a1a1a;
    border-left: 3px solid #80da47;
    padding-left: 10px;
}

.debug-team-border-other {
    background: #1a1a1a;
    border-left: 3px solid #555;
    padding-left: 10px;
}

.goal-diff-text-positive {
    color: #4CAF50 !important;
}

.goal-diff-text-negative {
    color: #F44336 !important;
}

.goal-diff-text-neutral {
    color: #9e9e9e !important;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .group-card {
        margin-bottom: 20px;
    }
    
    .standings-table {
        font-size: 0.85rem;
    }
    
    .standings-table thead th {
        padding: 10px 6px;
        font-size: 0.7rem;
    }
    
    .standings-table tbody td {
        padding: 12px 6px;
    }
    
    .team-name {
        font-size: 0.85rem;
    }
    
    .position-badge {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }
}

/* ==================== ANIMACIONES ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.group-card {
    animation: fadeInUp 0.5s ease-out;
}

.group-card:nth-child(1) { animation-delay: 0.1s; }
.group-card:nth-child(2) { animation-delay: 0.2s; }
.group-card:nth-child(3) { animation-delay: 0.3s; }
.group-card:nth-child(4) { animation-delay: 0.4s; }

/* ==================== UTILIDADES DE TABLA ==================== */
.standings-col-position {
    width: 50px;
}

.standings-col-stat {
    width: 40px;
}

.standings-col-diff {
    width: 50px;
}

.standings-col-points {
    width: 55px;
}

.empty-group-message {
    padding: 2rem 0;
    color: var(--color-muted);
}

/* ==================== GRUPOS CONTAINER ==================== */
.groups-container {
    gap: 10rem;
}

/* ==================== DEBUG - ESTILOS ADICIONALES ==================== */
.debug-title {
    color: white;
}

.debug-card-body {
    color: #e0e0e0;
    font-family: 'Courier New', monospace;
}

.debug-section-variables {
    background: #2a2a2a;
    border-left: 4px solid #80da47;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.debug-section-structure {
    background: #2a2a2a;
    border-left: 4px solid #2196F3;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.debug-section-details {
    background: #2a2a2a;
    border-left: 4px solid #FFC107;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.debug-section-diagnosis {
    background: #2a2a2a;
    border-left: 4px solid #F44336;
    border-radius: 8px;
    padding: 15px;
}

.debug-section-title {
    color: #80da47;
    margin-bottom: 15px;
}

.debug-section-title-blue {
    color: #2196F3;
    margin-bottom: 15px;
}

.debug-section-title-yellow {
    color: #FFC107;
    margin-bottom: 15px;
}

.debug-section-title-red {
    color: #F44336;
    margin-bottom: 15px;
}

.debug-table {
    color: #e0e0e0;
    font-size: 0.85rem;
}

.debug-table-label {
    width: 250px;
}

.debug-status-yes {
    color: #4CAF50;
}

.debug-status-no {
    color: #F44336;
}

.debug-status-warning {
    color: #FFC107;
}

.debug-status-muted {
    color: #9e9e9e;
}

.debug-code-block {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
}

.debug-pre {
    color: #80da47;
    margin: 0;
    font-size: 0.8rem;
}

.debug-code {
    color: #80da47;
}

.debug-info-warning {
    color: #FFC107;
    margin-bottom: 8px;
}

.debug-info-muted {
    color: #9e9e9e;
    font-size: 0.85rem;
}

.debug-group-container {
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.debug-group-header {
    background: #333;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.debug-group-name {
    color: #80da47;
    margin: 0;
}

.debug-user-group-badge {
    color: #4CAF50;
    font-weight: 700;
}

.debug-properties-table {
    color: #e0e0e0;
    font-size: 0.8rem;
}

.debug-prop-key {
    width: 200px;
    background: #2a2a2a;
}

.debug-standings-container {
    background: #0d0d0d;
    border: 1px dashed #666;
    border-radius: 4px;
    padding: 15px;
    margin-top: 15px;
}

.debug-standings-title {
    color: #2196F3;
    margin-bottom: 10px;
}

.debug-standing-item {
    background: #1a1a1a;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.debug-standing-header {
    color: #80da47;
    font-weight: 700;
    margin-bottom: 8px;
}

.debug-current-team-badge {
    color: #4CAF50;
}

.debug-standing-stats {
    font-size: 0.75rem;
    color: #e0e0e0;
}

.debug-stat-key {
    width: 180px;
}

.debug-stat-wins {
    color: #4CAF50;
}

.debug-stat-draws {
    color: #FFC107;
}

.debug-stat-losses {
    color: #F44336;
}

.debug-points-key {
    font-weight: bold;
}

.debug-points-value {
    color: #4CAF50;
    font-weight: 700;
    font-size: 1.1rem;
}

.debug-warning-inline {
    color: #F44336;
    font-weight: 700;
}

.debug-details {
    margin-top: 10px;
}

.debug-summary {
    color: #2196F3;
    cursor: pointer;
    font-size: 0.8rem;
}

.debug-json-pre {
    background: #000;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 0.7rem;
    color: #80da47;
    margin-top: 5px;
}

.debug-alert-error {
    margin-top: 10px;
}

.debug-diagnosis-content {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 6px;
}

.debug-problem-detected {
    border-left: 4px solid #F44336;
}

.debug-problem-title {
    color: #F44336;
}

.debug-problem-list {
    margin-bottom: 0;
    color: #e0e0e0;
}

.debug-causes-box {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
}

.debug-causes-title {
    color: #FFC107;
}

.debug-causes-list {
    color: #e0e0e0;
    font-size: 0.9rem;
}

.debug-solution-box {
    background: #1a3a1a;
    border: 1px solid #4CAF50;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.debug-solution-title {
    color: #4CAF50;
}

.debug-solution-list {
    color: #e0e0e0;
    font-size: 0.9rem;
}

.debug-data-ok {
    border-left: 4px solid #4CAF50;
}

.debug-ok-title {
    color: #4CAF50;
}

.debug-ok-message {
    margin-bottom: 0;
    color: #e0e0e0;
}

.debug-empty-standings,
.debug-no-groups {
    border-left: 4px solid #FFC107;
}

.debug-empty-message,
.debug-no-groups-message {
    margin-bottom: 0;
}