@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

html, body {
    font-family: 'Poppins', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Etiquetas de los controles de formulario */
.form-label {
    font-weight: 600;
    color: #3b5998;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42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em 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ======================= */
/* SCROLLBAR PERSONALIZADO */
/* ======================= */

/* Scrollbar general para navegadores Webkit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Scrollbar para el sidebar (fondo oscuro) */
.nav-scrollable::-webkit-scrollbar {
    width: 6px;
}

.nav-scrollable::-webkit-scrollbar-track {
    background: transparent;
}

.nav-scrollable::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.nav-scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Scrollbar para el sidebar en Firefox */
.nav-scrollable {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* Scrollbar general en Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* ======================= */
/* ESTILOS GRID GENERICOS  */
/* ======================= */

/* Header del DataGrid con color del menú principal */
.dark-grid .mud-table-head {
    background: linear-gradient(180deg, #0a0a0a 0%, #4a0508 100%) !important;
}

.dark-grid .mud-table-head th,
.dark-grid .mud-table-head .mud-table-cell {
    color: white !important;
    font-weight: 600 !important;
    background: transparent !important;
}

.dark-grid .mud-table-head .mud-table-cell .mud-icon-root,
.dark-grid .mud-table-head .mud-sort-icon {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Footer/Pager del DataGrid */
.dark-grid .mud-table-pagination {
    background: linear-gradient(180deg, #0a0a0a 0%, #4a0508 100%) !important;
    color: white !important;
    border-top: none !important;
}

.dark-grid .mud-table-pagination .mud-table-pagination-caption,
.dark-grid .mud-table-pagination .mud-table-pagination-select,
.dark-grid .mud-table-pagination .mud-select-input,
.dark-grid .mud-table-pagination .mud-input,
.dark-grid .mud-table-pagination .mud-input-control,
.dark-grid .mud-table-pagination p {
    color: white !important;
}

.dark-grid .mud-table-pagination .mud-icon-button {
    color: white !important;
}

.dark-grid .mud-table-pagination .mud-icon-button:disabled {
    color: rgba(255, 255, 255, 0.3) !important;
}

/* ======================= */
/* FIX: Ancho del dropdown Rows Per Page en paginacion */
/* ======================= */
.mud-table-pagination-toolbar .mud-table-pagination-select {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: 90px !important;
}
.mud-table-pagination-toolbar .mud-table-pagination-select .mud-input-control {
    width: 80px !important;
}
.mud-table-pagination-toolbar .mud-table-pagination-select .mud-input-slot {
    width: 60px !important;
}

.dark-grid .mud-table-pagination .mud-select .mud-icon-root {
    color: white !important;
}

/* Paginador del MudDataGrid */
.dark-grid .mud-table-pagination-toolbar {
    background: linear-gradient(180deg, #0a0a0a 0%, #4a0508 100%) !important;
    color: white !important;
}

.dark-grid .mud-table-pagination-toolbar p,
.dark-grid .mud-table-pagination-toolbar .mud-table-pagination-display {
    color: white !important;
}

.dark-grid .mud-table-pagination-actions .mud-icon-button {
    color: white !important;
}

.dark-grid .mud-table-pagination-actions .mud-icon-button:disabled {
    color: rgba(255, 255, 255, 0.3) !important;
}

/* Footer del DataGrid */
.dark-grid .mud-table-footer {
    background: linear-gradient(180deg, #0a0a0a 0%, #4a0508 100%) !important;
}

.dark-grid .mud-table-foot {
    background: linear-gradient(180deg, #0a0a0a 0%, #4a0508 100%) !important;
}

.dark-grid .mud-table-foot td {
    color: white !important;
    background: transparent !important;
}

/* ======================= */
/* LÍNEAS VERTICALES GRID  */
/* ======================= */

.grid-vertical-lines .mud-table-head th {
    border-right: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.grid-vertical-lines .mud-table-head th:last-child {
    border-right: none !important;
}

.grid-vertical-lines .mud-table-body td {
    border-right: 1px solid #e0e0e0 !important;
}

.grid-vertical-lines .mud-table-body td:last-child {
    border-right: none !important;
}

/* ======================= */
/* RESPONSIVE ANCHO TOTAL  */
/* Para pantallas <= 1366px */
/* ======================= */

@media screen and (max-width: 1366px) {
    /* Layout wrapper sin límite */
    .content-wrapper,
    article.content-wrapper,
    .main-content .content-area .content-wrapper {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
    }

    /* Área de contenido con menos padding */
    .content-area,
    .main-content .content-area {
        padding: 0.75rem !important;
    }

    /* MudContainer de MudBlazor sin límite */
    .mud-container,
    .mud-container-maxwidth-xl,
    .mud-container-maxwidth-lg,
    .mud-container-maxwidth-md {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* DataGrid responsive */
    .mud-table,
    .mud-data-grid {
        max-width: 100% !important;
        overflow-x: auto !important;
    }

    .mud-table-container {
        max-width: 100% !important;
    }

    /* Evitar scroll horizontal en el body */
    body {
        overflow-x: hidden !important;
    }

    /* Paper sin desbordamiento */
    .mud-paper {
        max-width: 100% !important;
        overflow-x: auto !important;
    }
}

/* ======================= */
/* PREVENIR SCROLL GLOBAL  */
/* ======================= */

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Asegurar que el contenido principal no desborde */
.main-content,
.content-area {
    overflow-x: hidden;
    max-width: 100%;
}

/* DataGrid siempre ajustado */
.mud-table {
    table-layout: auto;
}

.mud-table-cell {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* MudSelect / MudAutocomplete popup auto-width */
.mud-popover-auto-width {
    width: auto !important;
    min-width: unset !important;
}

/* ============================================================
   JuegoCard — estilos del componente compartido (Home, Calendario, etc.)
   ============================================================ */
.game-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}
.game-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: #c7d2fe;
}
.game-card:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }

.game-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.status-final { background: linear-gradient(90deg, #334155, #475569); color: white; }
.status-live  { background: linear-gradient(90deg, #003309, #0a4d17); color: white; }
.status-preview { background: linear-gradient(90deg, #4f46e5, #6366f1); color: white; }

.game-status { display: flex; align-items: center; }
.game-time { font-weight: 700; }

.live-dot {
    display: inline-block; width: 8px; height: 8px;
    background: #fff; border-radius: 50%;
    margin-right: 0.35rem;
    animation: jc-pulse 1.2s ease-in-out infinite;
    vertical-align: middle;
}
@keyframes jc-pulse { 50% { opacity: 0.4; } }

.game-refresh-btn {
    margin-left: 0.5rem;
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.35);
    color: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease;
}
.game-refresh-btn:hover:not(:disabled) { background: rgba(255,255,255,0.35); }
.game-refresh-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.game-refresh-btn i { font-size: 0.9rem; }
.game-refresh-btn .spin { animation: jc-spin 0.8s linear infinite; }
@keyframes jc-spin { to { transform: rotate(360deg); } }

.game-body { padding: 0.5rem 0.75rem; display: flex; flex-direction: column; gap: 0.3rem; }

.team-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.3rem;
    border-radius: 6px;
    transition: background 0.2s ease;
}
.team-row.team-winner { background: rgba(16, 185, 129, 0.08); }
.team-row.team-winner .team-score,
.team-row.team-winner .team-name { color: #059669; font-weight: 700; }
.team-row.team-loser { opacity: 0.6; }

.team-info { display: flex; align-items: center; gap: 0.4rem; flex: 1; min-width: 0; }
.team-logo {
    width: 38px; height: 38px;
    object-fit: contain;
    border-radius: 6px;
    background: #f8fafc;
    flex-shrink: 0;
}
.team-logo-placeholder {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white; font-size: 0.8rem; font-weight: 700;
    letter-spacing: 0.3px;
}
.team-text { display: flex; flex-direction: column; min-width: 0; }
.team-name {
    font-size: 1rem; font-weight: 600; color: #1e293b;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.team-record { font-size: 0.8rem; color: #94a3b8; }
.team-score {
    font-size: 1.5rem; font-weight: 700; color: #1e293b;
    min-width: 32px; text-align: right;
}

.game-footer {
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.85rem; color: #64748b;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.game-footer span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-footer i { color: #4f46e5; }

/* Footer de pitchers (W/L/SV) en juegos finalizados */
.pitchers-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
}
.pitcher-line {
    display: flex; align-items: center; gap: 0.4rem;
    line-height: 1.15; font-size: 0.85rem; flex-wrap: wrap;
}
.pitcher-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px;
    padding: 0 6px;
    border-radius: 6px;
    font-weight: 700; font-size: 0.72rem;
    color: #ffffff; flex-shrink: 0;
}
.badge-win  { background: #059669; }
.badge-loss { background: #dc2626; }
.badge-save { background: #2563eb; }
.pitcher-name {
    font-weight: 600; color: #1e293b;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    min-width: 0; flex: 1;
}
.pitcher-stats { color: #64748b; font-size: 0.78rem; white-space: nowrap; }

/* Footer de juego en vivo (jugadores, diamante, BSO) */
.live-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem !important;
    background: linear-gradient(90deg, #003309, #0a4d17);
    color: white;
    padding: 0.5rem 0.6rem;
    white-space: normal !important;
    overflow: visible !important;
}
.live-top { display: flex; align-items: center; gap: 0.6rem; width: 100%; }
.live-players {
    display: flex; flex-direction: column; gap: 0.2rem;
    flex: 0 0 70%; max-width: 70%; min-width: 0;
}
.live-top .diamond-wrap {
    flex: 0 0 30%; max-width: 30%;
    display: flex; align-items: center; justify-content: center;
}
.live-top .diamond { width: 56px; height: 56px; position: relative; }
.live-top .diamond .base { width: 18px; height: 18px; }
.live-player-row {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.85rem; line-height: 1.15; min-width: 0;
}
.live-role-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px;
    border-radius: 5px;
    font-weight: 700; font-size: 0.72rem;
    color: #ffffff; flex-shrink: 0;
}
.role-pitcher { background: #2563eb; }
.role-batter  { background: #f59e0b; color: #1e293b; }
.live-player-name {
    font-weight: 600; color: #f8fafc;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-width: 0; flex: 1;
}
.live-bottom { display: flex; align-items: center; gap: 0.6rem; width: 100%; }
.live-bottom .bso-left {
    flex: 0 0 70%; max-width: 70%;
    display: flex; justify-content: space-around; gap: 0.4rem;
}
.live-bottom .bso-right {
    flex: 0 0 30%; max-width: 30%;
    display: flex; justify-content: center;
}
.live-bottom .bso-item { padding: 0.2rem 0.6rem; font-size: 0.72rem; }
.live-bottom .bso-item strong { font-size: 0.88rem; }

/* Tirilla de carreras por inning */
.live-linescore {
    background: linear-gradient(90deg, #003309, #0a4d17);
    color: #ffffff;
    padding: 0.4rem 0.6rem;
    overflow-x: auto;
}
.live-linescore table { width: 100%; border-collapse: collapse; font-size: 0.72rem; text-align: center; }
.live-linescore th, .live-linescore td {
    padding: 0.18rem 0.25rem;
    border: 1px solid rgba(255,255,255,0.7);
    min-width: 18px;
}
.live-linescore th { font-weight: 700; color: rgba(255,255,255,0.85); }
.live-linescore td { font-weight: 500; }
.live-linescore .ls-team { text-align: left; font-weight: 700; padding-right: 0.4rem; min-width: 32px; }
.live-linescore .ls-tot { background: rgba(255,255,255,0.12); font-weight: 700; }
.live-linescore .ls-tot strong { font-size: 0.82rem; }
.live-linescore-final { background: linear-gradient(90deg, #334155, #475569); }
.live-linescore-final .ls-tot { background: rgba(255,255,255,0.18); }

/* Diamante (corredores en base) */
.diamond { position: relative; width: 28px; height: 28px; flex-shrink: 0; }
.diamond .base {
    position: absolute;
    width: 9px; height: 9px;
    background: #ffffff;
    border: 1px solid #ffffff;
    transition: all 0.2s ease;
}
.diamond .base.on {
    background: #000000;
    border-color: #000000;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
}
.diamond .b2 { top: 1px; left: 50%; transform: translateX(-50%) rotate(45deg); }
.diamond .b3 { top: 50%; left: 1px; transform: translateY(-50%) rotate(45deg); }
.diamond .b1 { top: 50%; right: 1px; transform: translateY(-50%) rotate(45deg); }
.diamond .bh { bottom: 1px; left: 50%; transform: translateX(-50%) rotate(45deg); }
.diamond .home-plate { background: #ffffff; border-color: #ffffff; }

.bso { display: flex; gap: 0.25rem; }

/* Pantallas grandes (>=1600px) */
@media (min-width: 1600px) {
    .game-card-header { font-size: 0.95rem; padding: 0.55rem 0.85rem; }
    .team-name { font-size: 1.125rem; }
    .team-record { font-size: 0.925rem; }
    .team-score { font-size: 1.625rem; }
    .team-logo { width: 44px; height: 44px; }
    .team-logo-placeholder { font-size: 0.925rem; }
    .game-footer { font-size: 0.975rem; }
    .pitcher-line { font-size: 0.975rem; }
    .pitcher-stats { font-size: 0.905rem; }
    .pitcher-badge { font-size: 0.845rem; min-width: 26px; height: 26px; }
    .live-player-row { font-size: 0.975rem; }
    .live-role-badge { font-size: 0.845rem; width: 24px; height: 24px; }
}

/* Desktop chico (769px - 1399px) */
@media (min-width: 769px) and (max-width: 1399px) {
    .game-card-header { font-size: 0.78rem; }
    .team-name { font-size: 0.93rem; }
    .team-record { font-size: 0.72rem; }
    .team-score { font-size: 1.4rem; }
    .game-footer { font-size: 0.78rem; }
    .pitcher-line { font-size: 0.78rem; }
    .pitcher-stats { font-size: 0.72rem; }
    .pitcher-badge { font-size: 0.66rem; }
    .live-player-row { font-size: 0.78rem; }
    .live-role-badge { font-size: 0.66rem; }
}
