﻿/* ======================================================
   RESET / BOX-SIZING
====================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

/* ======================================================
   LAYOUT GENERAL
====================================================== */
.gp-app-page {
    min-height: 100vh;
}

/* ======================================================
   MAIN CONTENT
====================================================== */
.gp-main-content {
    margin-left: 250px;
    width: calc(100% - 250px);
    padding: 20px;
    min-height: 100vh;
    background: #F5F7FA;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* ======================================================
   CENTRADO DE CARDS
====================================================== */
.gp-card,
.gp-header-card {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 15px auto;
}

/* ======================================================
   HEADER / NOMBRE DEL CRIADERO
====================================================== */
.gp-header-card {
    background: linear-gradient(135deg, #0F4C5C, #1B6B7D);
    color: white;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 10px 25px rgba(0,0,0,.15);
    /* Agrega estas líneas: */
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

    .gp-header-card h2 {
        margin: 0 0 6px 0;
        font-size: 22px;
    }

    .gp-header-card p {
        margin: 0;
        opacity: 0.85;
        font-size: 14px;
    }

/* ======================================================
   CARDS GENERALES
====================================================== */
.gp-card {
    background: white;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 10px 25px rgba(0,0,0,.10);
}

    .gp-card h3 {
        margin: 0 0 14px 0;
        font-size: 16px;
        color: #0F172A;
        font-weight: 700;
    }

/* Header interno de card (título + badge) */
.gp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

    .gp-card-header h3 {
        margin: 0;
    }

.gp-live-badge {
    background: #EF4444;
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    animation: pulseLive 1.5s infinite;
}

@keyframes pulseLive {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* ======================================================
   STATS GRID
====================================================== */
.gp-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
}

    .gp-stats-grid > div {
        background: #F5F7FA;
        padding: 14px;
        border-radius: 14px;
        text-align: center;
        box-shadow: 0 4px 10px rgba(0,0,0,.08);
        min-width: 0;
    }

    .gp-stats-grid strong {
        display: block;
        font-size: 11px;
        color: #64748B;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 6px;
    }

.gp-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: #0F172A;
}

.gp-stat-win {
    color: #10B981;
}

.gp-stat-loss {
    color: #EF4444;
}

/* ======================================================
   LISTADOS (Eventos en Vivo + Próximos Bailes)
====================================================== */
.gp-empty-msg {
    color: #94A3B8;
    font-size: 14px;
    margin: 10px 0 4px 0;
    text-align: center;
}

.gp-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gp-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #F8FAFC;
    border-radius: 14px;
    border: 1px solid #E2E8F0;
    transition: background .2s, transform .1s;
}

    .gp-list-item:hover {
        background: #F1F5F9;
    }

    .gp-list-item:active {
        transform: scale(0.995);
    }

.gp-live-item {
    border-left: 3px solid #EF4444;
}

.gp-list-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.gp-list-body {
    flex: 1;
    min-width: 0;
}

.gp-list-title {
    font-size: 14px;
    font-weight: 700;
    color: #0F172A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gp-list-sub {
    font-size: 12px;
    color: #64748B;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gp-list-action {
    flex-shrink: 0;
}

.gp-btn-sm {
    background: #0F4C5C;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

    .gp-btn-sm:hover {
        background: #1B6B7D;
    }

/* ======================================================
   SIDEBAR
====================================================== */
.gp-side-menu {
    width: 250px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(180deg, #0F172A, #0B1220);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 15px;
    overflow-y: auto;
    z-index: 1000;
}

.gp-menu-title {
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 20px;
    color: #38BDF8;
}

.gp-menu-item {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
    color: white;
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: 14px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
}

    .gp-menu-item:hover {
        background: rgba(56,189,248,.12);
        transform: translateX(3px);
    }

    .gp-menu-item.active {
        background: rgba(56,189,248,.20);
        border-color: rgba(56,189,248,.40);
    }

/* ======================================================
   SUBMENU
====================================================== */
.gp-side-submenu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 6px 0 14px 14px;
    padding-left: 10px;
    border-left: 2px solid rgba(56,189,248,.3);
}

    .gp-side-submenu button {
        background: rgba(255,255,255,.03);
        border: 1px solid rgba(255,255,255,.05);
        color: #E2E8F0;
        padding: 10px 12px;
        border-radius: 12px;
        text-align: left;
        font-size: 13px;
        cursor: pointer;
        transition: .2s;
    }

        .gp-side-submenu button:hover {
            background: rgba(255,255,255,.08);
        }

/* ======================================================
   BOTTOM NAV (MOBILE)
====================================================== */
.gp-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 58px;
    display: flex;
    justify-content: space-around;
    background: white;
    border-top: 1px solid #CBD5E1;
    z-index: 999;
}

.gp-bottom-item {
    flex: 1;
    border: none;
    background: none;
    font-size: 12px;
    color: #0F172A;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 4px;
    -webkit-tap-highlight-color: transparent;
    transition: color .2s, transform .1s;
}

    .gp-bottom-item:active {
        color: #0F4C5C;
        transform: scale(0.95);
    }

    .gp-bottom-item.active {
        color: #0F4C5C;
        font-weight: 700;
    }

/* ======================================================
   BOTTOM SHEET (MOBILE)
====================================================== */
.gp-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.gp-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 80vh;
    background: white;
    border-radius: 24px 24px 0 0;
    padding: 20px;
    z-index: 1001;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    animation: sheetSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gp-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid #E2E8F0;
}

    .gp-sheet-header h3 {
        margin: 0;
        font-size: 18px;
        color: #0F172A;
    }

    .gp-sheet-header button {
        background: none;
        border: none;
        font-size: 28px;
        color: #94A3B8;
        cursor: pointer;
        padding: 0 4px;
        line-height: 1;
        transition: color .2s;
    }

        .gp-sheet-header button:hover {
            color: #0F172A;
        }

.gp-sheet button {
    width: 100%;
    padding: 14px 16px;
    border: none;
    background: #F8FAFC;
    border-radius: 12px;
    text-align: left;
    font-size: 15px;
    color: #0F172A;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .1s;
}

    .gp-sheet button:active {
        background: #E2E8F0;
        transform: scale(0.98);
    }

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes sheetSlideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* ======================================================
   RESPONSIVE
====================================================== */
@media (max-width: 767px) {

    .gp-main-content {
        margin-left: 0;
        width: 100%;
        padding-bottom: 80px;
    }

    .gp-card,
    .gp-header-card {
        max-width: 100%;
    }

    .gp-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gp-side-menu {
        display: none;
    }

    .gp-list-item {
        padding: 10px 12px;
    }
}

/* OCULTAR BOTTOM NAV EN PC */
@media (min-width: 768px) {
    .gp-bottom-nav {
        display: none;
    }
}
/* ======================================================
   SUB-SUBMENÚ (Catálogos en Sidebar)
====================================================== */
.gp-submenu-toggle {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.05);
    color: #E2E8F0;
    padding: 10px 12px;
    border-radius: 12px;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: .2s;
}

    .gp-submenu-toggle:hover {
        background: rgba(255,255,255,.08);
    }

.gp-submenu-arrow {
    font-size: 10px;
    transition: transform .2s;
    color: #94A3B8;
}

.gp-arrow-open {
    transform: rotate(180deg);
    color: #38BDF8;
}

.gp-side-subsubmenu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 4px 0 8px 20px;
    padding-left: 10px;
    border-left: 2px solid rgba(56,189,248,.2);
}

    .gp-side-subsubmenu button {
        background: rgba(255,255,255,.02);
        border: 1px solid rgba(255,255,255,.04);
        color: #CBD5E1;
        padding: 8px 12px;
        border-radius: 10px;
        text-align: left;
        font-size: 12px;
        cursor: pointer;
        transition: .2s;
    }

        .gp-side-subsubmenu button:hover {
            background: rgba(56,189,248,.10);
            color: #38BDF8;
        }

/* ======================================================
   BOTTOM SHEET: BOTÓN VOLVER + DIVISOR
====================================================== */
.gp-btn-back {
    background: transparent !important;
    color: #64748B !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 10px 16px !important;
    text-align: left !important;
}

    .gp-btn-back:hover {
        background: #F1F5F9 !important;
        color: #0F172A !important;
    }

.gp-sheet-divider {
    height: 1px;
    background: #E2E8F0;
    margin: 4px 0;
}
/* ======================================================
   FIXES PARA IPHONE / SAFARI (v2 - sin errores)
====================================================== */

/* Ajusta el alto real considerando la barra de Safari */
@supports (-webkit-touch-callout: none) {

    .gp-app-page {
        min-height: 100vh;
        min-height: 100dvh; /* dvh = dynamic viewport height (iOS 15+) */
    }

    .gp-main-content {
        min-height: 100dvh;
        padding-bottom: 100px; /* Más espacio para la barra de Safari */
    }
    /* La bottom nav se ajusta al área segura */
    .gp-bottom-nav {
        padding-bottom: env(safe-area-inset-bottom, 0px);
        height: auto;
        min-height: 58px;
    }
    /* El bottom sheet también respeta el área segura */
    .gp-sheet {
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    }
    /* Evita que el contenido se desborde horizontal */
    body, html {
        overflow-x: hidden;
        width: 100%;
    }
    /* Asegura que los cards no se desborden */
    .gp-card,
    .gp-header-card {
        max-width: 100%;
    }
    /* La grid de stats no se rompe */
    .gp-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

        .gp-stats-grid > div {
            min-width: 0;
            word-break: break-word;
        }
    /* Los items de lista no se desborden */
    .gp-list-item {
        min-width: 0;
    }

    .gp-list-title,
    .gp-list-sub {
        max-width: 100%;
    }
}

/* Fix general para todos los móviles: prevenir zoom en inputs */
input, button, select, textarea {
    font-size: 16px; /* Previene zoom de Safari en iOS */
}