/* ==========================================================================
   TONALIXCORE HUB REDESIGN - COMMAND CENTER 2026 (ULTRA-TACTICAL GLASS UI)
   ========================================================================== */

:root {
    --txc-bg-dark: #040812;
    --txc-card-bg: rgba(10, 16, 30, 0.75);
    --txc-card-border: 1px solid rgba(0, 210, 255, 0.25);
    --txc-card-glow: 0 0 20px rgba(0, 210, 255, 0.15);
    --txc-blue: #00d2ff;
    --txc-teal: #00ffaa;
    --txc-pink: #ff0055;
    --txc-amber: #ffb000;
    --txc-text-bright: #ffffff;
    --txc-text-sub: #8a9bb5;
    --txc-radius-lg: 16px;
    --txc-radius-md: 10px;
    --txc-radius-sm: 6px;
    --txc-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset & Body override con Marca de Agua Emblema Tonalix */
.hub-v2-body {
    background-color: var(--txc-bg-dark) !important;
    background-image: 
        radial-gradient(circle at 50% 40%, rgba(0, 210, 255, 0.12) 0%, transparent 60%),
        radial-gradient(circle at 15% 15%, rgba(0, 210, 255, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(255, 0, 85, 0.06) 0%, transparent 40%) !important;
    color: var(--txc-text-bright);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* MARCA DE AGUA EMBLEMA NÚCLEO TONALIX CORE (MARCA ORIGINAL) */
.hub-v2-body::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 650px;
    height: 650px;
    background-image: url('../img/tonalix_logo_v4.webp');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.15;
    filter: drop-shadow(0 0 50px rgba(0, 210, 255, 0.4));
    pointer-events: none;
    z-index: 0;
}

/* Header Táctico Superior */
.tactical-header-v2 {
    height: 64px;
    padding: 0 24px;
    background: rgba(6, 10, 20, 0.85);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0, 210, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo-img {
    height: 38px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(0, 210, 255, 0.5));
}

.brand-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #ffffff 0%, var(--txc-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.brand-subtitle {
    font-size: 0.65rem;
    color: var(--txc-teal);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.header-status-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-badge-v2 {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 210, 255, 0.08);
    border: 1px solid rgba(0, 210, 255, 0.3);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--txc-blue);
    font-family: 'Space Mono', monospace;
}

.status-dot-pulse {
    width: 8px;
    height: 8px;
    background-color: var(--txc-teal);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--txc-teal);
    animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.75); }
}

/* Layout Principal & Viewports */
.hub-main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
    position: relative;
    padding-bottom: 90px;
}

/* Tab Views */
.tab-view {
    display: none;
    animation: fadeInView 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
    height: 100%;
}

.tab-view.active-view {
    display: block;
}

@keyframes fadeInView {
    from { opacity: 0; transform: translateY(10px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Grid de Tarjetas Tácticas de Apps */
.apps-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    width: 100%;
}

.app-card-v2 {
    background: var(--txc-card-bg);
    border: var(--txc-card-border);
    border-radius: var(--txc-radius-lg);
    padding: 24px;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    transition: var(--txc-transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.app-card-v2:hover {
    transform: translateY(-4px);
    border-color: var(--txc-blue);
    box-shadow: 0 10px 30px rgba(0, 210, 255, 0.25);
}

.app-card-v2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--txc-blue), var(--txc-teal));
    opacity: 0.7;
}

.app-header-v2 {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.app-icon-badge {
    width: 52px;
    height: 52px;
    border-radius: var(--txc-radius-md);
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid rgba(0, 210, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: inset 0 0 15px rgba(0, 210, 255, 0.2);
}

.app-tag-v2 {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tag-available {
    background: rgba(0, 255, 170, 0.15);
    color: var(--txc-teal);
    border: 1px solid rgba(0, 255, 170, 0.4);
}

.tag-tactical {
    background: rgba(0, 210, 255, 0.15);
    color: var(--txc-blue);
    border: 1px solid rgba(0, 210, 255, 0.4);
}

.tag-vip {
    background: rgba(255, 176, 0, 0.15);
    color: var(--txc-amber);
    border: 1px solid rgba(255, 176, 0, 0.4);
}

.app-title-v2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--txc-text-bright);
    margin: 0 0 6px 0;
}

.app-desc-v2 {
    font-size: 0.85rem;
    color: var(--txc-text-sub);
    line-height: 1.5;
    margin-bottom: 20px;
}

.app-actions-v2 {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.btn-v2 {
    flex: 1;
    padding: 10px 16px;
    border-radius: var(--txc-radius-md);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--txc-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    border: none;
}

.btn-v2-primary {
    background: linear-gradient(135deg, var(--txc-blue), #0077ff);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
}

.btn-v2-primary:hover {
    background: linear-gradient(135deg, #00e5ff, #0088ff);
    box-shadow: 0 6px 20px rgba(0, 210, 255, 0.5);
}

.btn-v2-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--txc-text-bright);
}

.btn-v2-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Quick Dock Flotante Inferior */
.quick-dock-v2 {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(8, 14, 28, 0.85);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 210, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 210, 255, 0.2);
    border-radius: 30px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 999;
}

.dock-item-v2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border-radius: 20px;
    color: var(--txc-text-sub);
    cursor: pointer;
    transition: var(--txc-transition);
    border: 1px solid transparent;
    user-select: none;
}

.dock-item-v2:hover {
    color: var(--txc-blue);
    background: rgba(0, 210, 255, 0.1);
}

.dock-item-v2.active-dock {
    color: #fff;
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.3), rgba(0, 255, 170, 0.2));
    border-color: rgba(0, 210, 255, 0.5);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.3);
}

.dock-icon {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.dock-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* OVERLAY DE LOGIN DE SEGURIDAD */
.security-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, rgba(8, 14, 28, 0.98) 0%, #03050a 100%);
    -webkit-backdrop-filter: blur(25px);
    backdrop-filter: blur(25px);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 20px;
}

.login-modal-box {
    background: rgba(12, 18, 34, 0.85);
    border: 1px solid rgba(0, 210, 255, 0.35);
    border-radius: 20px;
    padding: 36px 32px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 0 50px rgba(0, 210, 255, 0.2), inset 0 0 20px rgba(0, 210, 255, 0.1);
    text-align: center;
}

/* PROTECTOR DE PANTALLA (SCREENSAVER) */
.screensaver-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.screensaver-overlay.active {
    display: flex;
}

.hud-clock-time {
    font-family: 'Space Mono', monospace;
    font-size: 4.5rem;
    font-weight: 700;
    color: var(--txc-blue);
    text-shadow: 0 0 30px var(--txc-blue);
    margin-bottom: 10px;
}

.hud-clock-date {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: var(--txc-teal);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 30px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .tactical-header-v2 {
        padding: 0 14px;
    }
    .brand-title {
        font-size: 0.95rem;
    }
    .status-badge-v2 {
        padding: 4px 8px;
        font-size: 0.65rem;
    }
    .quick-dock-v2 {
        width: 92%;
        bottom: 12px;
        padding: 6px 8px;
        gap: 4px;
    }
    .dock-item-v2 {
        padding: 6px 10px;
        flex: 1;
    }
    .dock-label {
        font-size: 0.55rem;
    }
}

/* BADGES DE PERMISOS RBAC (ESTILO LIVE365) */
.badge-rbac {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.badge-rbac.full {
    background: rgba(0, 255, 170, 0.2);
    color: #00ffaa;
    border: 1px solid rgba(0, 255, 170, 0.4);
}

.badge-rbac.read {
    background: rgba(0, 210, 255, 0.2);
    color: #00d2ff;
    border: 1px solid rgba(0, 210, 255, 0.4);
}

.badge-rbac.none {
    background: rgba(255, 0, 85, 0.2);
    color: #ff0055;
    border: 1px solid rgba(255, 0, 85, 0.4);
}
