/* =========================================================================
   BXc-Pecera - Estilos frontend
   ========================================================================= */

/* Variables */
:root {
    --bxc-bg: #0f1923;
    --bxc-bg-card: #1a2735;
    --bxc-fg: #e8eef3;
    --bxc-muted: #8aa0b5;
    --bxc-accent: #00d4ff;
    --bxc-accent-2: #ffb800;
    --bxc-danger: #ff5b6e;
    --bxc-success: #5bff8a;
    --bxc-border: #2a3b4d;
    --bxc-radius: 10px;
    --bxc-shadow: 0 4px 24px rgba(0,0,0,0.35);
}

/* Reset básico dentro de contenedores */
.bxc-panel-usuario,
.bxc-visualizador {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--bxc-fg);
}
.bxc-panel-usuario *,
.bxc-visualizador * { box-sizing: border-box; }

/* =========================================================================
   Panel de usuario
   ========================================================================= */
.bxc-panel-usuario { max-width: 1100px; margin: 20px auto; padding: 0 16px; }
.bxc-panel-usuario .bxc-titulo { color: #fff; background: linear-gradient(135deg, #00d4ff 0%, #0066ff 100%); padding: 16px 20px; border-radius: var(--bxc-radius); margin: 0 0 20px; box-shadow: var(--bxc-shadow); }

.bxc-card {
    background: #fff;
    color: #222;
    border: 1px solid #e0e6ec;
    border-radius: var(--bxc-radius);
    padding: 18px 22px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.bxc-card h3 { margin: 0 0 14px; font-size: 18px; color: #1a2735; }
.bxc-card h4 { margin: 18px 0 10px; font-size: 14px; color: #1a2735; text-transform: uppercase; letter-spacing: .04em; }

.bxc-form-inline { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.bxc-form-inline label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #555; }
.bxc-form-inline input,
.bxc-form-inline select { padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; }
.bxc-form-msg { font-size: 13px; color: #2e7d32; padding-left: 8px; }
.bxc-form-msg.error { color: #c62828; }

.bxc-btn {
    cursor: pointer; border: 0; padding: 8px 16px; border-radius: 6px;
    font-size: 13px; font-weight: 600; transition: all .15s ease;
    background: #e9ecef; color: #333;
}
.bxc-btn:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.bxc-btn-primary { background: #0066ff; color: #fff; }
.bxc-btn-primary:hover { background: #0052cc; }
.bxc-btn-danger { background: #ff5b6e; color: #fff; }
.bxc-btn-danger:hover { background: #e0455a; }
.bxc-btn-small { padding: 4px 10px; font-size: 12px; }

.bxc-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.bxc-table th { text-align: left; padding: 10px 8px; border-bottom: 2px solid #e0e6ec; color: #555; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.bxc-table td { padding: 10px 8px; border-bottom: 1px solid #f0f3f6; color: #222; }
.bxc-table tr:hover td { background: #f7faff; }
.bxc-table tr.bxc-inscripcion-row:hover td { background: #fafbfc; }

.bxc-color-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

.bxc-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.bxc-badge-activo, .bxc-badge-activa { background: #d4edda; color: #155724; }
.bxc-badge-pendiente, .bxc-badge-programada { background: #fff3cd; color: #856404; }
.bxc-badge-pendiente_retiro { background: #ffe5b4; color: #8a5a00; }
.bxc-badge-entregado, .bxc-badge-finalizada { background: #d1ecf1; color: #0c5460; }
.bxc-badge-rechazado, .bxc-badge-cancelada { background: #f8d7da; color: #721c24; }

.bxc-empty, .bxc-help { color: #777; font-size: 13px; font-style: italic; }

.bxc-inscripcion-box { background: #f7faff; border: 1px solid #d0e0f5; border-radius: 6px; padding: 12px; }
.bxc-inscripcion-box select { padding: 6px 10px; border-radius: 4px; border: 1px solid #ccc; margin: 0 6px; }
.bxc-insc-msg { margin-top: 6px; font-size: 12px; color: #2e7d32; }

.bxc-alert { padding: 12px 16px; border-radius: 6px; margin: 16px 0; }
.bxc-alert-warn { background: #fff3cd; color: #856404; border: 1px solid #ffeaa7; }

.bxc-admin-quick { border-color: #ffb800; background: #fffdf3; }

/* =========================================================================
   Visualizador
   ========================================================================= */
.bxc-visualizador {
    max-width: 1100px; margin: 20px auto; padding: 0 16px;
    background: transparent;
}
.bxc-vis-header {
    background: linear-gradient(135deg, #1a2735 0%, #0f1923 100%);
    border-radius: var(--bxc-radius);
    padding: 22px 26px;
    box-shadow: var(--bxc-shadow);
    display: grid; grid-template-columns: 1fr 2fr; gap: 24px; align-items: center;
}
.bxc-vis-title { display: flex; align-items: center; gap: 14px; }
.bxc-vis-nombre { font-size: 28px; font-weight: 700; color: #fff; }
.bxc-vis-spinner {
    width: 18px; height: 18px; border: 3px solid rgba(255,255,255,0.2);
    border-top-color: var(--bxc-accent); border-radius: 50%;
    animation: bxc-spin 1s linear infinite;
}
@keyframes bxc-spin { to { transform: rotate(360deg); } }

.bxc-vis-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; font-size: 13px; }
.bxc-vis-meta > div { color: var(--bxc-muted); }
.bxc-vis-meta strong { color: var(--bxc-fg); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }

.bxc-vis-leader {
    background: linear-gradient(135deg, #ffb800 0%, #ff8c00 100%);
    color: #1a2735;
    border-radius: var(--bxc-radius);
    padding: 20px 26px;
    margin: 16px 0;
    text-align: center;
    box-shadow: var(--bxc-shadow);
}
.bxc-vis-leader-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; opacity: .8; }
.bxc-vis-leader-name { font-size: 26px; font-weight: 800; margin: 4px 0; }
.bxc-vis-leader-saldo { font-size: 18px; font-weight: 600; }

.bxc-vis-ranking {
    background: #fff;
    border-radius: var(--bxc-radius);
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.bxc-vis-ranking-empty { text-align: center; padding: 30px; color: #888; font-style: italic; }

.bxc-vis-fish {
    display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center;
    padding: 12px 14px; border-radius: 8px; margin-bottom: 6px;
    background: #f7faff; border-left: 4px solid var(--bxc-accent);
    transition: transform .4s cubic-bezier(.4,1.4,.6,1), background .3s;
}
.bxc-vis-fish.bxc-up { animation: bxc-bump-up .6s; background: #e3fbe8; }
.bxc-vis-fish.bxc-down { animation: bxc-bump-down .6s; background: #ffeef0; }
.bxc-vis-fish.bxc-leader { background: linear-gradient(90deg, #fff7d6 0%, #fff 60%); border-left-color: var(--bxc-accent-2); }

@keyframes bxc-bump-up {
    0% { transform: translateY(8px); background: #d4edda; }
    100% { transform: translateY(0); background: #f7faff; }
}
@keyframes bxc-bump-down {
    0% { transform: translateY(-8px); background: #f8d7da; }
    100% { transform: translateY(0); background: #f7faff; }
}

.bxc-fish-pos { font-size: 20px; font-weight: 800; color: #1a2735; text-align: center; }
.bxc-fish-pos-small { font-size: 11px; color: #888; font-weight: 400; }

.bxc-fish-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bxc-fish-avatar {
    width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #fff; flex-shrink: 0; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.bxc-fish-details { min-width: 0; flex: 1; }
.bxc-fish-name { font-weight: 700; font-size: 15px; color: #1a2735; }
.bxc-fish-owner { font-size: 12px; color: #666; }
.bxc-fish-bar {
    margin-top: 6px; height: 6px; background: #e0e6ec; border-radius: 4px; overflow: hidden;
}
.bxc-fish-bar-fill {
    height: 100%; background: linear-gradient(90deg, #00d4ff 0%, #0066ff 100%);
    transition: width .8s cubic-bezier(.4,1.4,.6,1);
}
.bxc-fish-saldo { font-weight: 700; font-size: 16px; color: #1a2735; text-align: right; }
.bxc-fish-saldo-currency { font-size: 11px; color: #888; font-weight: 400; display: block; }

.bxc-vis-footer { text-align: center; padding: 14px; color: #888; font-size: 11px; }
.bxc-vis-footer small { opacity: .8; }

/* Responsivo */
@media (max-width: 720px) {
    .bxc-vis-header { grid-template-columns: 1fr; gap: 14px; }
    .bxc-vis-meta { grid-template-columns: 1fr 1fr; }
    .bxc-form-inline { flex-direction: column; align-items: stretch; }
    .bxc-form-inline label { width: 100%; }
    .bxc-form-inline input, .bxc-form-inline select { width: 100%; }
    .bxc-table { font-size: 12px; }
    .bxc-table th, .bxc-table td { padding: 6px 4px; }
}

/* =========================================================================
   Dashboard de usuario ([bxc_dashboard])
   ========================================================================= */
.bxc-dashboard { max-width: 1200px; margin: 20px auto; padding: 0 16px; }

/* Hero */
.bxc-dash-hero {
    background: linear-gradient(135deg, #1a2735 0%, #0f1923 60%, #1e3a5f 100%);
    color: #fff;
    border-radius: 14px;
    padding: 28px 32px;
    display: grid; grid-template-columns: 1fr 2fr; gap: 24px; align-items: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    margin-bottom: 18px;
}
.bxc-dash-hero-left { display: flex; align-items: center; }
.bxc-dash-greeting { display: flex; align-items: center; gap: 16px; }
.bxc-dash-avatar .bxc-avatar-img { border-radius: 50%; border: 3px solid #00d4ff; }
.bxc-dash-hello { font-size: 22px; font-weight: 700; }
.bxc-dash-sub { font-size: 13px; color: #a8bdd1; margin-top: 4px; }
.bxc-dash-sub strong { color: #00d4ff; }

.bxc-dash-hero-right { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.bxc-dash-kpi {
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 14px 16px;
    border-left: 3px solid rgba(255,255,255,0.3);
}
.bxc-dash-kpi-primary { background: rgba(0,212,255,0.15); border-left-color: #00d4ff; }
.bxc-dash-kpi-up { background: rgba(91,255,138,0.15); border-left-color: #5bff8a; }
.bxc-dash-kpi-down { background: rgba(255,91,110,0.15); border-left-color: #ff5b6e; }
.bxc-dash-kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #a8bdd1; }
.bxc-dash-kpi-value { font-size: 24px; font-weight: 800; margin-top: 4px; }
.bxc-dash-kpi-value small { font-size: 12px; opacity: .7; font-weight: 400; }

/* KPIs secundarios */
.bxc-dash-kpis {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px; margin-bottom: 18px;
}
.bxc-dash-stat {
    background: #fff; border: 1px solid #e0e6ec; border-radius: 10px;
    padding: 14px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.bxc-dash-stat-num { font-size: 26px; font-weight: 800; color: #1a2735; }
.bxc-dash-stat-lbl { font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.bxc-dash-stat-highlight { background: linear-gradient(135deg, #fff7d6 0%, #fff 80%); border-color: #ffb800; }

/* Cards del dashboard */
.bxc-dash-card { margin-bottom: 18px; }
.bxc-card-header { margin-bottom: 14px; }
.bxc-card-header h3 { margin: 0 0 4px; font-size: 18px; color: #1a2735; }
.bxc-card-sub { font-size: 12px; color: #888; }

/* Catálogo de peces */
.bxc-catalogo-peces {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}
.bxc-tipo-card {
    background: #f7faff; border: 1px solid #e0e6ec; border-radius: 10px;
    padding: 16px; display: flex; flex-direction: column; align-items: center; text-align: center;
    transition: transform .2s, box-shadow .2s;
}
.bxc-tipo-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,0.1); }
.bxc-tipo-avatar {
    width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #fff; margin-bottom: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.bxc-tipo-icono { font-size: 28px; }
.bxc-tipo-info { flex: 1; }
.bxc-tipo-nombre { font-weight: 700; font-size: 15px; color: #1a2735; }
.bxc-tipo-valor { font-size: 14px; color: #0066ff; font-weight: 600; margin: 2px 0 6px; }
.bxc-tipo-desc { font-size: 12px; color: #777; line-height: 1.4; }

/* Empty states */
.bxc-empty-state {
    background: #f7faff; border: 2px dashed #d0e0f5; border-radius: 10px;
    padding: 30px; text-align: center; color: #666;
}
.bxc-empty-state.bxc-empty-small { padding: 18px; }
.bxc-empty-icon { font-size: 40px; margin-bottom: 8px; opacity: .6; }

/* Peces en juego */
.bxc-peces-en-juego { display: flex; flex-direction: column; gap: 12px; }
.bxc-pez-en-juego {
    display: grid; grid-template-columns: 70px 60px 1fr auto; gap: 16px; align-items: center;
    background: #fff; border: 1px solid #e0e6ec; border-radius: 12px;
    padding: 14px 18px; box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: transform .3s;
}
.bxc-pez-en-juego:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

.bxc-pez-rank { text-align: center; }
.bxc-pez-rank-pos { font-size: 22px; font-weight: 800; color: #1a2735; }
.bxc-pez-rank-medalla { font-size: 18px; }

.bxc-pez-avatar {
    width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 26px; box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}
.bxc-pez-avatar-sm { width: 40px; height: 40px; font-size: 20px; }

.bxc-pez-info { min-width: 0; }
.bxc-pez-nombre { font-weight: 700; font-size: 15px; color: #1a2735; }
.bxc-pez-nombre small { color: #888; font-weight: 400; }
.bxc-pez-pecera { font-size: 13px; color: #555; margin: 3px 0; }
.bxc-pez-stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: #666; margin: 4px 0; }
.bxc-pez-stats span { white-space: nowrap; }
.bxc-pez-tiempo { font-size: 12px; color: #888; }

.bxc-pez-saldo-block { text-align: right; }
.bxc-pez-saldo { font-size: 22px; font-weight: 800; color: #1a2735; }
.bxc-pez-saldo small { font-size: 12px; color: #888; font-weight: 400; }
.bxc-pez-variacion { font-size: 12px; font-weight: 600; margin: 2px 0 6px; }
.bxc-var-up { color: #2e7d32; }
.bxc-var-down { color: #c62828; }
.bxc-btn-ver { display: inline-block; text-decoration: none; }

/* Peces disponibles */
.bxc-peces-disponibles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.bxc-pez-disp {
    background: #f7faff; border: 1px solid #e0e6ec; border-radius: 10px;
    padding: 12px 14px; display: grid; grid-template-columns: 50px 1fr auto; gap: 12px; align-items: center;
}
.bxc-pez-disp-info { min-width: 0; }
.bxc-pez-disp-nombre { font-weight: 700; color: #1a2735; }
.bxc-pez-disp-tipo { font-size: 12px; color: #888; }
.bxc-pez-disp-saldo { font-weight: 700; color: #0066ff; }
.bxc-pez-disp-acciones { display: flex; flex-direction: column; gap: 4px; }

/* Mis peceras */
.bxc-mis-peceras { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.bxc-mi-pecera {
    background: linear-gradient(135deg, #fff 0%, #f7faff 100%);
    border: 1px solid #e0e6ec; border-radius: 10px; padding: 14px;
    display: flex; flex-direction: column; gap: 8px;
}
.bxc-mi-pecera-nombre { font-weight: 700; color: #1a2735; font-size: 15px; }
.bxc-mi-pecera-stats { display: flex; gap: 14px; font-size: 12px; color: #555; flex-wrap: wrap; }
.bxc-mi-pecera-stats strong { color: #0066ff; }

/* Historial */
.bxc-historial-table td { vertical-align: middle; }
.bxc-tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.bxc-tag-me { background: #d0e0f5; color: #0066ff; margin-left: 4px; }
.bxc-tag-up { background: #d4edda; color: #155724; }
.bxc-tag-down { background: #f8d7da; color: #721c24; }

/* Modal */
.bxc-modal {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); z-index: 99999;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.bxc-modal-content {
    background: #fff; border-radius: 12px; padding: 28px;
    max-width: 460px; width: 100%; position: relative;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
    animation: bxc-modal-in .25s ease;
}
.bxc-modal-small { max-width: 380px; }
@keyframes bxc-modal-in {
    from { transform: translateY(20px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
.bxc-modal-close {
    position: absolute; top: 10px; right: 14px;
    background: none; border: 0; font-size: 28px; line-height: 1; cursor: pointer; color: #888;
}
.bxc-modal-close:hover { color: #333; }
.bxc-modal-content h3 { margin: 0 0 16px; color: #1a2735; }
.bxc-modal-tipo-info {
    display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
    background: #f7faff; padding: 12px; border-radius: 8px;
}
.bxc-modal-tipo-info .bxc-tipo-avatar { width: 48px; height: 48px; margin: 0; font-size: 22px; }
#bxc-form-crear-pez-modal label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 13px; color: #555; font-weight: 600; }
#bxc-form-crear-pez-modal input[type=text] { padding: 10px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; }
.bxc-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Responsive dashboard */
@media (max-width: 768px) {
    .bxc-dash-hero { grid-template-columns: 1fr; padding: 20px; }
    .bxc-pez-en-juego { grid-template-columns: 50px 50px 1fr; gap: 10px; }
    .bxc-pez-en-juego .bxc-pez-saldo-block { grid-column: 1 / -1; text-align: left; display: flex; align-items: center; gap: 12px; }
    .bxc-catalogo-peces { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .bxc-catalogo-peces { grid-template-columns: 1fr; }
    .bxc-dash-kpis { grid-template-columns: 1fr 1fr; }
    .bxc-peces-disponibles { grid-template-columns: 1fr; }
    .bxc-mis-peceras { grid-template-columns: 1fr; }
}
