﻿/* =============================================================================
   RUTA: wwwroot/css/gaia/components.css
   =============================================================================
   GAIA VIP — Components
   ----------------------------------------------------------------------------- */

.card-panel {
    background: var(--bg-surface);
    border-radius: 1rem;
    border: 1px solid var(--border-subtle);
    padding: 1.25rem 1.4rem;
    box-shadow: 0 14px 34px rgba(0,0,0,.35);
    position: relative;
}

    .card-panel:has(> h1:first-child),
    .card-panel:has(> h2:first-child),
    .card-panel:has(> h3:first-child),
    .card-panel:has(> h4:first-child),
    .card-panel:has(> h5:first-child),
    .card-panel:has(> h6:first-child) {
        padding-top: 1.8rem;
    }

    .card-panel > h1:first-child,
    .card-panel > h2:first-child,
    .card-panel > h3:first-child,
    .card-panel > h4:first-child,
    .card-panel > h5:first-child,
    .card-panel > h6:first-child {
        position: absolute;
        top: 0;
        left: 1.1rem;
        transform: translateY(-50%);
        z-index: 2;
        display: inline-flex;
        align-items: center;
        gap: .45rem;
        padding: .28rem .78rem;
        border-radius: 999px;
        background: var(--bg-surface-soft);
        border: 1px solid rgba(15,241,179,.55);
        color: var(--accent-primary);
        font-weight: 650;
        font-size: .90rem;
        margin: 0;
        box-shadow: 0 10px 26px rgba(0,0,0,.25);
    }

    .card-panel > h1.no-legend:first-child,
    .card-panel > h2.no-legend:first-child,
    .card-panel > h3.no-legend:first-child,
    .card-panel > h4.no-legend:first-child,
    .card-panel > h5.no-legend:first-child,
    .card-panel > h6.no-legend:first-child {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        background: transparent;
        color: var(--text-main);
        padding: 0;
    }

.form-label {
    font-size: .86rem;
    color: var(--text-muted);
}

/* =============================================================================
   REGLA CANÓNICA GAIA:
   - Bootstrap .text-muted debe usar el muted GAIA (var(--text-muted))
   ============================================================================= */
.text-muted {
    color: var(--text-muted) !important;
}

/* =============================================================================
   Inputs (REGLA FIJA):
   - Nunca blancos por defecto en tema oscuro.
   - Se pintan por variables GAIA (oscuro/claro) a nivel GLOBAL.
   ============================================================================= */
.form-control,
.form-select,
.form-control.bg-surface,
.form-select.bg-surface {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-main);
}

    .form-control:focus,
    .form-select:focus,
    .form-control.bg-surface:focus,
    .form-select.bg-surface:focus {
        background: var(--input-bg-focus);
        border-color: rgba(15,241,179,.55);
        box-shadow: 0 0 0 1px var(--accent-primary-soft);
        color: var(--text-main);
    }

    .form-control::placeholder {
        color: var(--text-soft);
    }

    .form-control:disabled,
    .form-select:disabled,
    .form-control[readonly] {
        background: var(--input-bg-disabled, var(--bg-surface-soft));
        border-color: var(--input-border, var(--border-subtle));
        color: var(--text-muted);
        opacity: 1;
    }

/* Botones */
.btn-accent,
.btn-outline-accent {
    border-radius: 999px;
    border: 1px solid rgba(15,241,179,.65);
    color: var(--accent-primary);
    background: transparent;
    font-weight: 650;
}

    .btn-accent:hover,
    .btn-outline-accent:hover {
        background: var(--accent-primary-soft);
        border-color: rgba(15,241,179,.85);
        color: var(--accent-primary);
    }

/* =============================================================================
   REGLA CANÓNICA GAIA:
   - .btn-outline-secondary alineado con el tema GAIA
   - Evita “brillos distintos” (p.ej. Estadísticas: Países/Ciudades)
   ============================================================================= */
.btn-outline-secondary {
    border-radius: 999px;
    border: 1px solid var(--border-subtle) !important;
    color: var(--text-muted) !important;
    background: transparent !important;
    font-weight: 650;
}

    .btn-outline-secondary:hover {
        background: var(--bg-surface-soft) !important;
        border-color: var(--border-strong) !important;
        color: var(--text-main) !important;
    }

    .btn-outline-secondary:focus-visible {
        outline: 2px solid var(--accent-primary);
        outline-offset: 2px;
        box-shadow: none !important;
    }

    .btn-outline-secondary:disabled,
    .btn-outline-secondary.disabled {
        border-color: var(--border-subtle) !important;
        color: var(--text-muted) !important;
        background: transparent !important;
        opacity: .55;
    }

.btn-accent,
.btn-outline-accent,
.btn-outline-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
}

.btn {
    white-space: nowrap;
}

/* Tablas */
.table {
    color: var(--text-main);
}

    .table > :not(caption) > * > * {
        background-color: transparent;
        border-color: var(--border-subtle);
        color: inherit;
    }

    .table thead th {
        color: var(--text-muted);
        font-weight: 650;
        border-bottom-color: var(--border-strong);
    }

    .table tbody tr:hover {
        background-color: rgba(255,255,255,.02);
    }

/* Idiomas (banderas) */
.gaia-flag {
    width: 18px;
    height: 12px;
    object-fit: cover;
    border-radius: 2px;
    display: inline-block;
    flex: 0 0 auto;
}

/* =============================================================================
   REGLA CANÓNICA GAIA:
   - Banderas inline en listas/botones (Estadísticas): sin estilos inline en JS
   ============================================================================= */
.gaia-flag-inline {
    margin-right: 8px;
    vertical-align: text-bottom;
}

.dropdown-menu {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
}

.dropdown-item {
    color: var(--text-main);
}

    .dropdown-item:hover {
        background: rgba(255,255,255,.04);
    }

/* Botón flotante “Volver a Inicio” */
.gaia-scrolltop {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 2500;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 14px 30px rgba(0,0,0,.45);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity .15s ease-out, transform .15s ease-out, background .15s ease-out, border-color .15s ease-out;
}

    .gaia-scrolltop.is-visible {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .gaia-scrolltop:hover {
        background: var(--bg-surface-soft);
        border-color: var(--border-strong);
    }

    .gaia-scrolltop:focus-visible {
        outline: 2px solid var(--accent-primary);
        outline-offset: 2px;
    }

/* =============================================================================
   GAIA VIP — Modal protocolario (tema oscuro)
   ============================================================================= */

.gaia-modal .modal-content {
    background: var(--bg-surface) !important;
    color: var(--text-main);
    border: 1px solid var(--border-subtle) !important;
    border-radius: 1.2rem !important;
    box-shadow: 0 18px 60px rgba(0,0,0,.65);
    overflow: hidden;
}

.gaia-modal .modal-header,
.gaia-modal .modal-footer {
    background: var(--bg-surface-soft) !important;
    border-color: var(--border-subtle) !important;
}

.gaia-modal .modal-title {
    color: var(--text-main);
    font-weight: 750;
    letter-spacing: .01em;
}

.gaia-modal-close {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
}

    .gaia-modal-close::before {
        content: "×";
        font-size: 1.9rem;
        line-height: 1;
        transform: translateY(-1px);
    }

    .gaia-modal-close:hover {
        background: rgba(255,255,255,.04);
        border-color: var(--border-subtle);
        color: var(--text-main);
    }

    .gaia-modal-close:focus-visible {
        outline: 2px solid var(--accent-primary);
        outline-offset: 2px;
    }

.modal-backdrop.show {
    opacity: .72;
}
