﻿/* =========================================
   FUENTES & GENERAL
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: #0d4796;
    font-family: 'Segoe UI', 'Helvetica Neue', sans-serif;
    overflow-x: hidden;
}

/* =========================================
   LAYOUT & ESTRUCTURA
   ========================================= */
.layout {
    display: flex;
    min-height: 100vh;
}

.content {
    flex: 1;
    position: relative;
    /* Fondo original recuperado */
    background: url('../Imagenes/Fondos.jpg') center center / cover no-repeat, linear-gradient(180deg,#0d4796,#0d4796);
    padding: 0;
    min-height: 100vh;
    overflow-y: auto;
}

/* =========================================
   SIDEBAR (Menú Lateral) - Estilo Original
   ========================================= */
.sidebar {
    width: 260px;
    background: #123c8c;
    color: #e6f1ff;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    box-shadow: inset -1px 0 0 rgba(255,255,255,.06);
    position: sticky;
    top: 0;
    left: 0;
    transition: width .35s ease;
    z-index: 1000;
    height: 100vh;
}

.sidebar.collapsed { width: 72px; overflow: hidden; }

/* Marca y Logo */
.brand { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 8px; }
.brand img { height: 72px; }
.brand .title { 
    font-family: 'Press Start 2P', monospace; 
    font-size: 12px; 
    text-align: center; 
    letter-spacing: 1px; 
}
.sidebar.collapsed .brand .title { display: none; }

/* Perfil de Usuario */
.profile { 
    margin: 8px 6px 0; 
    padding: 10px 6px; 
    border-top: 1px solid rgba(255,255,255,.2); 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}
.profile img { 
    width: 40px; height: 40px; 
    border-radius: 50%; 
    object-fit: cover; 
    border: 2px solid rgba(255,255,255,.5); 
}
.profile .info { display: flex; flex-direction: column; line-height: 1.2; }
.profile .name { font-weight: 800; font-size: 14px; }
.profile .role { font-size: 12px; opacity: .9; }
.sidebar.collapsed .profile .info { display: none; }

/* Navegación */
.nav { margin-top: 8px; }
.nav a, .logout a { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    color: #e6f1ff; 
    text-decoration: none; 
    padding: 12px 12px; 
    border-radius: 10px; 
    margin: 3px 0; 
    font-weight: 700; 
    transition: background 0.2s; 
}
.nav a:hover, .logout a:hover { background: #1e6fbf; }
.nav a.active { background: transparent; border-left: 0; box-shadow: inset 4px 0 0 #fff; border-radius: 0; }
.ico { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }

.sidebar.collapsed .nav a { justify-content: center; }
.sidebar.collapsed .nav a .label { display: none; }
.sidebar.collapsed .logout .label { display: none; }
.logout { margin-top: auto; }

/* =========================================
   PANELES Y TARJETAS (Estilo Pixel Art)
   ========================================= */
.panel {
    max-width: 1000px;
    margin: 16px auto 30px;
    background: #1e6fbf; /* Azul medio */
    color: #fff;
    border-radius: 12px;
    /* Sombra fuerte pixelada */
    box-shadow: 0 10px 30px rgba(0,0,0,.2); 
}

.panel .header {
    padding: 18px 24px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-family: 'Press Start 2P', monospace;
}

.panel .body {
    background: #e6f1ff; /* Azul muy claro */
    color: #1b4e9b;
    padding: 20px;
    border-radius: 0 0 12px 12px;
}

/* =========================================
   FORMULARIOS Y INPUTS
   ========================================= */
.row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 20px; }
.row-4 { display: grid; grid-template-columns: 1fr 1.5fr 1fr 0.5fr; gap: 10px; margin-bottom: 20px; align-items: flex-end; }

.item { display: flex; flex-direction: column; }
.item label {
    font-weight: 700;
    margin-bottom: 8px;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: #0d4796;
    text-transform: uppercase;
}

.item input, .item select, .panel input[type=text], .panel input[type=password] {
    padding: 10px;
    border: 2px solid #a7c7ff;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    width: 100%;
}

/* =========================================
   GRILLAS (TABLAS)
   ========================================= */
.grid-box { overflow-x: auto; margin-top: 15px; }

.GridViewStyle {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 4px solid #0d4796; /* Borde grueso */
    box-shadow: 6px 6px #0d4796; /* Sombra sólida pixelada */
    background: #fff;
}

.GridViewStyle th {
    background: #2b65b8;
    color: #1b1b1b;
    padding: 14px;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    border-bottom: 4px solid #0d4796;
    text-align: left;
}

.GridViewStyle td {
    padding: 12px;
    border-bottom: 2px solid #b7cffb;
    background: #ffffff;
    color: #0d4796;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    vertical-align: middle;
}

/* =========================================
   BOTONES (Estilo Pixel Art)
   ========================================= */
/* Botón Verde Principal */
.btn-primary {
    background: #62c554;
    color: #0b3c22;
    border: 4px solid #0b3c22;
    padding: 12px 18px;
    border-radius: 0;
    font-weight: 900;
    cursor: pointer;
    font-family: 'Press Start 2P', monospace;
    box-shadow: 4px 4px #0b3c22;
    text-transform: uppercase;
    font-size: 12px;
}
.btn-primary:active { transform: translate(2px, 2px); box-shadow: 2px 2px #0b3c22; }

/* Botón Rojo (Eliminar/Cancelar) */
.btn-pixel-red {
    background: #ff5b5b;
    color: #3a0b0b;
    border: 4px solid #3a0b0b;
    padding: 12px 18px;
    border-radius: 0;
    font-weight: 900;
    cursor: pointer;
    font-family: 'Press Start 2P', monospace;
    box-shadow: 4px 4px #3a0b0b;
    font-size: 12px;
}
.btn-pixel-red:active { transform: translate(2px, 2px); box-shadow: 2px 2px #3a0b0b; }

/* Botón Azul (Acciones secundarias) */
.btn-pixel-blue {
    background: #1e6fbf;
    color: #fff;
    border: 2px solid #0b3c82;
    box-shadow: 2px 2px #0b3c82;
    padding: 6px 10px;
    font-size: 10px;
    cursor: pointer;
    font-family: 'Press Start 2P';
    text-decoration: none;
    display: inline-block;
}

/* Botones pequeños para grillas */
.btn-xs { padding: 6px 10px; font-size: 10px; box-shadow: 2px 2px #3a0b0b; border: 2px solid #3a0b0b; margin-right: 5px; }
.btn-xs-blue { padding: 6px 10px; font-size: 10px; box-shadow: 2px 2px #0b3c82; border: 2px solid #0b3c82; background: #1e6fbf; color: #fff; cursor: pointer; font-family: 'Press Start 2P'; margin-right: 5px; }

/* =========================================
   UTILIDADES & MOBILE
   ========================================= */
.hamb { position: relative; height: 50px; display: flex; align-items: center; padding: 0 20px; }
.hamb button { background: #ffffff; border: 0; border-radius: 6px; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 4px 6px rgba(0,0,0,.25); cursor: pointer; }

.overlay { display: none; }

@media (max-width: 992px) {
    .row, .row-4 { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); }
    .sidebar.shown { transform: translateX(0); }
    .overlay { position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.45); z-index: 1100; display: none; }
    .overlay.shown { display: block; }
}

/* Force desktop layout on large screens */
@media (max-width: 2000px) {
    #sb.sidebar { position: sticky !important; transform: none !important; }
    #sb.sidebar.shown { transform: none !important; }
}
.overlay, .overlay.shown { display: none !important; }


/* === Copa Casancrem Overrides (auto) === */
:root { --bracket-line: transparent !important; }
.bracket-left .match-box::after,
.bracket-left .column:not(:first-child) .match-box::before,
.bracket-left .column:not(:last-child) .match-box:nth-child(odd)::after,
.bracket-right .match-box::after,
.bracket-right .column:not(:first-child) .match-box::before,
.bracket-right .column:not(:last-child) .match-box:nth-child(odd)::after {
  content: none !important;
  display: none !important;
  background: transparent !important;
  width: 0 !important;
  height: 0 !important;
}
.column::before, .column::after { display: none !important; }
.match-box.bye { background: #ffffff !important; border-color: #aaa !important; border-style: solid !important; }
.bracket-left .column, .bracket-right .column { width: 200px !important; flex: 0 0 200px !important; }
.bracket-left .match-box, .bracket-right .match-box { width: 100% !important; box-sizing: border-box !important; }
/* === End Copa Casancrem Overrides === */
/* === Copa Casancrem Right Side & Fit (auto) === */
.bracket-right .match-box.match-box { text-align: left !important; }
.bracket-right .team-row.team-row { flex-direction: row !important; }
.bracket-right .team-logo.team-logo { margin-right: 6px !important; margin-left: 0 !important; }
.bracket-right .score-input.score-input { margin-left: auto !important; margin-right: 0 !important; }
.bracket-right .team-row span[id$= _txt] { margin-left: 5px !important; margin-right: 0 !important; }

/* Tighten spacing and fit */
.bracket-container .column { margin: 0 10px !important; }
.column.center { width: 200px !important; margin: 0 20px !important; }
.bracket-scaler { transform-origin: center left !important; transform: scale(0.58) !important; }
@media (max-width: 1600px) { .bracket-scaler { transform: scale(0.50) !important; } }
@media (max-width: 1366px) { .bracket-scaler { transform: scale(0.42) !important; } }
.content { overflow-x: hidden !important; }
/* === End Right Side & Fit === */
/* === Copa Casancrem Right Side Fix (auto) === */
/* Quitar escala global y restaurar centro */
.bracket-scaler { transform: none !important; }
.column.center { width: 240px !important; margin: 0 40px !important; }

/* Achicar SOLO el lado derecho */
.bracket-right .column { width: 165px !important; flex: 0 0 165px !important; }
.bracket-right .match-box { width: 100% !important; box-sizing: border-box !important; }
.bracket-right .team-logo { width: 28px !important; height: 28px !important; }
.bracket-right .score-input { width: 22px !important; }
.bracket-right .team-row span[id$= _txt] { font-size: 9px !important; }

/* Evitar scroll horizontal */
.content { overflow-x: hidden !important; }
/* === End Right Side Fix === */
/* === Copa Casancrem Right Side Shrink (auto) === */
.bracket-right .column { width: 150px !important; flex: 0 0 150px !important; min-width: 0 !important; }
.bracket-right .match-box, .bracket-right .team-row, .bracket-right .input-group { min-width: 0 !important; }
.bracket-right .team-logo { width: 26px !important; height: 26px !important; }
.bracket-right .score-input { width: 22px !important; }
.bracket-right .team-row span[id$= _txt] { font-size: 9px !important; display: inline-block; max-width: calc(100% - 60px) !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bracket-right .ddl-custom { width: 100% !important; max-width: 100% !important; }
.bracket-right .input-group { gap: 3px !important; }
.bracket-right .team-row { gap: 4px !important; padding-right: 2px !important; }
/* === End Right Side Shrink === */
/* === Copa Casancrem Right Side Mini (auto) === */
.bracket-right .column { width: 130px !important; flex: 0 0 130px !important; margin: 0 6px !important; }
.bracket-right .match-box { width: 100% !important; box-sizing: border-box !important; padding: 4px 6px !important; }
.bracket-right .team-row { gap: 2px !important; }
.bracket-right .team-logo { width: 22px !important; height: 22px !important; }
.bracket-right .score-input { width: 18px !important; padding: 2px 4px !important; font-size: 10px !important; }
.bracket-right .team-row span[id$= _txt] { font-size: 8px !important; display: inline-block; max-width: calc(100% - 50px) !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bracket-right select, .bracket-right .ddl-custom { font-size: 10px !important; padding: 4px 6px !important; min-width: 0 !important; width: 100% !important; }
@media (max-width: 1600px) { .bracket-right .column { width: 120px !important; flex: 0 0 120px !important; } }
/* === End Right Side Mini === */
