/* ==========================================
   ESTILOS PARA EL MANDO DE CONTROL REMOTO (TV REMOTE)
   Optimizado para celulares, tablets y PC
   ========================================== */

:root {
    --remote-bg: #f8fafc;
    --remote-card-bg: #ffffff;
    --remote-accent: #007A53;
    --remote-accent-dark: #00563b;
    --remote-accent-light: #e6f5ef;
    --remote-border: #e2e8f0;
    --remote-text: #0f172a;
    --remote-muted: #64748b;
    --remote-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body.remote-body {
    margin: 0;
    padding: 16px;
    background-color: var(--remote-bg);
    color: var(--remote-text);
    font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ENCABEZADO */
.remote-header {
    width: 100%;
    max-width: 640px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--remote-card-bg);
    border: 1px solid var(--remote-border);
    border-radius: 16px;
    box-shadow: var(--remote-shadow);
    margin-bottom: 16px;
    box-sizing: border-box;
}

.remote-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.remote-logo {
    height: 38px;
    object-fit: contain;
    flex-shrink: 0;
}

.remote-title {
    font-family: var(--font-heading, inherit);
    font-size: 1.12rem;
    font-weight: 800;
    margin: 0;
    color: var(--remote-text);
    line-height: 1.2;
}

.remote-subtitle {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--remote-accent);
    margin: 2px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remote-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.remote-ip-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 20px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

.remote-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

.status-dot.online {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.status-dot.idle {
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
}

.status-dot.offline {
    background: #ef4444;
}

/* CONTENEDOR PRINCIPAL */
.remote-grid {
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.remote-card {
    background: var(--remote-card-bg);
    border: 1px solid var(--remote-border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--remote-shadow);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading, inherit);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--remote-text);
    margin: 0 0 14px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-title svg {
    color: var(--remote-accent);
}

/* ==========================================
   SECCIÓN 1: NAVEGACIÓN PRINCIPAL
   ========================================== */
.navigation-card {
    border: 2px solid var(--remote-accent-light);
}

.nav-button-group {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.2fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.btn-remote-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--remote-accent);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 14px 12px;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 122, 83, 0.25);
    transition: transform 0.1s ease, background-color 0.15s ease;
    user-select: none;
}

.btn-remote-nav:active {
    transform: scale(0.94);
    background: var(--remote-accent-dark);
}

.current-page-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: 1px solid var(--remote-border);
    border-radius: 12px;
    padding: 8px 4px;
    text-align: center;
}

.current-page-indicator .page-label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--remote-muted);
}

.current-page-indicator .page-numbers {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--remote-text);
}

.page-chips-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.page-chips-container::-webkit-scrollbar {
    display: none;
}

.page-chip {
    flex: 1;
    min-width: 44px;
    padding: 8px 4px;
    background: #f8fafc;
    border: 1.5px solid var(--remote-border);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--remote-muted);
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.page-chip.active {
    background: var(--remote-accent);
    color: #ffffff;
    border-color: var(--remote-accent);
    box-shadow: 0 4px 10px rgba(0, 122, 83, 0.25);
}

.page-chip:active {
    transform: scale(0.94);
}

/* ==========================================
   SECCIÓN 2: AUTO-ROTACIÓN Y VISTAS
   ========================================== */
.controls-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.btn-remote-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    border: 1.5px solid var(--remote-border);
    background: #f8fafc;
    color: var(--remote-muted);
    font-weight: 800;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-remote-toggle.active {
    background: #ecfdf5;
    border-color: #10b981;
    color: #065f46;
}

.toggle-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #94a3b8;
}

.btn-remote-toggle.active .toggle-dot {
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.btn-remote-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    border: 1.5px solid var(--remote-border);
    background: #f8fafc;
    color: var(--remote-text);
    font-weight: 800;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-remote-action:active,
.btn-remote-toggle:active {
    transform: scale(0.95);
}

.view-mode-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-view-choice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border-radius: 10px;
    border: 1.5px solid var(--remote-border);
    background: #ffffff;
    color: var(--remote-muted);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-view-choice.active {
    background: var(--remote-accent);
    color: #ffffff;
    border-color: var(--remote-accent);
}

/* ==========================================
   SECCIÓN 3: PROYECCIÓN DE ACTIVIDAD
   ========================================== */
.btn-close-tv-modal {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #f87171;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.btn-close-tv-modal:active {
    transform: scale(0.94);
}

.activities-remote-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.activity-remote-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid var(--remote-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.activity-remote-item:hover,
.activity-remote-item:active {
    background: var(--remote-accent-light);
    border-color: var(--remote-accent);
    transform: translateX(3px);
}

.act-info-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--remote-text);
    line-height: 1.2;
}

.act-info-meta {
    font-size: 0.75rem;
    color: var(--remote-muted);
    margin-top: 2px;
}

/* ==========================================
   SECCIÓN 4: FLASH BANNER
   ========================================== */
.flash-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flash-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--remote-border);
    border-radius: 10px;
    font-size: 0.95rem;
    outline: none;
    background: #f8fafc;
    font-weight: 600;
}

.flash-input:focus {
    border-color: var(--remote-accent);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 122, 83, 0.12);
}

.btn-send-flash {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    background: #ea580c;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
    transition: transform 0.1s ease;
}

.btn-send-flash:active {
    transform: scale(0.96);
    background: #c2410c;
}

/* ==========================================
   SECCIÓN 5: ACCIONES DE SISTEMA
   ========================================== */
.system-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-system-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 6px;
    border-radius: 10px;
    border: 1px solid var(--remote-border);
    background: #f8fafc;
    color: var(--remote-muted);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.15s ease;
}

.btn-system-action:active {
    transform: scale(0.95);
    background: #e2e8f0;
}

/* FEEDBACK TOAST */
.remote-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(50px);
    background: #0f172a;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 2000;
    white-space: nowrap;
}

.remote-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ==========================================
   OPTIMIZACIÓN MÓVIL (PANTALLAS < 480px)
   ========================================== */
@media (max-width: 480px) {
    body.remote-body {
        padding: 10px;
    }

    .remote-header {
        padding: 12px 14px;
        gap: 8px;
    }

    .remote-logo {
        height: 32px;
    }

    .remote-title {
        font-size: 0.98rem;
    }

    .remote-subtitle {
        font-size: 0.72rem;
    }

    .remote-status-badge {
        padding: 4px 9px;
        font-size: 0.72rem;
    }

    .remote-card {
        padding: 14px;
    }

    .btn-remote-nav {
        padding: 12px 8px;
        font-size: 0.85rem;
    }

    .current-page-indicator .page-numbers {
        font-size: 1.02rem;
    }
}

/* ==========================================
   SELECTOR DE PESTAÑA PROYECTADA EN EL MANDO
   ========================================== */
.remote-tab-switcher {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 14px;
    border: 1px solid var(--remote-border);
}

.btn-remote-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border: none;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--remote-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-remote-tab:active {
    transform: scale(0.96);
}

.btn-remote-tab.active {
    background: #ffffff;
    color: var(--remote-accent);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.btn-remote-tab#btn-tab-logros.active {
    color: #b45309;
}

/* FILTROS DE SPOTLIGHT */
.btn-filter-spotlight {
    flex: 1;
    background: #f1f5f9;
    border: 1px solid var(--remote-border);
    padding: 7px 12px;
    border-radius: 9px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--remote-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-filter-spotlight.active {
    background: var(--remote-accent);
    color: #ffffff;
    border-color: var(--remote-accent);
}

.btn-filter-spotlight#btn-spotlight-ach.active {
    background: #f59e0b;
    border-color: #f59e0b;
}

/* ITEMS DE LOGROS EN LA LISTA REMOTA */
.remote-achievement-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid var(--remote-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 8px;
}

.remote-achievement-card:active {
    transform: scale(0.98);
    background: #f8fafc;
}

.remote-ach-metric {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-heading);
    font-size: 0.76rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
    flex-shrink: 0;
    line-height: 1.2;
}

.remote-ach-metric.diamante {
    background: #ecfeff;
    color: #0891b2;
    border-color: #a5f3fc;
}

.remote-ach-metric.esmeralda {
    background: #ecfdf5;
    color: #007A53;
    border-color: #a7f3d0;
}

/* ==========================================
   MODAL DE BLOQUEO POR PIN (REMOTE SECURITY)
   ========================================== */
html.pin-locked,
body.pin-locked {
    overflow: hidden !important;
    height: 100% !important;
    max-height: 100vh !important;
    touch-action: none !important;
    position: fixed !important;
    width: 100% !important;
}

.pin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 16px;
    box-sizing: border-box;
    overscroll-behavior: contain;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.pin-modal-card {
    touch-action: auto;
    background: #ffffff;
    width: 100%;
    max-width: 360px;
    border-radius: 24px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 122, 83, 0.15);
    animation: pinPopIn 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes pinPopIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.pin-icon-box {
    width: 56px;
    height: 56px;
    background: #e6f5ef;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
}

.pin-modal-card h2 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.pin-modal-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.4;
}

.pin-dots-row {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 18px;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: transparent;
    transition: all 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.pin-dot.filled {
    background: #007A53;
    border-color: #007A53;
    transform: scale(1.15);
    box-shadow: 0 0 10px rgba(0, 122, 83, 0.4);
}

.pin-error-text {
    font-size: 0.82rem;
    font-weight: 700;
    color: #dc2626;
    margin-bottom: 14px;
    animation: pinShake 0.3s ease;
}

@keyframes pinShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.pin-key {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    padding: 14px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
}

.pin-key:active {
    background: #e2e8f0;
    transform: scale(0.94);
}

.pin-key.pin-key-action {
    background: #f1f5f9;
    color: var(--text-secondary);
    font-size: 1rem;
}

