/* ==================== VARIABLES GLOBALES ==================== */
:root {
    --color-dark: #232323;
    --color-green: #80DA47;
    --color-light-green: #AAE7C9;
    --color-teal: #015144;
    --color-light: #F3F2F2;
    --color-accent: #1CC294;
    --color-dark-bg: #1a1a1a;
    --color-card-bg: #242424;
    --color-success: #4CAF50;
    --color-warning: #FFC107;
    --color-danger: #F44336;
    --color-border: rgba(128, 218, 71, 0.1);
    --color-muted: #9e9e9e;
}

/* ==================== RESET GLOBAL ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==================== BODY ==================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-dark);
    color: var(--color-light);
    min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    transition: width 0.3s ease;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
}

.sidebar.expanded { width: 250px; }
.sidebar.collapsed { width: 70px; }

.sidebar-header {
    padding: 20px;
    background: var(--color-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: var(--color-green);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    color: var(--color-dark);
}

.sidebar-brand {
    margin-left: 15px;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-light);
    display: none;
}

.sidebar.expanded .sidebar-brand { display: block; }

.sidebar-item {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    color: var(--color-light);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    margin: 5px 10px;
    border-radius: 8px;
}

.sidebar-item:hover {
    background: rgba(128, 218, 71, 0.1);
    color: var(--color-green);
}

.sidebar-item.active {
    background: rgba(128, 218, 71, 0.2);
    color: var(--color-green);
}

.sidebar-item i {
    font-size: 20px;
    width: 30px;
    text-align: center;
}

.sidebar-item span {
    margin-left: 15px;
    display: none;
}

.sidebar.expanded .sidebar-item span { display: block; }

.sidebar-toggle {
    position: absolute;
    top: 90px;
    right: -15px;
    width: 30px;
    height: 30px;
    background: var(--color-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-dark);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1001;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 20px 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ==================== CONTEXT SELECTOR ==================== */
.context-selector-container {
    padding: 15px 15px 20px 15px;
    margin-bottom: 10px;
    position: relative;
    min-height: 70px;
}

.context-selector-expanded { display: block; }
.sidebar.collapsed .context-selector-expanded { display: none; }
.context-selector-collapsed { display: none; }
.sidebar.collapsed .context-selector-collapsed { display: flex; justify-content: center; align-items: center; }

.context-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-light);
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.context-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-green);
}

.context-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #1a1a1a;
    border-radius: 10px;
    margin-top: 8px;
    opacity: 0;
}

.context-dropdown.open {
    max-height: 300px;
    opacity: 1;
}

.context-item {
    display: flex;
    align-items: center;
    padding: 10px 15px 10px 25px;
    color: #ccc;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.context-item:hover {
    background-color: rgba(128, 218, 71, 0.1);
    color: #fff;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    background: var(--color-dark);
    padding: 20px;
}

.main-content.expanded { margin-left: 250px; }
.main-content.collapsed { margin-left: 70px; }

/* ==================== CARDS ==================== */
.card {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border: 1px solid rgba(128, 218, 71, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    color: var(--color-light);
}

/* ==================== 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);
}

.group-header {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    padding: 18px 20px;
    border-bottom: 1px solid var(--color-border);
}

.standings-table {
    width: 100%;
    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;
    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 td {
    padding: 14px 10px;
    color: var(--color-light);
    font-size: 0.9rem;
}

.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);
}

.team-name {
    color: var(--color-light);
    font-weight: 400;
    font-size: 0.95rem;
}

.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);
}

/* ==================== UTILIDADES ==================== */
.text-muted { color: #e7e7e7 !important; }
.text-green { color: #80da47 !important; }
.text-light { color: #F3F2F2 !important; }
.text-white { color: #ffffff !important; }

/* ==================== BOTONES ==================== */
.btn-primary {
    background: linear-gradient(135deg, var(--color-green) 0%, var(--color-accent) 100%);
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(128, 218, 71, 0.3);
}

/* ==================== FORMULARIOS ==================== */
.form-control, .form-select {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(128, 218, 71, 0.2);
    color: var(--color-light);
    border-radius: 8px;
    padding: 10px 15px;
}

.form-control:focus, .form-select:focus {
    background: rgba(255,255,255,0.08);
    border-color: var(--color-green);
    box-shadow: 0 0 0 0.2rem rgba(128, 218, 71, 0.25);
    color: var(--color-light);
}

/* ==================== TABLAS ==================== */
.table {
    color: var(--color-light);
}

.table thead th {
    border-bottom: 2px solid var(--color-green);
    color: var(--color-green);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.table tbody tr:hover {
    background: rgba(128, 218, 71, 0.05);
}