﻿/* ============================================================
   Estilo2.css - Estilos para Master2 (menu Bootstrap)
   ============================================================ */

body {
    font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
    background-color: #f4f6f9;
}

body.master2-dark {
    background-color: #121212;
    color: #e9ecef;
}

/* ---------- AdminLTE wrapper: NO usar overflow:hidden o el dropdown queda cortado ---------- */
.wrapper { overflow: visible !important; }
.sidebar-wrapper { overflow: visible !important; }
.navbar-master2 { position: relative; z-index: 10000; }

/* ---------- Dropdowns Master2 (fondo blanco explícito, alto z-index) ---------- */
.navbar-master2 .dropdown-menu {
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.22);
    padding: 0.5rem 0;
    min-width: 220px;
    z-index: 9999;
}

/* ---------- Navbar principal Master2 ---------- */
.navbar-master2 {
    background-color: #1f4d2e;
    border-bottom: 3px solid #c9a227;
    min-height: 56px;
}

body.master2-dark .navbar-master2,
body.master2-dark .master2-sidenav {
    background-color: #1b1f24;
    border-bottom-color: #3d4654;
}

body.master2-dark .master2-sidenav {
    border-right-color: #3d4654;
}

.navbar-master2 .navbar-nav.flex-column .nav-link {
    display: block;
    width: 100%;
    padding: 0.65rem 0.85rem;
    margin: 0.1rem 0;
    text-align: left;
}

body.master2-dark .navbar-master2 .navbar-brand,
body.master2-dark .navbar-master2 .navbar-nav .nav-link {
    color: #e9ecef;
}

body.master2-dark .navbar-master2 .navbar-nav .nav-link:hover,
body.master2-dark .navbar-master2 .navbar-nav .nav-link:focus,
body.master2-dark .navbar-master2 .navbar-nav .nav-link.show {
    background-color: rgba(255,255,255,0.08);
    color: #ffffff;
}

.navbar-master2 .navbar-nav.flex-column .dropdown-menu {
    position: static;
    float: none;
    width: 100%;
    min-width: 0;
    box-shadow: none;
    border: 1px solid rgba(255,255,255,0.2);
    border-left: 3px solid #c9a227;
    background-color: rgba(255,255,255,0.08);
    margin: 0 0 0.35rem 0.5rem;
}

body.master2-dark .navbar-master2 .navbar-nav.flex-column .dropdown-menu {
    border-color: #3d4654;
    border-left-color: #6ea8fe;
    background-color: #232830;
}

.navbar-master2 .navbar-nav.flex-column .dropdown-menu .dropdown-item {
    color: #ffffff;
    padding: 0.55rem 0.9rem 0.55rem 1rem;
    white-space: normal;
}

body.master2-dark .navbar-master2 .navbar-nav.flex-column .dropdown-menu .dropdown-item {
    color: #e9ecef;
}

.navbar-master2 .navbar-nav.flex-column .dropdown-menu .dropdown-item:hover,
.navbar-master2 .navbar-nav.flex-column .dropdown-menu .dropdown-item:focus {
    background-color: rgba(255,255,255,0.14);
    color: #ffe08a;
}

body.master2-dark .navbar-master2 .navbar-nav.flex-column .dropdown-menu .dropdown-item:hover,
body.master2-dark .navbar-master2 .navbar-nav.flex-column .dropdown-menu .dropdown-item:focus {
    background-color: #2d333d;
    color: #ffffff;
}

.navbar-master2 .navbar-brand {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.navbar-master2 .navbar-brand:hover,
.navbar-master2 .navbar-brand:focus {
    color: #ffe08a;
}

.navbar-master2 .navbar-nav .nav-link {
    color: #ffffff;
    font-weight: 600;
    padding: 0.6rem 1rem;
    border-radius: 0.375rem;
    margin: 0 0.15rem;
}

.navbar-master2 .navbar-nav .nav-link:hover,
.navbar-master2 .navbar-nav .nav-link:focus,
.navbar-master2 .navbar-nav .nav-link.show {
    background-color: rgba(255,255,255,0.15);
    color: #ffe08a;
}

.navbar-master2 .navbar-nav .nav-link.active {
    background-color: #c9a227;
    color: #1f4d2e;
}

/* ---------- Dropdowns (fondo blanco explícito, alto z-index) ---------- */

.navbar-master2 .dropdown-menu .dropdown-item {
    padding: 0.55rem 1.1rem;
    font-weight: 500;
    color: #1f4d2e;
    border-radius: 0.375rem;
    margin: 0 0.35rem;
    background-color: transparent;
}

.navbar-master2 .dropdown-menu .dropdown-item:hover,
.navbar-master2 .dropdown-menu .dropdown-item:focus {
    background-color: #eaf3ec;
    color: #143320;
}

.navbar-master2 .dropdown-menu .dropdown-item.active {
    background-color: #1f4d2e;
    color: #ffffff;
}

.navbar-master2 .dropdown-divider {
    margin: 0.35rem 1rem;
}

/* ---------- Layout Master2 ---------- */
.master2-main {
    padding: 1.5rem 1.25rem 2rem;
}

.master2-footer {
    border-top: 1px solid #dee2e6;
    background: #ffffff;
    padding: 0.85rem 1.25rem;
    color: #6c757d;
    font-size: 0.9rem;
}

body.master2-dark .master2-main {
    background-color: #121212;
}

body.master2-dark .master2-footer {
    border-top-color: #2d333d;
    background: #1b1f24;
    color: #adb5bd;
}

/* ---------- Layout: menú al lado del contenido ---------- */
.master2-sidenav {
    border-bottom: 0;
    border-right: 3px solid #c9a227;
    align-items: flex-start;
    padding-top: 0.35rem;
    padding-bottom: 0.5rem;
}

.master2-sidenav .container-fluid {
    justify-content: flex-start;
}

@media (min-width: 768px) {
    .master2-sidenav {
        width: 250px;
        min-width: 250px;
        min-height: 100vh;
        align-self: stretch;
    }
}

@media (max-width: 767.98px) {
    .master2-sidenav {
        width: 100%;
        border-right: 0;
        border-bottom: 3px solid #c9a227;
    }
    body.master2-dark .master2-sidenav {
        border-bottom-color: #3d4654;
    }
}

/* ---------- Grilla Posiciones - Responsive ---------- */
/* Envoltorio: la tabla no debe sobrepasar el ancho de la página */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    border-radius: 0 0 0.375rem 0.375rem;
}

.grilla-posiciones {
    width: 100%;
    min-width: 0; /* Opción 1: sin scroll, se ajusta al ancho */
    margin-bottom: 0 !important;
    vertical-align: middle;
    table-layout: auto;
}

/* Encabezado */
.grilla-posiciones thead th,
.grilla-posiciones tr:first-child th {
    background-color: #1f4d2e !important;
    color: #ffffff !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 0.65rem 0.5rem !important;
    border-color: #143320 !important;
    text-align: center;
    white-space: nowrap;
}

.grilla-posiciones thead th a {
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Cuerpo */
.grilla-posiciones tbody td,
.grilla-posiciones tr td {
    padding: 0.5rem 0.5rem !important;
    font-size: 0.875rem;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    border-color: #dee2e6 !important;
}

/* Primera columna (Pos) y segunda (Equipo) alineadas a la izquierda / destacadas */
.grilla-posiciones tbody td:first-child {
    font-weight: 700;
    color: #1f4d2e;
    background-color: #eaf3ec !important;
}

.grilla-posiciones tbody td:nth-child(2) {
    text-align: left;
    font-weight: 600;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Filas alternadas */
.grilla-posiciones tbody tr:nth-child(even) td {
    background-color: #f8f9fa !important;
}

.grilla-posiciones tbody tr:hover td {
    background-color: #fff3cd !important;
}

/* Celda de puntaje destacada (última columna) */
.grilla-posiciones tbody td:last-child {
    font-weight: 700;
    color: #1f4d2e;
    background-color: #fff8e1 !important;
}

/* Card AdminLTE para la grilla */
.card.card-primary {
    border-top: 3px solid #c9a227;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.card.card-primary .card-header {
    background-color: #1f4d2e;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding: 0.75rem 1rem;
}

.card.card-primary .card-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
}

/* Tema oscuro Master2 (incluye grilla FrmPrueba) */
body.master2-dark .card.card-primary {
    background-color: #1b1f24;
    border-top-color: #6ea8fe;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
    color: #e9ecef;
}

body.master2-dark .card.card-primary .card-header {
    background-color: #232830;
    border-bottom-color: #3d4654;
}

body.master2-dark .card.card-primary .card-body {
    background-color: #1b1f24;
}

body.master2-dark .table-responsive {
    background-color: #1b1f24;
}

body.master2-dark .grilla-posiciones {
    color: #e9ecef;
    --bs-table-bg: #1b1f24;
    --bs-table-color: #e9ecef;
    --bs-table-border-color: #3d4654;
    --bs-table-striped-bg: #232830;
    --bs-table-striped-color: #e9ecef;
    --bs-table-hover-bg: #2d333d;
    --bs-table-hover-color: #ffffff;
}

body.master2-dark .grilla-posiciones thead,
body.master2-dark .grilla-posiciones thead tr,
body.master2-dark .grilla-posiciones thead th,
body.master2-dark .grilla-posiciones tr:first-child th,
body.master2-dark .grilla-posiciones tr:first-child td,
[data-bs-theme="dark"] body.master2-dark .grilla-posiciones thead th,
[data-bs-theme="dark"] body.master2-dark .grilla-posiciones tr:first-child th {
    background: #0d6efd !important;
    background-color: #0d6efd !important;
    --bs-table-bg: #0d6efd;
    --bs-table-accent-bg: #0d6efd;
    color: #ffffff !important;
    border-color: #0a58ca !important;
}

body.master2-dark .grilla-posiciones thead th.col-destacada,
body.master2-dark .grilla-posiciones tr:first-child th.col-destacada,
body.master2-dark .grilla-posiciones thead th.col-equipo,
body.master2-dark .grilla-posiciones tr:first-child th.col-equipo,
[data-bs-theme="dark"] body.master2-dark .grilla-posiciones thead th.col-destacada,
[data-bs-theme="dark"] body.master2-dark .grilla-posiciones tr:first-child th.col-destacada {
    background: #0d6efd !important;
    background-color: #0d6efd !important;
    --bs-table-bg: #0d6efd;
    --bs-table-accent-bg: #0d6efd;
    color: #ffffff !important;
    border-color: #3d4654 !important;
}

body.master2-dark .grilla-posiciones tbody td,
body.master2-dark .grilla-posiciones tr td {
    background-color: #1b1f24 !important;
    color: #e9ecef !important;
    border-color: #3d4654 !important;
}

body.master2-dark .grilla-posiciones tbody tr:nth-child(even) td {
    background-color: #232830 !important;
}

body.master2-dark .grilla-posiciones tbody tr:hover td {
    background-color: #2d333d !important;
    color: #ffffff !important;
}

body.master2-dark .grilla-posiciones tbody td:first-child {
    color: #9ec5fe;
    background-color: #232830 !important;
}

body.master2-dark .grilla-posiciones tbody td:nth-child(2) {
    color: #f8f9fa;
}

body.master2-dark .grilla-posiciones .col-equipo {
    background-color: #2563eb !important;
    color: #ffffff !important;
    border-color: #3d4654 !important;
}

body.master2-dark .grilla-posiciones thead th.col-equipo,
body.master2-dark .grilla-posiciones tr:first-child th.col-equipo {
    background-color: #2563eb !important;
    color: #ffffff !important;
    border-color: #3d4654 !important;
}

body.master2-dark .grilla-posiciones tbody td:last-child {
    color: #9ec5fe;
    background-color: #202634 !important;
}

/* ---------- Responsive: ajuste en celular (scroll horizontal interno) ---------- */
@media (max-width: 575.98px) {
    .master2-main { padding: 0.75rem 0.25rem 1rem; }
    .master2-content { min-width: 0; max-width: 100%; }
    .grilla-posiciones {
        width: max-content;
        min-width: 100%;
        max-width: none;
        font-size: 0.72rem;
        table-layout: auto;
    }
    .grilla-posiciones thead th,
    .grilla-posiciones tbody td {
        padding: 0.3rem 0.25rem !important;
        font-size: 0.72rem;
        white-space: nowrap;
    }
    .grilla-posiciones tbody td:nth-child(2) {
        max-width: 120px;
        font-size: 0.72rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .grilla-posiciones thead th { font-size: 0.62rem; }
    .card.card-primary .card-title { font-size: 0.9rem; }
}

/* ---------- Responsive: menú apilado/vertical en móvil ---------- */
@media (max-width: 991.98px) {
    .navbar-master2.navbar-expand-lg .navbar-collapse {
        margin-top: 0.35rem;
        border-top: 1px solid rgba(255,255,255,0.15);
        padding-top: 0.35rem;
        max-height: 55vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .navbar-master2.navbar-expand-lg .navbar-nav {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
    }

    .navbar-master2.navbar-expand-lg .navbar-nav .nav-item {
        width: 100%;
    }

    .navbar-master2.navbar-expand-lg .navbar-nav .nav-link {
        display: block;
        width: 100%;
        margin: 0.15rem 0;
        padding: 0.75rem 0.85rem;
        text-align: left;
    }

    .navbar-master2 .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        min-width: 0;
        box-shadow: none;
        border: 1px solid rgba(255,255,255,0.2);
        border-left: 3px solid #c9a227;
        background-color: rgba(255,255,255,0.08);
        margin: 0 0 0.4rem 0.5rem;
        padding: 0.25rem 0;
    }

    .navbar-master2 .dropdown-menu .dropdown-item {
        color: #ffffff;
        margin: 0;
        padding: 0.65rem 0.9rem 0.65rem 1rem;
        border-radius: 0;
        white-space: normal;
    }

    .navbar-master2 .dropdown-menu .dropdown-item:hover,
    .navbar-master2 .dropdown-menu .dropdown-item:focus {
        background-color: rgba(255,255,255,0.14);
        color: #ffe08a;
    }
}
