/**
 * RUSTPC // Command Node v4.0
 * Ultra Premium Industrial Theme - BUTTER SMOOTH Edition
 * © 2025 tonieninja
 */

/* === ULTRA PERFORMANCE OPTIMIZATIONS === */
* {
    -webkit-tap-highlight-color: transparent;
}

/* GPU Layer Promotion for animated elements */
.device-card,
.camera-card,
.tech-panel,
.modal-panel,
.toast,
.btn-cyber,
.industrial-switch,
.toggle-thumb,
.switch-lever,
.switch-indicator {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

:root {
    --primary: #f97316;
    --primary-dim: rgba(249, 115, 22, 0.15);
    --primary-glow: rgba(249, 115, 22, 0.4);
    --primary-bright: #fb923c;
    --secondary: #06b6d4;
    --secondary-dim: rgba(6, 182, 212, 0.15);
    --secondary-bright: #22d3ee;
    --success: #22c55e;
    --success-dim: rgba(34, 197, 94, 0.15);
    --warning: #eab308;
    --warning-dim: rgba(234, 179, 8, 0.15);
    --danger: #ef4444;
    --danger-dim: rgba(239, 68, 68, 0.15);
    --danger-bright: #f87171;
    
    --bg-color: #030305;
    --bg-secondary: #080810;
    --surface: #0c0c14;
    --surface-elevated: #12121c;
    --panel-bg: #0a0a12;
    --border-dim: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(249, 115, 22, 0.3);
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --glass-bg: rgba(12, 12, 20, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    
    --gradient-primary: linear-gradient(135deg, #f97316, #fb923c);
    --gradient-secondary: linear-gradient(135deg, #06b6d4, #22d3ee);
    --gradient-danger: linear-gradient(135deg, #ef4444, #f87171);
    --gradient-dark: linear-gradient(180deg, #0c0c14 0%, #030305 100%);
    --gradient-glow: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(6, 182, 212, 0.1));
    
    --shadow-glow: 0 0 50px rgba(249, 115, 22, 0.15);
    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    
    /* ULTRA BUTTER SMOOTH EASING - 120fps feel */
    --ease-smooth: cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-butter: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-silk: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-circ: cubic-bezier(0, 0.55, 0.45, 1);
    --ease-quint: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-power4: cubic-bezier(0.76, 0, 0.24, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    position: relative;
}

/* === SIMPLE BACKGROUND === */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 100% 80% at 50% -30%, rgba(249, 115, 22, 0.08), transparent 70%),
        radial-gradient(ellipse 80% 60% at 100% 20%, rgba(6, 182, 212, 0.05), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
    background-size: 80px 80px;
    pointer-events: none;
    z-index: 0;
}

/* Floating particles effect */
.particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--primary);
    border-radius: 50%;
    animation: floatParticle 40s infinite;
    opacity: 0.15;
}

.particle:nth-child(even) {
    background: var(--secondary);
    opacity: 0.1;
}

@keyframes floatParticle {
    0%, 100% { transform: translate3d(0, 100vh, 0) scale(0); opacity: 0; }
    10% { opacity: 0.2; }
    90% { opacity: 0.2; }
    50% { transform: translate3d(0, -10vh, 0) scale(1); }
}

/* === LOADER - ULTRA PREMIUM CINEMATIC === */
#loader {
    background: var(--bg-color);
    background-image: 
        radial-gradient(ellipse 100% 80% at 50% 50%, rgba(249, 115, 22, 0.08), transparent),
        radial-gradient(ellipse 60% 40% at 20% 80%, rgba(6, 182, 212, 0.05), transparent);
    overflow: hidden;
}

/* Subtle grid background */
#loader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(90deg, rgba(249, 115, 22, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(249, 115, 22, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
    animation: gridFade 3s ease-in-out infinite alternate;
}

@keyframes gridFade {
    0% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

/* Logo Canvas Container */
.loader-canvas-container {
    width: 160px;
    height: 160px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 20px rgba(249, 115, 22, 0.4));
}

/* Shield outline drawing */
.draw-shield-outline {
    stroke-dasharray: 350;
    stroke-dashoffset: 350;
    animation: drawShield 1.5s ease-out 0.2s forwards;
}

@keyframes drawShield {
    0% { stroke-dashoffset: 350; }
    100% { stroke-dashoffset: 0; }
}

/* Shield fill fade in */
.draw-shield-fill {
    animation: fillFade 0.8s ease-out 1.4s forwards;
}

.draw-inner-cut {
    animation: fillFade 0.4s ease-out 1.6s forwards;
}

@keyframes fillFade {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* R stroke animations - sequential drawing */
.draw-r-stroke {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
}

.draw-r-vertical {
    animation: drawStroke 0.5s ease-out 1.8s forwards;
}

.draw-r-top {
    stroke-dasharray: 150;
    stroke-dashoffset: 150;
    animation: drawStrokeTop 0.7s ease-out 2.1s forwards;
}

.draw-r-leg {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: drawStroke 0.4s ease-out 2.6s forwards;
}

@keyframes drawStroke {
    0% { stroke-dashoffset: 100; }
    100% { stroke-dashoffset: 0; }
}

@keyframes drawStrokeTop {
    0% { stroke-dashoffset: 150; }
    100% { stroke-dashoffset: 0; }
}

/* Tech nodes pop in */
.draw-node {
    opacity: 0;
    transform-origin: center;
    transform: scale(0);
}

.draw-node-1 {
    animation: nodePopIn 0.3s ease-out 2.3s forwards;
}

.draw-node-2 {
    animation: nodePopIn 0.3s ease-out 2.9s forwards;
}

.draw-node-3 {
    animation: nodePopIn 0.3s ease-out 2.5s forwards;
}

@keyframes nodePopIn {
    0% { 
        opacity: 0; 
        transform: scale(0);
    }
    50% { 
        transform: scale(1.5);
    }
    100% { 
        opacity: 1; 
        transform: scale(1);
    }
}

/* Circuit lines */
.draw-circuit {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    animation: drawCircuit 0.4s ease-out 3s forwards, circuitFade 0.3s ease-out 3s forwards;
}

.draw-circuit:nth-child(9) { animation-delay: 3.1s, 3.1s; }
.draw-circuit:nth-child(10) { animation-delay: 3.2s, 3.2s; }

@keyframes drawCircuit {
    0% { stroke-dashoffset: 20; }
    100% { stroke-dashoffset: 0; }
}

@keyframes circuitFade {
    0% { opacity: 0; }
    100% { opacity: 0.6; }
}

/* Text reveal */
.loader-text-reveal {
    opacity: 0;
    transform: translateY(20px);
    animation: textReveal 0.6s ease-out 3.2s forwards;
}

.loader-text-delay {
    animation-delay: 3.4s;
}

@keyframes textReveal {
    0% { 
        opacity: 0; 
        transform: translateY(20px);
    }
    100% { 
        opacity: 1; 
        transform: translateY(0);
    }
}

/* Status text */
.loader-status-text {
    opacity: 0;
    animation: fadeIn 0.4s ease-out 3.5s forwards;
}

.loader-status-text #loader-status {
    transition: opacity 0.15s ease, transform 0.15s ease, color 0.3s ease;
    display: inline-block;
}

.loader-version {
    opacity: 0;
    animation: fadeIn 0.4s ease-out 3.7s forwards;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Simple Progress Bar */
.loader-progress-container {
    width: 200px;
    position: relative;
    opacity: 0;
    animation: fadeIn 0.4s ease-out 3.6s forwards;
}

.loader-progress-bar {
    height: 4px;
    background: rgba(249, 115, 22, 0.15);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.loader-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--primary-bright));
    border-radius: 2px;
    animation: progressFill 2s ease-in-out 3.8s forwards;
    position: relative;
}

.loader-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1s infinite;
}

@keyframes progressFill {
    0% { width: 0%; }
    20% { width: 25%; }
    40% { width: 45%; }
    60% { width: 70%; }
    80% { width: 90%; }
    100% { width: 100%; }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

.loader-progress-glow {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 10px;
    transform: translateY(-50%);
    background: radial-gradient(ellipse at center, rgba(249, 115, 22, 0.3), transparent);
    filter: blur(4px);
    opacity: 0;
    animation: glowPulse 1.5s ease-in-out 4s infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* === HEADER === */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(180deg, rgba(8, 8, 14, 0.95) 0%, rgba(3, 3, 5, 0.9) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--border-dim);
    transition: all 0.6s var(--ease-butter);
}

header:hover {
    background: linear-gradient(180deg, rgba(10, 10, 18, 0.97) 0%, rgba(5, 5, 8, 0.95) 100%);
    will-change: background;
}

.header-glow::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-glow), transparent);
    animation: headerGlowPulse 4s ease-in-out infinite;
}

@keyframes headerGlowPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* === LOGO MARK STYLING === */
.logo-mark {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 4px 12px rgba(249, 115, 22, 0.4));
    transition: all 0.5s var(--ease-spring);
}

.logo-mark:hover {
    filter: drop-shadow(0 8px 25px rgba(249, 115, 22, 0.65));
    transform: translateY(-2px) scale(1.05);
    will-change: transform, filter;
}

.logo-mark svg {
    width: 100%;
    height: 100%;
}

/* Footer Logo - Compact shield version */
.footer-logo-box {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-logo-box svg {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 2px 6px rgba(249, 115, 22, 0.3));
}

/* === TABS LOCK OVERLAY === */
#tabs-lock-overlay {
    transition: opacity 0.4s var(--ease-smooth);
}

#tabs-lock-overlay.opacity-0 {
    opacity: 0;
}

#tabs-lock-overlay.pointer-events-none {
    pointer-events: none;
}

#lock-step-1,
#lock-step-2 {
    transition: all 0.3s var(--ease-smooth);
}

/* === INDUSTRIAL LIGHTS - PROPER BLINKING === */
.industrial-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
    transition: all 0.5s var(--ease-out-back);
}

/* OFFLINE - RED BLINKING */
.industrial-light.offline {
    background: #ef4444;
    box-shadow: 
        0 0 8px #ef4444,
        0 0 16px rgba(239, 68, 68, 0.6),
        0 0 24px rgba(239, 68, 68, 0.4),
        inset 0 0 4px rgba(255, 255, 255, 0.3);
    animation: redBlink 0.8s ease-in-out infinite;
}

/* RECONNECTING - YELLOW PULSING */
.industrial-light.reconnecting {
    background: #eab308;
    box-shadow: 
        0 0 8px #eab308,
        0 0 16px rgba(234, 179, 8, 0.6),
        0 0 24px rgba(234, 179, 8, 0.4),
        inset 0 0 4px rgba(255, 255, 255, 0.3);
    animation: yellowPulse 0.5s ease-in-out infinite;
}

@keyframes yellowPulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.5;
        transform: scale(0.85);
    }
}

/* ONLINE - GREEN BLINKING */
.industrial-light.online {
    background: #22c55e;
    box-shadow: 
        0 0 8px #22c55e,
        0 0 16px rgba(34, 197, 94, 0.6),
        0 0 24px rgba(34, 197, 94, 0.4),
        inset 0 0 4px rgba(255, 255, 255, 0.3);
    animation: greenBlink 1.2s ease-in-out infinite;
}

@keyframes redBlink {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
        box-shadow: 
            0 0 8px #ef4444,
            0 0 16px rgba(239, 68, 68, 0.6),
            0 0 24px rgba(239, 68, 68, 0.4),
            inset 0 0 4px rgba(255, 255, 255, 0.3);
    }
    50% { 
        opacity: 0.4;
        transform: scale(0.9);
        box-shadow: 
            0 0 4px #ef4444,
            0 0 8px rgba(239, 68, 68, 0.3),
            inset 0 0 2px rgba(255, 255, 255, 0.2);
    }
}

@keyframes greenBlink {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
        box-shadow: 
            0 0 8px #22c55e,
            0 0 16px rgba(34, 197, 94, 0.6),
            0 0 24px rgba(34, 197, 94, 0.4),
            inset 0 0 4px rgba(255, 255, 255, 0.3);
    }
    50% { 
        opacity: 0.7;
        transform: scale(0.95);
        box-shadow: 
            0 0 12px #22c55e,
            0 0 20px rgba(34, 197, 94, 0.8),
            0 0 30px rgba(34, 197, 94, 0.5),
            inset 0 0 6px rgba(255, 255, 255, 0.4);
    }
}

/* Simplified light - no reflection needed */

/* === TECH PANELS - PREMIUM GLASS === */
.tech-panel {
    background: linear-gradient(180deg, 
        rgba(12, 12, 20, 0.9) 0%, 
        rgba(8, 8, 16, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.6s var(--ease-spring), box-shadow 0.5s var(--ease-butter), border-color 0.5s var(--ease-butter);
}

.tech-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
    border-color: var(--border-light);
    will-change: transform, box-shadow;
}

.tech-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.tech-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 0%, rgba(249, 115, 22, 0.03), transparent 50%);
    pointer-events: none;
    border-radius: 20px;
}

/* === CONSOLE === */
.console-panel {
    background: linear-gradient(180deg, #0a0a0f 0%, #050508 100%);
    border: 1px solid var(--border-dim);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    transition: all 0.6s var(--ease-butter);
}

.console-panel:hover {
    border-color: var(--border-light);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), inset 0 0 80px rgba(249, 115, 22, 0.025);
    will-change: border-color, box-shadow;
}

.console-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 4px
    );
    pointer-events: none;
    opacity: 0.6;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-dim);
}

.console-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.console-dots {
    display: flex;
    gap: 6px;
}

.console-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-dim);
}

.console-dots span:nth-child(1) { background: #ef4444; }
.console-dots span:nth-child(2) { background: #eab308; }
.console-dots span:nth-child(3) { background: #22c55e; }

.console-body {
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    overflow-y: auto;
    max-height: 300px;
    position: relative;
    z-index: 1;
}

.console-line {
    display: block;
    margin-bottom: 8px;
    line-height: 1.5;
    animation: consoleFadeIn 0.5s var(--ease-butter);
}

@keyframes consoleFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(8px) translateX(-5px);
        filter: blur(2px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0) translateX(0);
        filter: blur(0);
    }
}

.console-time {
    color: var(--text-dim);
    font-size: 10px;
    flex-shrink: 0;
}

/* === UNIVERSAL CONSOLE BOX STYLE === */
.console-box {
    background: var(--box-bg);
    border: 1px solid var(--box-border);
    border-radius: 10px;
    padding: 10px 14px;
    position: relative;
    overflow: hidden;
}

.console-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--box-color);
}

.console-box-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.console-badge {
    font-size: 9px;
    font-weight: 700;
    color: var(--box-color);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--box-bg);
    border: 1px solid var(--box-border);
    padding: 2px 8px;
    border-radius: 4px;
}

.console-box-message {
    color: var(--text-main);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    padding-left: 6px;
}

/* Admin Broadcast in Console */
.admin-broadcast-line {
    display: block !important;
    margin: 12px 0;
}

.admin-broadcast-box {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(249, 115, 22, 0.1));
    border: 1px solid rgba(234, 179, 8, 0.4);
    border-radius: 10px;
    padding: 12px 16px;
    position: relative;
    overflow: hidden;
}

.admin-broadcast-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #eab308, #f97316);
}

.admin-broadcast-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.admin-broadcast-badge {
    font-size: 10px;
    font-weight: 700;
    color: #eab308;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(234, 179, 8, 0.2);
    padding: 3px 10px;
    border-radius: 4px;
}

.admin-broadcast-badge i {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.admin-broadcast-message {
    color: var(--text-main);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    padding-left: 8px;
}

/* === ALARM SUBSCRIPTION STYLES === */
.alarm-subscribe-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 10px;
    padding: 12px 16px;
    position: relative;
    overflow: hidden;
}

.alarm-subscribe-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #3b82f6, #8b5cf6);
}

.alarm-subscribe-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.alarm-subscribe-badge {
    font-size: 10px;
    font-weight: 700;
    color: #3b82f6;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.2);
    padding: 3px 10px;
    border-radius: 4px;
}

.alarm-subscribe-info {
    padding-left: 8px;
}

.alarm-device-name {
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alarm-device-id {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 2px;
}

.alarm-subscribe-note {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 8px;
    padding-left: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* === ALARM TRIGGER STYLES === */
.alarm-trigger-box {
    border-radius: 10px;
    padding: 12px 16px;
    position: relative;
    overflow: hidden;
}

.alarm-trigger-box.active {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(234, 179, 8, 0.1));
    border: 1px solid rgba(239, 68, 68, 0.5);
    animation: alarmPulse 1s ease-in-out infinite;
}

.alarm-trigger-box.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #ef4444, #eab308);
}

.alarm-trigger-box.inactive {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.alarm-trigger-box.inactive::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #22c55e, #3b82f6);
}

@keyframes alarmPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.6); }
}

.alarm-trigger-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.alarm-trigger-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 4px;
}

.alarm-trigger-badge.danger {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.2);
}

.alarm-trigger-badge.safe {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.2);
}

.alarm-trigger-info {
    padding-left: 8px;
}

.alarm-trigger-status {
    color: #ef4444;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    padding-left: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alarm-trigger-status.safe {
    color: #22c55e;
}

.alarm-trigger-status .animate-pulse {
    animation: pulse 1s ease-in-out infinite;
}

.console-msg {
    color: var(--text-muted);
    word-break: break-word;
}

/* === BUTTONS - ULTRA SMOOTH PREMIUM === */
.btn-cyber {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: 
        transform 0.3s var(--ease-expo),
        box-shadow 0.35s var(--ease-silk),
        filter 0.3s var(--ease-butter);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn-cyber i {
    font-size: 0.9em;
    line-height: 1;
}

/* Ripple effect base */
.btn-cyber::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: 
        width 0.5s var(--ease-expo),
        height 0.5s var(--ease-expo),
        opacity 0.5s var(--ease-silk);
    opacity: 1;
}

.btn-cyber:hover::before {
    width: 300%;
    height: 300%;
    opacity: 0;
}

.btn-cyber:hover {
    box-shadow: 
        0 10px 30px rgba(249, 115, 22, 0.4),
        0 0 0 1px rgba(249, 115, 22, 0.3);
    transform: translateY(-3px);
    filter: brightness(1.1);
}

.btn-cyber:active {
    transform: translateY(1px) scale(0.98);
    transition: transform 0.1s var(--ease-butter);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

/* Focus ring for accessibility */
.btn-cyber:focus-visible {
    outline: 2px solid var(--primary-bright);
    outline-offset: 2px;
}

.btn-cyber:disabled {
    background: var(--surface);
    color: var(--text-dim);
    cursor: not-allowed;
    opacity: 0.5;
    border: 1px dashed var(--border-dim);
    transform: none;
}

.btn-cyber:disabled::before {
    display: none;
}

.btn-cyber:disabled:hover {
    transform: none;
    opacity: 0.5;
    box-shadow: none;
    filter: none;
}

/* Visually show locked state for Open Channel button */
#fcm-listen-btn:disabled {
    background: rgba(100, 116, 139, 0.1);
    border: 1px dashed var(--border-light);
    position: relative;
}

/* Active listening state - green/stop mode */
#fcm-listen-btn.active-listen {
    background: var(--gradient-danger);
    animation: listenPulse 2s ease-in-out infinite;
}

#fcm-listen-btn.active-listen:hover {
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.35);
}

@keyframes listenPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
    }
}

#fcm-listen-btn:disabled::after {
    content: '\f023';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 12px;
    font-size: 12px;
    color: var(--text-dim);
}

/* === TABS === */
.cyber-tab {
    padding: 10px 20px;
    background: var(--surface);
    border: 1px solid var(--border-dim);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.5s var(--ease-butter), color 0.3s var(--ease-butter);
    position: relative;
    overflow: hidden;
}

.cyber-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: all 0.6s var(--ease-spring);
    transform: translateX(-50%);
    border-radius: 2px 2px 0 0;
}

.cyber-tab:hover {
    color: var(--text-main);
    background: var(--surface-elevated);
}

.cyber-tab:hover::after {
    width: 40%;
}

.cyber-tab.active {
    background: var(--glass-bg);
    color: var(--primary);
    border-color: var(--border-light);
}

.cyber-tab.active::after {
    width: 85%;
}

/* === INPUTS - CLEAN STYLE === */
.cyber-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-color);
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 14px;
    transition: all 0.5s var(--ease-butter), box-shadow 0.6s var(--ease-silk);
    position: relative;
}

.cyber-input:hover {
    border-color: var(--border-light);
    background: rgba(8, 8, 16, 0.8);
}

.cyber-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 
        0 0 0 4px var(--primary-dim), 
        0 0 30px var(--primary-dim),
        inset 0 0 15px rgba(249, 115, 22, 0.05);
    background: rgba(8, 8, 16, 0.95);
    will-change: box-shadow;
}

.cyber-input:focus-visible {
    outline: none;
}

.cyber-input::placeholder {
    color: var(--text-dim);
}

/* Override Tailwind forms plugin defaults */
input, textarea, select {
    background-color: var(--bg-color) !important;
    color: var(--text-main) !important;
    border-color: var(--border-dim) !important;
}

input:focus, textarea:focus, select:focus {
    background-color: rgba(8, 8, 16, 0.95) !important;
    border-color: var(--primary) !important;
}

input[type="checkbox"], input[type="radio"] {
    background-color: var(--bg-color) !important;
    border-color: var(--border-dim) !important;
}

input[type="checkbox"]:checked, input[type="radio"]:checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

input[type="color"] {
    background-color: transparent !important;
    border: 1px solid var(--border-dim) !important;
}

.input-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === DEVICE CARDS - ULTRA BUTTER SMOOTH === */
.device-card {
    background: var(--surface);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    padding: 16px;
    transition: 
        transform 0.4s var(--ease-expo),
        box-shadow 0.5s var(--ease-silk),
        border-color 0.3s var(--ease-butter);
    position: relative;
}

.device-card:hover {
    border-color: var(--border-light);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.device-card:active {
    transform: translateY(-4px) scale(1.01);
    transition: transform 0.15s var(--ease-butter);
}

.device-card.active {
    border-color: var(--primary);
    box-shadow: 
        0 0 40px var(--primary-dim), 
        0 25px 60px rgba(0, 0, 0, 0.45),
        inset 0 0 50px rgba(249, 115, 22, 0.03);
    transform: translateY(-6px) scale(1.015);
}

.device-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.device-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-color);
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-dim);
    transition: all 0.5s var(--ease-spring);
    flex-shrink: 0;
}

.device-icon.on {
    background: var(--primary-dim);
    border-color: var(--primary);
    color: var(--primary);
}

.device-info {
    flex: 1;
    min-width: 0;
}

.device-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.device-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-dim);
}

/* Device Tags Row */
.device-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.device-tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--tag-bg);
    color: var(--tag-color);
    border: 1px solid var(--tag-border);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.device-tag-badge i {
    font-size: 8px;
}

.device-tag-badge:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
}

/* Old Device Category Badge - keep for backwards compat */
.device-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.device-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.device-category-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.4s var(--ease-spring);
}

.device-category-btn:hover {
    background: var(--primary-dim);
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.1);
}

/* Device Stats Bar */
.device-stats-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-dim);
}

.device-stats-bar span {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-dim);
}

.device-stats-bar i {
    font-size: 10px;
    opacity: 0.7;
}

.device-delete {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.4s var(--ease-spring);
    flex-shrink: 0;
}

.device-delete:hover {
    background: var(--danger-dim);
    border-color: var(--danger);
    color: var(--danger);
    transform: scale(1.1) rotate(5deg);
}

.device-controls {
    padding-top: 18px;
    border-top: 1px solid var(--border-dim);
    position: relative;
    z-index: 1;
}

.device-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 18px;
    background: linear-gradient(180deg, var(--bg-color) 0%, rgba(3, 3, 5, 0.9) 100%);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.5s var(--ease-spring);
}

.device-toggle:hover {
    border-color: var(--border-light);
}

.device-toggle.on {
    background: linear-gradient(180deg, var(--primary-dim) 0%, rgba(249, 115, 22, 0.05) 100%);
    border-color: var(--primary);
    box-shadow: inset 0 0 25px rgba(249, 115, 22, 0.06);
}

.toggle-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.device-toggle.on .toggle-label {
    color: var(--primary);
}

.toggle-track {
    width: 48px;
    height: 26px;
    background: var(--surface);
    border-radius: 13px;
    position: relative;
    transition: all 0.5s var(--ease-silk);
    border: 1px solid var(--border-dim);
}

.device-toggle.on .toggle-track {
    background: var(--primary);
    border-color: var(--primary-bright);
    box-shadow: 0 0 20px var(--primary-dim);
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.35s var(--ease-expo), box-shadow 0.3s var(--ease-silk);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.device-toggle.on .toggle-thumb {
    transform: translateX(22px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* === INDUSTRIAL SWITCH - ULTRA SMOOTH === */
.industrial-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 18px;
    background: linear-gradient(180deg, #1a1a24 0%, #0d0d12 100%);
    border: 2px solid #2a2a3a;
    border-radius: 12px;
    cursor: pointer;
    transition: 
        border-color 0.3s var(--ease-butter),
        box-shadow 0.4s var(--ease-silk),
        background 0.3s var(--ease-butter);
    position: relative;
    overflow: hidden;
}

.industrial-switch::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 50%);
    pointer-events: none;
}

.industrial-switch:hover {
    border-color: #5a5a6a;
    background: linear-gradient(180deg, #1e1e2a 0%, #101016 100%);
}

.industrial-switch.on {
    border-color: var(--primary);
    box-shadow: 
        0 0 45px rgba(249, 115, 22, 0.25),
        inset 0 0 45px rgba(249, 115, 22, 0.05);
}

.switch-housing {
    position: relative;
    width: 70px;
    height: 36px;
    background: linear-gradient(180deg, #0a0a10 0%, #15151f 100%);
    border: 2px solid #2a2a3a;
    border-radius: 6px;
    box-shadow: 
        inset 0 3px 8px rgba(0, 0, 0, 0.6),
        inset 0 -1px 2px rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.switch-lever {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 30px;
    height: 28px;
    background: linear-gradient(180deg, 
        #4a4a5a 0%, 
        #3a3a4a 30%,
        #2a2a3a 70%,
        #3a3a4a 100%);
    border-radius: 4px;
    transition: 
        left 0.4s var(--ease-expo),
        background 0.3s var(--ease-butter);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.switch-lever::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, rgba(0,0,0,0.4), rgba(0,0,0,0.2), rgba(0,0,0,0.4));
    border-radius: 2px;
}

.switch-lever::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    height: 6px;
    background: linear-gradient(180deg, rgba(255,255,255,0.1), transparent);
    border-radius: 2px 2px 0 0;
}

.industrial-switch.on .switch-lever {
    left: calc(100% - 34px);
    background: linear-gradient(180deg, 
        #6a6a7a 0%, 
        #5a5a6a 30%,
        #4a4a5a 70%,
        #5a5a6a 100%);
}

.switch-indicator {
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 
        0 0 6px #ef4444,
        0 0 12px rgba(239, 68, 68, 0.4);
    transition: 
        left 0.4s var(--ease-expo),
        background 0.25s var(--ease-butter),
        box-shadow 0.35s var(--ease-silk);
}

.switch-indicator.on {
    left: calc(100% - 16px);
    background: #22c55e;
    box-shadow: 
        0 0 12px #22c55e,
        0 0 25px rgba(34, 197, 94, 0.6);
}

.switch-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: color 0.4s var(--ease-smooth);
}

.industrial-switch.on .switch-label {
    color: var(--primary);
}

/* === DEVICE MONITOR (For Alarm & Storage) === */
.device-monitor {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 18px;
    background: linear-gradient(180deg, #0d0d14 0%, #08080c 100%);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
}

.monitor-icon {
    width: 40px;
    height: 40px;
    background: var(--surface);
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-dim);
    transition: all 0.4s var(--ease-out-back);
}

.alarm-monitor .monitor-icon {
    color: var(--warning);
    background: rgba(234, 179, 8, 0.1);
    border-color: rgba(234, 179, 8, 0.3);
}

.alarm-monitor .monitor-icon.triggered {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger);
    animation: alarmPulse 0.5s ease-in-out infinite;
}

@keyframes alarmPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }
}

.storage-monitor .monitor-icon {
    color: var(--secondary);
    background: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.3);
}

.monitor-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.alarm-monitor .monitor-label {
    color: var(--warning);
}

.alarm-monitor .monitor-icon.triggered + .monitor-label,
.alarm-monitor:has(.monitor-icon.triggered) .monitor-label {
    color: var(--danger);
}

/* === ALARM DEVICE LAYOUT === */
.alarm-device-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.alarm-device-layout .alarm-monitor {
    flex: 1;
}

.alarm-device-layout .alarm-monitor.triggered {
    background: rgba(239, 68, 68, 0.1);
    border-radius: 10px;
    padding: 8px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Alarm Notification Toggle Button */
.alarm-notify-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.4s var(--ease-spring);
    width: 100%;
}

.alarm-notify-toggle:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.alarm-notify-toggle.active {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
    border-color: rgba(34, 197, 94, 0.4);
}

.alarm-notify-toggle.active:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
    border-color: rgba(239, 68, 68, 0.4);
}

.notify-toggle-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-dim);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.alarm-notify-toggle:hover .notify-toggle-icon {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.alarm-notify-toggle.active .notify-toggle-icon {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.alarm-notify-toggle.active:hover .notify-toggle-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.notify-toggle-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notify-toggle-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.notify-toggle-status {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.notify-toggle-status.off {
    color: var(--text-dim);
}

.notify-toggle-status.on {
    color: #22c55e;
}

.alarm-notify-toggle.active:hover .notify-toggle-status.on {
    color: #ef4444;
}

.alarm-notify-toggle.active:hover .notify-toggle-status.on::after {
    content: ' → OFF';
    font-size: 9px;
}

.alarm-notify-toggle:not(.active):hover .notify-toggle-status.off::after {
    content: ' → ON';
    font-size: 9px;
    color: #22c55e;
}

/* === CAMERA CARDS - ULTRA SMOOTH === */
.camera-card {
    background: linear-gradient(180deg, rgba(18, 18, 28, 0.95) 0%, rgba(12, 12, 20, 0.98) 100%);
    border: 1px solid var(--border-dim);
    border-radius: 16px;
    overflow: hidden;
    transition: 
        transform 0.4s var(--ease-expo),
        box-shadow 0.45s var(--ease-silk),
        border-color 0.3s var(--ease-butter);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.camera-card:hover {
    border-color: var(--border-light);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.5);
}

.camera-card:active {
    transform: translateY(-4px) scale(1.01);
    transition: transform 0.15s var(--ease-butter);
}

.camera-card.active {
    border-color: var(--secondary);
    transform: translateY(-6px) scale(1.02);
    box-shadow: 
        0 0 50px var(--secondary-dim),
        0 35px 70px rgba(0, 0, 0, 0.55),
        inset 0 0 40px rgba(6, 182, 212, 0.04);
}

.camera-feed {
    aspect-ratio: 16/9;
    background: #0a0a0a;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Premium TV Static Noise - animowany szum */
.camera-feed::after {
    content: '';
    position: absolute;
    inset: -100%;
    width: 300%;
    height: 300%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.35;
    pointer-events: none;
    z-index: 5;
    animation: staticNoise 0.15s steps(5) infinite;
}

@keyframes staticNoise {
    0% { transform: translate(0, 0); }
    20% { transform: translate(-5%, -5%); }
    40% { transform: translate(5%, 5%); }
    60% { transform: translate(-3%, 3%); }
    80% { transform: translate(3%, -3%); }
    100% { transform: translate(0, 0); }
}

/* Scanlines overlay */
.camera-feed::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.12) 2px,
        rgba(0, 0, 0, 0.12) 4px
    );
    pointer-events: none;
    z-index: 10;
    opacity: 0.8;
}

/* Smooth fade when camera becomes active */
.camera-card.active .camera-feed::after {
    opacity: 0;
    animation: none;
    transition: opacity 0.5s var(--ease-smooth);
}

.camera-card.active .camera-feed::before {
    opacity: 0.25;
    transition: opacity 0.5s var(--ease-smooth);
}

/* VHS flicker line effect */
.camera-feed .vhs-lines {
    position: absolute;
    inset: 0;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 3px,
            rgba(255, 255, 255, 0.015) 3px,
            rgba(255, 255, 255, 0.015) 4px
        ),
        linear-gradient(
            180deg,
            transparent 0%,
            rgba(255, 255, 255, 0.03) 50%,
            transparent 51%,
            transparent 100%
        );
    background-size: 100% 100%, 100% 200%;
    animation: vhsScan 8s linear infinite;
    pointer-events: none;
    z-index: 6;
}

@keyframes vhsScan {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 0 0, 0 -200%; }
}

.camera-card.active .vhs-lines {
    opacity: 0.4;
}

/* Color distortion - subtle RGB shift */
.camera-feed .color-distort {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 0, 0, 0.015) 0%,
        transparent 30%,
        rgba(0, 255, 0, 0.01) 50%,
        transparent 70%,
        rgba(0, 0, 255, 0.015) 100%
    );
    pointer-events: none;
    z-index: 7;
}

.camera-card.active .color-distort {
    opacity: 0;
}

.camera-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-dim);
    text-align: center;
    z-index: 2;
    transition: opacity 0.4s var(--ease-smooth);
}

/* Hide NO SIGNAL when camera is selected */
.camera-card.active .camera-placeholder {
    opacity: 0;
    pointer-events: none;
}

.camera-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px;
    display: flex;
    justify-content: flex-end;
    z-index: 12;
}

/* LIVE badge - only visible when camera is active */
.camera-rec {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #ef4444;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.camera-card.active .camera-rec {
    display: flex;
}

.camera-rec i {
    animation: recBlink 1s ease-in-out infinite;
}

@keyframes recBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.camera-ptz-badge {
    background: var(--secondary);
    color: white;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.camera-info-bar {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-dim);
}

.camera-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.camera-entity {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
}

.camera-actions {
    display: flex;
    gap: 8px;
}

.camera-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.4s var(--ease-spring);
}

.camera-btn:hover {
    border-color: var(--secondary);
    color: var(--secondary);
    transform: translateY(-2px) scale(1.05);
}

.camera-btn.delete-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* PTZ Button disabled state - when camera not selected */
.camera-btn.ptz-btn.disabled,
.camera-btn.ptz-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
    border-color: var(--border-dim);
    color: var(--text-dim);
}

.camera-btn.ptz-btn.disabled:hover,
.camera-btn.ptz-btn:disabled:hover {
    border-color: var(--border-dim);
    color: var(--text-dim);
    transform: none;
}

/* === MODALS - ULTRA PREMIUM GLASS MORPHISM === */
#modal-overlay {
    transition: all 0.4s var(--ease-smooth);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-panel {
    background: linear-gradient(180deg, 
        rgba(20, 20, 32, 0.98) 0%, 
        rgba(12, 12, 20, 0.99) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 
        0 50px 100px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 80px rgba(249, 115, 22, 0.08);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    transition: all 0.4s var(--ease-out-back);
    transform-origin: center center;
    animation: modalEntrance 0.4s var(--ease-out-back);
}

@keyframes modalEntrance {
    0% {
        opacity: 0;
        transform: scale(0.85) translateY(30px);
        filter: blur(4px);
    }
    60% {
        opacity: 1;
        transform: scale(1.02) translateY(-5px);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

.modal-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: radial-gradient(ellipse 80% 100% at 50% -20%, rgba(249, 115, 22, 0.08) 0%, transparent 70%);
    pointer-events: none;
    border-radius: 24px 24px 0 0;
}

.modal-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 0 0 3px 3px;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.modal-icon-box {
    width: 52px;
    height: 52px;
    background: var(--gradient-primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    box-shadow: 
        0 10px 30px rgba(249, 115, 22, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* Removed icon shine animation for cleaner look */

.modal-icon-box.admin-icon {
    background: var(--gradient-danger);
    box-shadow: 0 15px 40px rgba(239, 68, 68, 0.35);
}

.modal-close {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.4s var(--ease-spring);
}

.modal-close:hover {
    background: var(--danger-dim);
    border-color: var(--danger);
    color: var(--danger);
    transform: rotate(90deg) scale(1.1);
}

/* === SERVER PAIRING MODAL - SPECIAL STYLING === */
#modal-server-pair .modal-panel {
    border-color: rgba(34, 197, 94, 0.3);
    box-shadow: 
        0 50px 100px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(34, 197, 94, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 80px rgba(34, 197, 94, 0.15);
    animation: serverPairAppear 0.5s var(--ease-out-back);
}

#modal-server-pair .modal-panel::after {
    background: linear-gradient(90deg, #22c55e, #10b981);
}

#modal-server-pair .modal-icon-box {
    background: linear-gradient(135deg, #22c55e, #10b981);
    box-shadow: 
        0 10px 30px rgba(34, 197, 94, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: iconPulse 2s ease-in-out infinite;
}

.server-pair-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
}

.server-pair-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.server-pair-row .label {
    color: var(--text-dim);
    font-size: 12px;
    min-width: 80px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.server-pair-row .value {
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

@keyframes serverPairAppear {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes iconPulse {
    0%, 100% {
        box-shadow: 
            0 10px 30px rgba(34, 197, 94, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 
            0 15px 40px rgba(34, 197, 94, 0.6),
            0 0 50px rgba(34, 197, 94, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
}

/* === DELETE MODAL - CLEAN === */
.delete-modal {
    background: linear-gradient(180deg, 
        rgba(20, 20, 32, 0.98) 0%, 
        rgba(12, 12, 20, 0.99) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 24px;
    box-shadow: 
        0 50px 100px rgba(0, 0, 0, 0.8),
        0 0 50px rgba(239, 68, 68, 0.1);
    position: relative;
    overflow: hidden;
}

.delete-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: radial-gradient(ellipse 80% 100% at 50% -30%, rgba(239, 68, 68, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.delete-modal-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    background: var(--danger-dim);
    border: 2px solid var(--danger);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--danger);
    position: relative;
    z-index: 1;
}

/* === AUTH MODAL - COMPACT STEAM STYLE === */
.auth-modal {
    background: linear-gradient(165deg, 
        rgba(23, 26, 33, 0.98) 0%, 
        rgba(27, 40, 56, 0.98) 50%,
        rgba(15, 20, 28, 0.98) 100%);
    border: 2px solid rgba(102, 192, 244, 0.2);
    border-radius: 20px;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.8),
        0 0 100px rgba(102, 192, 244, 0.1),
        inset 0 1px 0 rgba(102, 192, 244, 0.15);
    overflow: hidden;
    position: relative;
    max-height: 85vh;
}

.auth-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 250px;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(102, 192, 244, 0.15) 0%, transparent 70%),
        linear-gradient(180deg, rgba(102, 192, 244, 0.05) 0%, transparent 100%);
    pointer-events: none;
}

.auth-modal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #66c0f4, transparent);
    border-radius: 0 0 10px 10px;
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(180deg, rgba(102, 192, 244, 0.05) 0%, transparent 100%);
    border-bottom: 1px solid rgba(102, 192, 244, 0.1);
    position: relative;
}

.auth-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(102, 192, 244, 0.3), transparent);
}

.auth-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.auth-header-left > div:first-child {
    background: linear-gradient(135deg, #1b2838, #2a475e) !important;
    border: 2px solid rgba(102, 192, 244, 0.3);
    box-shadow: 
        0 10px 40px rgba(102, 192, 244, 0.2),
        inset 0 0 20px rgba(102, 192, 244, 0.1);
}

.auth-header-left > div:first-child i {
    color: #66c0f4 !important;
}

.auth-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.auth-header p {
    font-size: 12px;
    color: #66c0f4;
    margin-top: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.auth-body {
    padding: 20px 24px;
    max-height: calc(85vh - 100px);
    overflow-y: auto;
}

.auth-step {
    background: linear-gradient(180deg, rgba(27, 40, 56, 0.6) 0%, rgba(23, 26, 33, 0.8) 100%);
    border: 1px solid rgba(102, 192, 244, 0.15);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 12px;
    transition: all 0.4s var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

.auth-step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #66c0f4, #1b9aaa);
    opacity: 0;
    transition: opacity 0.4s var(--ease-smooth);
}

.auth-step::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(102, 192, 244, 0.03) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s var(--ease-smooth);
    pointer-events: none;
}

.auth-step:hover {
    border-color: rgba(102, 192, 244, 0.3);
}

.auth-step:hover::before {
    opacity: 1;
}

.auth-step:hover::after {
    opacity: 1;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #1b2838, #2a475e);
    border: 2px solid rgba(102, 192, 244, 0.4);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #66c0f4;
    box-shadow: 
        0 4px 15px rgba(102, 192, 244, 0.2),
        inset 0 0 10px rgba(102, 192, 244, 0.1);
}

.step-title {
    font-weight: 600;
    font-size: 16px;
    color: #ffffff;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.step-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.browser-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.browser-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(180deg, rgba(27, 40, 56, 0.8) 0%, rgba(23, 26, 33, 0.9) 100%);
    border: 1px solid rgba(102, 192, 244, 0.2);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.4s var(--ease-smooth);
}

.browser-link i {
    font-size: 16px;
}

.browser-link:hover {
    border-color: #66c0f4;
    color: #66c0f4;
}

.install-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #1b9aaa 0%, #06b6d4 50%, #22d3ee 100%);
    border-radius: 10px;
    color: white;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.4s var(--ease-smooth);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Removed shine animation for cleaner look */

.install-btn:hover {
    opacity: 0.9;
}

/* Uplink Register Button */
.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #171a21 0%, #1b2838 50%, #2a475e 100%);
    border: 2px solid rgba(102, 192, 244, 0.3);
    border-radius: 14px;
    color: #66c0f4;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.4s var(--ease-smooth), color 0.4s var(--ease-smooth);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-btn:hover:not(:disabled) {
    border-color: #66c0f4;
    color: #a3d9f5;
}

.auth-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.auth-btn i {
    font-size: 24px;
}

/* Auth Terminal - Steam Console Style */
.auth-terminal {
    background: linear-gradient(180deg, #0d1117 0%, #161b22 100%);
    border: 1px solid rgba(102, 192, 244, 0.15);
    border-radius: 10px;
    padding: 14px;
    max-height: 120px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    position: relative;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.auth-terminal::before {
    content: '> TERMINAL';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 8px 16px;
    background: linear-gradient(180deg, rgba(102, 192, 244, 0.1) 0%, transparent 100%);
    font-size: 9px;
    font-weight: 700;
    color: rgba(102, 192, 244, 0.5);
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(102, 192, 244, 0.1);
}

.auth-terminal {
    padding-top: 45px;
}

.auth-log-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    position: relative;
    z-index: 1;
}

/* === ADMIN PANEL - SECURITY THEME === */
.admin-panel .modal-header {
    border-bottom-color: rgba(239, 68, 68, 0.3);
}

.admin-panel::after {
    background: linear-gradient(90deg, transparent, var(--danger), transparent);
}

.admin-auth {
    padding: 24px;
    background: linear-gradient(180deg, var(--bg-color) 0%, rgba(3, 3, 5, 0.8) 100%);
    border: 1px solid var(--border-dim);
    border-radius: 18px;
    position: relative;
    overflow: hidden;
}

.admin-auth::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: radial-gradient(ellipse at center top, rgba(239, 68, 68, 0.05), transparent 60%);
    pointer-events: none;
}

.admin-content {
    animation: adminFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes adminFadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.admin-stat-card {
    background: linear-gradient(180deg, var(--bg-color) 0%, rgba(3, 3, 5, 0.8) 100%);
    border: 1px solid var(--border-dim);
    border-radius: 18px;
    padding: 24px;
    text-align: center;
    transition: all 0.4s var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

.admin-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.admin-stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 100%;
    background: radial-gradient(ellipse at center top, rgba(249, 115, 22, 0.05), transparent 60%);
    pointer-events: none;
}

.admin-stat-card:hover {
    border-color: var(--primary);
}

.admin-stat-card i {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.admin-stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.admin-stat-card .stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    z-index: 1;
}

.admin-section {
    background: linear-gradient(180deg, var(--bg-color) 0%, rgba(3, 3, 5, 0.8) 100%);
    border: 1px solid var(--border-dim);
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 18px;
    transition: all 0.4s var(--ease-smooth);
}

.admin-section:hover {
    border-color: var(--border-light);
}

.admin-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
}

.admin-section-title i {
    color: var(--primary);
    margin-right: 10px;
}

.admin-users-list {
    max-height: 300px;
    overflow-y: auto;
}

.admin-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(180deg, var(--surface) 0%, rgba(12, 12, 20, 0.8) 100%);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.4s var(--ease-smooth);
    gap: 12px;
}

.admin-user-item:hover {
    border-color: var(--border-light);
    background: linear-gradient(180deg, var(--surface-elevated) 0%, rgba(12, 12, 20, 0.9) 100%);
}

.admin-user-item .font-mono {
    word-break: break-all;
    line-height: 1.3;
}

.admin-delete-user-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
}

.admin-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(180deg, var(--surface) 0%, rgba(12, 12, 20, 0.8) 100%);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.4s var(--ease-smooth);
}

.admin-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.admin-action-btn.danger:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: linear-gradient(180deg, var(--danger-dim) 0%, rgba(239, 68, 68, 0.05) 100%);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.2);
}

/* === LEGAL MODALS === */
.legal-content {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
}

.legal-content::-webkit-scrollbar {
    width: 6px;
}

.legal-content::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 3px;
}

.legal-content::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

.legal-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-dim);
}

.legal-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.legal-section h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
}

.legal-section h4 i {
    width: 32px;
    height: 32px;
    background: var(--primary-dim);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-right: 12px;
}

.legal-section p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 12px;
}

.legal-section ul {
    list-style: none;
    padding: 0;
}

.legal-section li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.legal-section li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
}

.legal-section code {
    background: var(--bg-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--secondary);
    border: 1px solid var(--border-dim);
}

.process-flow {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.process-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.process-step .step-num {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.process-step .step-content strong {
    display: block;
    color: var(--text-main);
    font-size: 14px;
    margin-bottom: 6px;
}

.process-step .step-content p {
    font-size: 13px;
    margin: 0;
}

/* === CONFIG SECTIONS === */
.config-section {
    background: var(--bg-color);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    position: relative;
}

.config-legend {
    position: absolute;
    top: -8px;
    left: 16px;
    background: var(--surface);
    padding: 0 8px;
    font-size: 10px;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 1px;
}

/* === RADIO CARDS === */
.radio-card {
    background: var(--bg-color);
    border: 2px solid var(--border-dim);
    border-radius: 12px;
    transition: all 0.5s var(--ease-spring);
    cursor: pointer;
}

.radio-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.radio-card-input:checked + .radio-card,
.radio-card.selected {
    border-color: var(--primary);
    background: var(--primary-dim);
    transform: scale(1.02);
}

.radio-card-input:checked + .radio-card i,
.radio-card.selected i {
    color: var(--primary) !important;
}

/* === TEAM MEMBERS === */
.team-member {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    transition: all 0.5s var(--ease-butter), transform 0.4s var(--ease-spring);
}

.team-member:hover {
    border-color: var(--border-light);
    transform: translateX(4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.team-member.online {
    border-left: 3px solid var(--success);
}

.member-avatar {
    width: 44px;
    height: 44px;
    background: var(--bg-color);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    position: relative;
}

.member-status {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: var(--text-dim);
    border: 2px solid var(--surface);
    border-radius: 50%;
}

.member-status.online {
    background: var(--success);
}

.member-status.afk {
    background: var(--warning);
    animation: afk-pulse 2s ease-in-out infinite;
}

@keyframes afk-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.team-member.afk {
    opacity: 0.8;
}

.team-member.afk .member-name {
    color: var(--warning);
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.member-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.last-death {
    font-size: 11px;
    color: var(--error);
    opacity: 0.8;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.last-death i {
    font-size: 10px;
}

.member-status-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-status-badge.alive {
    background: var(--success-dim);
    color: var(--success);
}

.member-status-badge.dead {
    background: var(--danger-dim);
    color: var(--danger);
}

/* === SQUAD CHAT === */
.squad-chat-container {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-dim);
}

.squad-chat-messages {
    background: var(--bg-color);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    padding: 16px;
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.chat-message {
    margin-bottom: 12px;
    line-height: 1.5;
}

.chat-author {
    font-weight: 600;
    color: var(--primary);
    margin-right: 8px;
}

.chat-text {
    color: var(--text-muted);
}

.chat-time {
    font-size: 10px;
    color: var(--text-dim);
    margin-left: 8px;
}

.squad-chat-input-group {
    display: flex;
    gap: 12px;
}

.squad-chat-input {
    flex: 1;
    padding: 14px 16px;
    background: var(--bg-color);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 14px;
}

.squad-chat-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* === WASD INDICATOR === */
.wasd-indicator {
    position: fixed;
    bottom: 100px;
    right: 24px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(10, 15, 30, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 16px;
    padding: 18px;
    z-index: 100;
    box-shadow: 
        0 0 30px rgba(56, 189, 248, 0.15),
        0 15px 35px rgba(0, 0, 0, 0.4);
}

.ptz-title {
    font-size: 11px;
    font-weight: 700;
    color: #38bdf8;
    text-align: center;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.ptz-close-hint {
    font-size: 9px;
    color: rgba(148, 163, 184, 0.6);
    text-align: center;
    margin-top: 10px;
}

.ptz-close-hint i {
    color: #38bdf8;
}

.wasd-key {
    width: 44px;
    height: 44px;
    background: linear-gradient(180deg, #1a1a24 0%, #0d0d12 100%);
    border: 2px solid #2a2a3a;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.2s var(--ease-butter);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.wasd-key.active {
    background: linear-gradient(180deg, #38bdf8 0%, #0ea5e9 100%);
    border-color: #7dd3fc;
    color: white;
    box-shadow: 
        0 0 25px rgba(56, 189, 248, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.3);
    transform: translateY(3px) scale(0.95);
}

/* === FOOTER - PREMIUM === */
footer {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-color) 100%);
    border-top: 1px solid var(--border-dim);
    padding: 24px 28px;
    margin-top: auto;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.2), transparent);
}

.footer-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
}

.footer-left {
    font-size: 12px;
    color: var(--text-dim);
}

.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-links a {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.5s var(--ease-butter);
    position: relative;
    padding-bottom: 2px;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary);
    transition: width 0.5s var(--ease-spring);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-links a:hover::after {
    width: 100%;
}

/* === TOAST NOTIFICATIONS - ULTRA SMOOTH === */
.toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    padding: 18px 26px;
    background: linear-gradient(180deg, 
        rgba(18, 18, 28, 0.95) 0%, 
        rgba(12, 12, 20, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    color: var(--text-main);
    z-index: 1000;
    transform: translateX(120%) scale(0.9);
    opacity: 0;
    transition: 
        transform 0.5s var(--ease-expo),
        opacity 0.4s var(--ease-silk);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.toast.show {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.toast-success {
    border-color: rgba(34, 197, 94, 0.4);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(34, 197, 94, 0.1);
}

.toast-success i {
    color: var(--success);
    font-size: 18px;
}

.toast-error {
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(239, 68, 68, 0.1);
}

.toast-error i {
    color: var(--danger);
    font-size: 18px;
}

.toast-info {
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(6, 182, 212, 0.1);
}

.toast-info i {
    color: var(--secondary);
    font-size: 18px;
}

.toast-warning {
    border-color: rgba(234, 179, 8, 0.4);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(234, 179, 8, 0.1);
}

.toast-warning i {
    color: var(--warning);
    font-size: 18px;
}

/* Server Paired Toast - Special */
.toast-paired {
    border-color: rgba(34, 197, 94, 0.5);
    background: linear-gradient(180deg, 
        rgba(18, 50, 28, 0.95) 0%, 
        rgba(12, 30, 20, 0.98) 100%);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(34, 197, 94, 0.2);
    animation: pairedToastGlow 2s ease-in-out infinite;
}

.toast-paired i {
    color: var(--success);
    font-size: 20px;
    animation: pairedIconPulse 1s ease-in-out infinite;
}

@keyframes pairedToastGlow {
    0%, 100% {
        box-shadow: 
            0 25px 50px rgba(0, 0, 0, 0.5),
            0 0 40px rgba(34, 197, 94, 0.15);
    }
    50% {
        box-shadow: 
            0 25px 50px rgba(0, 0, 0, 0.5),
            0 0 60px rgba(34, 197, 94, 0.3);
    }
}

@keyframes pairedIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
    transition: background 0.5s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* === UTILITIES === */
.hidden {
    display: none !important;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    header {
        padding: 12px 16px;
    }
    
    main {
        padding: 16px;
    }
    
    .cyber-tab {
        padding: 10px 16px;
        font-size: 12px;
    }
    
    .modal-panel {
        margin: 16px;
        border-radius: 20px;
    }
    
    .footer-links {
        gap: 12px;
    }
    
    .footer-links a {
        font-size: 11px;
    }
    
    /* Reduce particles on mobile for performance */
    .particle:nth-child(n+15) {
        display: none;
    }
}

/* === SMOOTH SCROLL BEHAVIOR === */
html {
    scroll-behavior: smooth;
}

/* Optimize scrolling containers */
.console-body,
.squad-chat-messages,
.legal-content,
.admin-users-list {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* === SKELETON LOADERS === */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--surface) 0%,
        var(--surface-elevated) 50%,
        var(--surface) 100%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    background: var(--surface);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    padding: 16px;
    overflow: hidden;
}

.skeleton-card .skeleton-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.skeleton-card .skeleton-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
}

.skeleton-card .skeleton-text {
    flex: 1;
}

.skeleton-card .skeleton-title {
    height: 16px;
    width: 70%;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-card .skeleton-subtitle {
    height: 12px;
    width: 50%;
    border-radius: 4px;
}

.skeleton-card .skeleton-button {
    height: 48px;
    width: 100%;
    border-radius: 12px;
    margin-top: 8px;
}

/* Camera skeleton */
.skeleton-camera {
    background: var(--surface);
    border: 1px solid var(--border-dim);
    border-radius: 16px;
    overflow: hidden;
}

.skeleton-camera .skeleton-feed {
    aspect-ratio: 16/9;
    background: var(--bg-color);
}

.skeleton-camera .skeleton-info {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skeleton-camera .skeleton-name {
    height: 14px;
    width: 120px;
    border-radius: 4px;
}

.skeleton-camera .skeleton-actions {
    display: flex;
    gap: 8px;
}

.skeleton-camera .skeleton-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

/* === SHARED PANELS === */
#shared-panels-container {
    animation: slideUp 0.4s var(--ease-smooth);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shared-panel-card {
    transition: all 0.3s var(--ease-smooth);
}

.shared-panel-card:hover {
    border-color: var(--secondary);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.1);
}

.device-card-mini,
.camera-card-mini {
    transition: all 0.25s var(--ease-smooth);
}

.device-card-mini:hover,
.camera-card-mini:hover {
    transform: translateY(-2px);
}

.shared-device-toggle,
.shared-camera-view {
    transition: all 0.2s var(--ease-smooth);
}

.shared-device-toggle:hover,
.shared-camera-view:hover {
    filter: brightness(1.2);
}

/* === MICRO-INTERACTIONS & ENHANCEMENTS === */

/* Smooth icon hover animations */
.device-icon,
.monitor-icon,
.member-avatar {
    transition: all 0.5s var(--ease-spring);
}

.device-icon:hover,
.monitor-icon:hover,
.member-avatar:hover {
    transform: scale(1.12) rotate(3deg);
}

/* Button press feedback */
button:active:not(:disabled) {
    transform: scale(0.96);
    transition: transform 0.15s var(--ease-butter);
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Link hover glow */
a:hover {
    text-shadow: 0 0 12px currentColor;
}

/* Card entrance animation */
@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.92);
        filter: blur(3px);
    }
    70% {
        opacity: 1;
        filter: blur(0);
    }
    85% {
        transform: translateY(-4px) scale(1.01);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.device-card,
.camera-card,
.team-member {
    animation: cardEntrance 0.7s var(--ease-butter) backwards;
}

.device-card:nth-child(1) { animation-delay: 0.05s; }
.device-card:nth-child(2) { animation-delay: 0.1s; }
.device-card:nth-child(3) { animation-delay: 0.15s; }
.device-card:nth-child(4) { animation-delay: 0.2s; }
.device-card:nth-child(5) { animation-delay: 0.25s; }
.device-card:nth-child(6) { animation-delay: 0.3s; }

.camera-card:nth-child(1) { animation-delay: 0.05s; }
.camera-card:nth-child(2) { animation-delay: 0.1s; }
.camera-card:nth-child(3) { animation-delay: 0.15s; }
.camera-card:nth-child(4) { animation-delay: 0.2s; }

/* Status light breathing for online state */
.industrial-light.online {
    animation: greenBlink 1.2s ease-in-out infinite, breatheGlow 3s ease-in-out infinite;
}

@keyframes breatheGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.15); }
}

/* Tooltip style */
[title] {
    position: relative;
}

/* Gradient text utility */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass morphism utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

/* Neon glow utilities */
.glow-primary {
    box-shadow: 0 0 20px var(--primary-dim), 0 0 40px rgba(249, 115, 22, 0.1);
}

.glow-secondary {
    box-shadow: 0 0 20px var(--secondary-dim), 0 0 40px rgba(6, 182, 212, 0.1);
}

.glow-success {
    box-shadow: 0 0 20px var(--success-dim), 0 0 40px rgba(34, 197, 94, 0.1);
}

.glow-danger {
    box-shadow: 0 0 20px var(--danger-dim), 0 0 40px rgba(239, 68, 68, 0.1);
}

/* Subtle hover lift for interactive elements */
.hover-lift {
    transition: transform 0.5s var(--ease-spring), box-shadow 0.5s var(--ease-butter);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
    will-change: transform;
}

/* Loading shimmer effect */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    animation: shimmerMove 2s infinite;
}

@keyframes shimmerMove {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Stagger animation utility */
.stagger-enter > * {
    opacity: 0;
    transform: translateY(25px);
    animation: staggerEnter 0.6s var(--ease-spring) forwards;
}

.stagger-enter > *:nth-child(1) { animation-delay: 0s; }
.stagger-enter > *:nth-child(2) { animation-delay: 0.08s; }
.stagger-enter > *:nth-child(3) { animation-delay: 0.16s; }
.stagger-enter > *:nth-child(4) { animation-delay: 0.24s; }
.stagger-enter > *:nth-child(5) { animation-delay: 0.32s; }

@keyframes staggerEnter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Premium border glow on focus within containers */
.tech-panel:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary-dim), 0 24px 48px rgba(0, 0, 0, 0.35);
}

/* Status indicator pulse ring */
.pulse-ring {
    position: relative;
}

.pulse-ring::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0;
    animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(0.85);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════
   SHARED PANELS - ULTRA PREMIUM STYLING
   ═══════════════════════════════════════════════════════════════ */

.shared-panels-section {
    margin-top: 2rem;
    position: relative;
}

.shared-panels-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-dim);
}

.shared-panels-header i {
    font-size: 1.25rem;
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px var(--secondary));
}

.shared-panels-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: 0.02em;
}

.shared-panels-header .badge {
    background: var(--secondary-dim);
    color: var(--secondary);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 700;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

/* Shared Panel Card */
.shared-panel-card {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.03) 0%, rgba(12, 12, 20, 0.95) 100%);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--ease-smooth);
}

.shared-panel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-secondary);
    opacity: 0.6;
}

.shared-panel-card:hover {
    border-color: rgba(6, 182, 212, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(6, 182, 212, 0.15);
}

.shared-panel-host {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-dim);
}

.shared-panel-host-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.shared-panel-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, var(--secondary-dim), rgba(6, 182, 212, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--secondary);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}

.shared-panel-avatar i {
    color: var(--secondary);
    font-size: 1rem;
}

.shared-panel-nickname {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.2;
}

.shared-panel-id {
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-dim);
    margin-top: 0.125rem;
}

.shared-panel-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.65rem;
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.shared-panel-status .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: statusPulse 1.5s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.shared-panel-refresh {
    background: transparent;
    border: 1px solid var(--border-dim);
    color: var(--text-dim);
    padding: 0.375rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
}

.shared-panel-refresh:hover {
    background: var(--secondary-dim);
    color: var(--secondary);
    border-color: var(--secondary);
}

.shared-panel-refresh:hover i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.shared-panel-leave {
    background: transparent;
    border: 1px solid var(--danger-dim);
    color: var(--text-dim);
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
}

.shared-panel-leave:hover {
    background: var(--danger-dim);
    color: var(--danger);
    border-color: var(--danger);
}

/* Shared Devices Grid */
.shared-devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

/* Shared Device Card */
.shared-device-card {
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.4) 0%, rgba(12, 12, 20, 0.6) 100%);
    border: 1px solid var(--border-dim);
    border-radius: 1rem;
    padding: 1.25rem;
    transition: all 0.35s var(--ease-smooth);
    position: relative;
    overflow: hidden;
    min-height: 120px;
}

.shared-device-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transition: left 0.5s ease;
}

.shared-device-card:hover::after {
    left: 100%;
}

.shared-device-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.shared-device-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.shared-device-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.shared-device-icon.on {
    background: var(--success-dim);
    color: var(--success);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

.shared-device-icon.off {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-dim);
}

.shared-device-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* Premium Toggle Switch */
.shared-toggle-btn {
    width: 100%;
    height: 3rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.35s var(--ease-spring);
    position: relative;
    overflow: hidden;
}

.shared-toggle-btn.on {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.4);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.2), inset 0 0 20px rgba(34, 197, 94, 0.05);
}

.shared-toggle-btn.off {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.shared-toggle-btn:hover.on {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.15));
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.3), inset 0 0 30px rgba(34, 197, 94, 0.1);
    transform: scale(1.02);
}

.shared-toggle-btn:hover.off {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(239, 68, 68, 0.1));
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
    transform: scale(1.02);
}

.shared-toggle-btn:active {
    transform: scale(0.97);
}

.shared-toggle-btn .icon-pulse {
    animation: iconPulse 1.5s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Shared Camera Card */
.shared-camera-card {
    background: linear-gradient(145deg, rgba(6, 182, 212, 0.05) 0%, rgba(12, 12, 20, 0.6) 100%);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 1rem;
    padding: 1.25rem;
    transition: all 0.35s var(--ease-smooth);
    min-height: 120px;
}

.shared-camera-card:hover {
    border-color: var(--secondary);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.15);
}

.shared-camera-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.shared-camera-badge.turret {
    background: var(--danger-dim);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.shared-camera-badge.ptz {
    background: var(--secondary-dim);
    color: var(--secondary);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.shared-camera-view-btn {
    width: 100%;
    height: 2.75rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, var(--secondary-dim), rgba(6, 182, 212, 0.1));
    color: var(--secondary);
    border: 1px solid rgba(6, 182, 212, 0.3);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s var(--ease-smooth);
}

.shared-camera-view-btn:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(6, 182, 212, 0.15));
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.25);
    transform: scale(1.02);
}

/* Empty State */
.shared-empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-dim);
}

.shared-empty-state i {
    font-size: 2.5rem;
    opacity: 0.3;
    margin-bottom: 0.75rem;
    display: block;
}

.shared-empty-state p {
    font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════════════════════
   GUEST MANAGEMENT MODAL - HOST CONTROLS
   ═══════════════════════════════════════════════════════════════ */

.guest-management-modal {
    background: var(--surface);
    border: 1px solid var(--border-dim);
    border-radius: 1.25rem;
    overflow: hidden;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.guest-modal-header {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, rgba(12, 12, 20, 0.95) 100%);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-dim);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.guest-modal-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.guest-modal-title i {
    font-size: 1.25rem;
    color: var(--primary);
}

.guest-modal-title h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.guest-modal-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Guest Card in Management */
.guest-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-dim);
    border-radius: 0.875rem;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.guest-card:hover {
    border-color: var(--primary);
    background: rgba(249, 115, 22, 0.03);
}

.guest-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-dim);
}

.guest-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.guest-avatar {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.guest-details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.guest-nickname-input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.25rem 0;
    border-bottom: 1px dashed var(--border-light);
    transition: all 0.2s ease;
    width: 150px;
}

.guest-nickname-input:focus {
    outline: none;
    border-bottom-color: var(--primary);
    background: rgba(249, 115, 22, 0.05);
}

.guest-nickname-input::placeholder {
    color: var(--text-dim);
    font-style: italic;
}

.guest-id-label {
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-dim);
}

.guest-actions {
    display: flex;
    gap: 0.5rem;
}

.guest-action-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-dim);
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guest-action-btn:hover {
    background: var(--danger-dim);
    color: var(--danger);
    border-color: var(--danger);
}

/* Permissions Section */
.guest-permissions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.permission-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.75rem;
    padding: 0.875rem;
}

.permission-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-dim);
}

.permission-section-header i {
    font-size: 0.875rem;
}

.permission-section-header.devices i {
    color: var(--primary);
}

.permission-section-header.cameras i {
    color: var(--secondary);
}

.permission-section-header span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.permission-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 150px;
    overflow-y: auto;
}

.permission-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.625rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.permission-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.permission-item-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.permission-item-info i {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.permission-item-info span {
    font-size: 0.75rem;
    color: var(--text-main);
}

/* Premium Toggle Checkbox */
.permission-toggle {
    position: relative;
    width: 2.5rem;
    height: 1.25rem;
}

.permission-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.permission-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(100, 116, 139, 0.3);
    border-radius: 9999px;
    transition: all 0.3s var(--ease-smooth);
}

.permission-toggle-slider::before {
    position: absolute;
    content: '';
    height: 1rem;
    width: 1rem;
    left: 0.125rem;
    bottom: 0.125rem;
    background: var(--text-dim);
    border-radius: 50%;
    transition: all 0.3s var(--ease-spring);
}

.permission-toggle input:checked + .permission-toggle-slider {
    background: var(--success);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

.permission-toggle input:checked + .permission-toggle-slider::before {
    transform: translateX(1.25rem);
    background: white;
}

/* Select All Toggle */
.select-all-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.375rem;
}

.select-all-row span {
    font-size: 0.7rem;
    color: var(--text-dim);
    font-weight: 500;
}

/* Guest No Permission Badge */
.no-permission-badge {
    font-size: 0.6rem;
    color: var(--danger);
    background: var(--danger-dim);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    margin-left: 0.5rem;
}

@media (max-width: 640px) {
    .guest-permissions {
        grid-template-columns: 1fr;
    }
    
    .shared-devices-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* ═══════════════════════════════════════════════════════════════════════════════
   🔊 SOUND & SETTINGS STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    appearance: none;
    background: var(--surface);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
}

.toggle-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--text-dim);
    border-radius: 50%;
    transition: all 0.3s var(--ease-spring);
}

.toggle-switch:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.toggle-switch:checked::before {
    transform: translateX(20px);
    background: white;
}

.color-preset {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-preset:hover {
    transform: scale(1.1);
    border-color: white;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   🎯 PRESETS STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

.quick-preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: 12px;
    transition: all 0.3s var(--ease-smooth);
    cursor: pointer;
}

.quick-preset-btn:hover {
    transform: translateY(-2px);
}

.quick-preset-btn:active {
    transform: scale(0.98);
}

.preset-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(12, 12, 20, 0.9), rgba(8, 8, 16, 0.95));
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    transition: all 0.3s var(--ease-smooth);
}

.preset-card:hover {
    border-color: var(--preset-color, var(--primary));
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.1);
}

.preset-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.preset-info {
    flex: 1;
    min-width: 0;
}

.preset-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

.preset-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 2px;
}

.preset-actions {
    display: flex;
    gap: 6px;
}

.preset-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border-dim);
    background: var(--surface);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-btn.apply:hover {
    background: var(--success-dim);
    border-color: var(--success);
    color: var(--success);
}

.preset-btn.update:hover {
    background: var(--secondary-dim);
    border-color: var(--secondary);
    color: var(--secondary);
}

.preset-btn.delete:hover {
    background: var(--danger-dim);
    border-color: var(--danger);
    color: var(--danger);
}

.empty-state-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: var(--text-dim);
    border: 1px dashed var(--border-dim);
    border-radius: 12px;
    grid-column: 1 / -1;
}

.empty-state-mini i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.3;
}

.btn-cyber-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    background: linear-gradient(145deg, var(--surface), rgba(26, 26, 46, 0.9));
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s var(--ease-butter);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.btn-cyber-sm i {
    font-size: 0.85em;
    line-height: 1;
}

.btn-cyber-sm::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-bright));
    opacity: 0;
    transition: opacity 0.3s var(--ease-butter);
}

.btn-cyber-sm:hover {
    border-color: var(--primary);
    color: white;
    box-shadow: 
        0 8px 25px rgba(249, 115, 22, 0.25),
        0 0 0 1px rgba(249, 115, 22, 0.2);
    transform: translateY(-2px);
}

.btn-cyber-sm:hover::before {
    opacity: 1;
}

.btn-cyber-sm:hover i,
.btn-cyber-sm:hover span {
    position: relative;
    z-index: 1;
}

.btn-cyber-sm:active {
    transform: translateY(0) scale(0.98);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   🏷️ DEVICE GROUPS STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

.device-group {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(12, 12, 20, 0.5);
}

.device-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.1), transparent);
    border-bottom: 1px solid var(--border-dim);
    cursor: pointer;
    transition: all 0.2s ease;
}

.device-group-header:hover {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.15), transparent);
}

.device-group-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.device-group-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.9rem;
}

.device-group-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

.device-group-count {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.device-group-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.device-group-toggle {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.device-group-toggle.on {
    background: var(--success-dim);
    color: var(--success);
    border: 1px solid var(--success);
}

.device-group-toggle.off {
    background: var(--danger-dim);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.device-group-collapse {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--border-dim);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s ease;
}

.device-group-collapse:hover {
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.device-group-content {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.device-group.collapsed .device-group-content {
    display: none;
}

.device-group.collapsed .device-group-collapse i {
    transform: rotate(-90deg);
}

/* Device Tags */
.device-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.device-tag {
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--secondary-dim);
    color: var(--secondary);
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   📈 ACTIVITY FEED STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

.activity-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    text-align: center;
}

.activity-stat-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    margin-bottom: 8px;
}

.activity-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

.activity-stat-label {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.activity-feed-container {
    max-height: 500px;
    overflow-y: auto;
}

.activity-date-group {
    margin-bottom: 1.5rem;
}

.activity-date-header {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-dim);
    margin-bottom: 8px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    background: var(--surface);
    border-left: 3px solid var(--border-dim);
    transition: all 0.2s ease;
}

.activity-item:hover {
    background: var(--surface-elevated);
}

.activity-item.activity-success { border-left-color: var(--success); }
.activity-item.activity-error { border-left-color: var(--danger); }
.activity-item.activity-warning { border-left-color: var(--warning); }
.activity-item.activity-info { border-left-color: var(--secondary); }
.activity-item.activity-device { border-left-color: var(--primary); }

.activity-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--primary-dim);
    color: var(--primary);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.activity-success .activity-icon { background: var(--success-dim); color: var(--success); }
.activity-error .activity-icon { background: var(--danger-dim); color: var(--danger); }
.activity-warning .activity-icon { background: var(--warning-dim); color: var(--warning); }
.activity-info .activity-icon { background: var(--secondary-dim); color: var(--secondary); }

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.activity-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 2px;
    word-break: break-word;
}

.activity-time {
    font-size: 0.65rem;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}

.activity-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    color: var(--text-dim);
}

.activity-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.2;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   🎨 THEME VARIATIONS
   ═══════════════════════════════════════════════════════════════════════════════ */

[data-theme="midnight"] {
    --bg-color: #0a0a1a;
    --surface: #14142a;
    --surface-elevated: #1e1e3a;
}

[data-theme="amoled"] {
    --bg-color: #000000;
    --surface: #0a0a0a;
    --surface-elevated: #111111;
}

[data-theme="cyberpunk"] {
    --bg-color: #0d0221;
    --surface: #1a0533;
    --surface-elevated: #2a0a4a;
    --primary: #ff00ff;
    --primary-dim: rgba(255, 0, 255, 0.15);
    --secondary: #00ffff;
}

/* Compact Mode */
.compact-mode .tech-panel {
    padding: 12px;
}

.compact-mode .device-card {
    padding: 12px;
}

.compact-mode .preset-card {
    padding: 10px;
}

/* Device View Modes */
.device-view-list #devices-grid {
    grid-template-columns: 1fr;
}

.device-view-compact #devices-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.device-view-compact .device-card {
    padding: 10px;
}

.device-view-compact .device-name {
    font-size: 0.8rem;
}

.device-view-compact .device-stats {
    display: none;
}

/* Device Stats Overlay */
.device-stats {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-dim);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.device-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
    color: var(--text-dim);
}

.device-stat i {
    width: 14px;
    text-align: center;
}

.device-stat-value {
    color: var(--text-muted);
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   📌 TAG SELECT MODAL (EXPANDED)
   ═══════════════════════════════════════════════════════════════════════════════ */

.category-select-btn,
.tag-select-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--surface);
    border: 2px solid var(--border-dim);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
    color: var(--text-muted);
}

.category-select-btn:hover,
.tag-select-btn:hover {
    border-color: var(--tag-color, var(--cat-color));
    background: color-mix(in srgb, var(--tag-color, var(--cat-color)) 15%, transparent);
    color: var(--tag-color, var(--cat-color));
    transform: translateY(-2px);
}

.category-select-btn.active,
.tag-select-btn.active {
    border-color: var(--tag-color, var(--cat-color));
    background: color-mix(in srgb, var(--tag-color, var(--cat-color)) 20%, transparent);
    color: var(--tag-color, var(--cat-color));
    box-shadow: 0 0 20px color-mix(in srgb, var(--tag-color, var(--cat-color)) 30%, transparent);
}

.category-select-btn i,
.tag-select-btn i {
    font-size: 1.5rem;
}

.category-select-btn span,
.tag-select-btn span {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Small tag buttons (icon only) */
.tag-select-btn-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--surface);
    border: 2px solid var(--border-dim);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s var(--ease-smooth);
    color: var(--text-muted);
    font-size: 1rem;
}

.tag-select-btn-sm:hover {
    border-color: var(--tag-color);
    background: color-mix(in srgb, var(--tag-color) 15%, transparent);
    color: var(--tag-color);
    transform: scale(1.1);
}

.tag-select-btn-sm.active {
    border-color: var(--tag-color);
    background: color-mix(in srgb, var(--tag-color) 25%, transparent);
    color: var(--tag-color);
    box-shadow: 0 0 12px color-mix(in srgb, var(--tag-color) 40%, transparent);
}

/* Current tags display */
.current-tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
}

.current-tag-badge i {
    font-size: 10px;
}

.tag-remove-btn {
    background: none;
    border: none;
    padding: 2px 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.tag-remove-btn:hover {
    opacity: 1;
}

/* Resize Handles for Panels */
.resize-handle {
    position: absolute;
    background: transparent;
    z-index: 10;
}

.resize-handle-right {
    top: 0;
    right: -4px;
    width: 8px;
    height: 100%;
    cursor: ew-resize;
}

.resize-handle-bottom {
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 8px;
    cursor: ns-resize;
}

.resize-handle-corner {
    bottom: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
}

.resize-handle::after {
    content: '';
    position: absolute;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 2px;
}

.resize-handle-right::after {
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 40px;
}

.resize-handle-bottom::after {
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
}

.resize-handle-corner::after {
    bottom: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.resize-handle:hover::after,
.tech-panel:hover .resize-handle::after {
    opacity: 0.5;
}

.resize-handle:active::after {
    opacity: 1;
}

/* Resizable Panel */
.tech-panel.resizable {
    position: relative;
    overflow: visible;
}

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* 🤖 AUTOMATION SYSTEM STYLES - PREMIUM EDITION */
/* ═══════════════════════════════════════════════════════════════════════════════ */

/* === Automation Tab Header Enhancement === */
.automation-info-banner {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.08) 0%, rgba(139, 92, 246, 0.05) 50%, rgba(168, 85, 247, 0.03) 100%);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 16px;
    padding: 20px;
}

.automation-info-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.5), transparent);
}

.automation-info-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(168, 85, 247, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.automation-banner-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3) 0%, rgba(139, 92, 246, 0.2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.3);
}

.automation-banner-icon::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 14px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.6), rgba(139, 92, 246, 0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.automation-banner-icon i {
    font-size: 22px;
    color: #a855f7;
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.5));
}

/* === Automation Cards - Premium Design === */
.automation-card {
    position: relative;
    background: linear-gradient(145deg, var(--surface) 0%, rgba(26, 26, 46, 0.95) 100%);
    border: 1px solid var(--border-dim);
    border-radius: 16px;
    padding: 0;
    margin-bottom: 12px;
    transition: all 0.4s var(--ease-butter);
    overflow: hidden;
}

.automation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #a855f7, #8b5cf6, #06b6d4);
    opacity: 0;
    transition: opacity 0.4s var(--ease-butter);
}

.automation-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top right, rgba(168, 85, 247, 0.1), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s var(--ease-butter);
    pointer-events: none;
}

.automation-card:hover {
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 
        0 4px 20px rgba(168, 85, 247, 0.15),
        0 0 40px rgba(168, 85, 247, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transform: translateY(-2px);
}

.automation-card:hover::before {
    opacity: 1;
}

.automation-card:hover::after {
    opacity: 1;
}

.automation-card.disabled {
    opacity: 0.5;
    filter: grayscale(0.3);
}

.automation-card.disabled::before,
.automation-card.disabled::after {
    display: none;
}

.automation-card.disabled:hover {
    border-color: var(--border-light);
    box-shadow: none;
    transform: none;
}

/* === Automation Header === */
.automation-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 16px 12px;
    position: relative;
    z-index: 1;
}

.automation-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(168, 85, 247, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #a855f7;
    flex-shrink: 0;
    transition: all 0.4s var(--ease-butter);
}

.automation-icon.active {
    background: linear-gradient(135deg, #a855f7 0%, #8b5cf6 50%, #7c3aed 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 
        0 0 20px rgba(168, 85, 247, 0.5),
        0 0 40px rgba(168, 85, 247, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.automation-icon.active i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.automation-info {
    flex: 1;
    min-width: 0;
}

.automation-name {
    font-weight: 700;
    color: var(--text-main);
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.automation-trigger {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.automation-trigger i {
    color: #a855f7;
    font-size: 10px;
}

.automation-toggle {
    flex-shrink: 0;
}

/* === Premium Mini Switch === */
.switch-mini {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch-mini input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-mini {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg, var(--surface-elevated), rgba(30, 30, 50, 0.9));
    border: 1px solid var(--border-dim);
    border-radius: 24px;
    transition: all 0.4s var(--ease-butter);
}

.slider-mini:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: linear-gradient(145deg, #6b7280, #4b5563);
    border-radius: 50%;
    transition: all 0.4s var(--ease-butter);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.switch-mini input:checked + .slider-mini {
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

.switch-mini input:checked + .slider-mini:before {
    transform: translateX(20px);
    background: linear-gradient(145deg, #ffffff, #f3f4f6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* === Actions List === */
.automation-actions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.2) 100%);
    border-top: 1px solid rgba(168, 85, 247, 0.1);
    position: relative;
    z-index: 1;
}

.automation-action-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(6, 182, 212, 0.08) 100%);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    color: #22d3ee;
    transition: all 0.3s var(--ease-butter);
}

.automation-action-tag i {
    font-size: 10px;
    opacity: 0.8;
}

.automation-action-tag:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25) 0%, rgba(6, 182, 212, 0.15) 100%);
    border-color: rgba(6, 182, 212, 0.4);
    transform: translateY(-1px);
}

/* === Automation Footer === */
.automation-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px 12px;
    background: rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1;
}

.automation-stats {
    font-size: 11px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 4px;
}

.automation-stats i {
    color: rgba(168, 85, 247, 0.6);
}

.automation-stats .stats-divider {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-dim);
    margin: 0 8px;
}

.automation-delete {
    background: transparent;
    border: 1px solid transparent;
    color: var(--danger);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    opacity: 0.5;
    transition: all 0.3s var(--ease-butter);
    font-size: 12px;
}

.automation-delete:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    transform: scale(1.05);
}

/* === Automation Modal - Premium Form === */
.modal-automation-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-section {
    position: relative;
    background: linear-gradient(145deg, var(--surface) 0%, rgba(26, 26, 46, 0.9) 100%);
    border: 1px solid var(--border-dim);
    border-radius: 14px;
    padding: 18px;
    overflow: hidden;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.3), transparent);
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #a855f7;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-section-title i {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(139, 92, 246, 0.1));
    border-radius: 8px;
    font-size: 12px;
}

.form-row {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px 14px;
    background: linear-gradient(145deg, var(--bg-secondary), rgba(15, 15, 30, 0.9));
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 13px;
    transition: all 0.3s var(--ease-butter);
}

.form-input::placeholder {
    color: var(--text-dim);
}

.form-input:hover,
.form-select:hover {
    border-color: rgba(168, 85, 247, 0.3);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #a855f7;
    box-shadow: 
        0 0 0 3px rgba(168, 85, 247, 0.15),
        0 0 20px rgba(168, 85, 247, 0.1);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 40px;
}

/* === Days Selector - Premium === */
.days-selector {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.day-checkbox {
    display: none;
}

.day-label {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--surface), rgba(26, 26, 46, 0.9));
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s var(--ease-butter);
}

.day-label:hover {
    border-color: rgba(168, 85, 247, 0.4);
    color: var(--text-main);
    transform: translateY(-2px);
}

.day-checkbox:checked + .day-label {
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}

/* === Trigger/Action Config === */
.trigger-config,
.action-config {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed rgba(168, 85, 247, 0.2);
    position: relative;
}

.trigger-config::before,
.action-config::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.5), transparent);
}

.trigger-config.hidden,
.action-config.hidden {
    display: none;
}

/* === Empty State - Automation === */
#automations-container .empty-state-mini {
    padding: 50px 30px;
    background: linear-gradient(145deg, rgba(168, 85, 247, 0.05) 0%, transparent 100%);
    border: 2px dashed rgba(168, 85, 247, 0.2);
    border-radius: 20px;
    text-align: center;
}

#automations-container .empty-state-mini i {
    font-size: 48px;
    color: rgba(168, 85, 247, 0.4);
    margin-bottom: 16px;
    filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.3));
}

#automations-container .empty-state-mini p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 8px;
}

#automations-container .empty-state-mini .btn-cyber-sm {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #c084fc;
    padding: 12px 20px;
    font-size: 12px;
}

#automations-container .empty-state-mini .btn-cyber-sm::before {
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
}

#automations-container .empty-state-mini .btn-cyber-sm:hover {
    border-color: rgba(168, 85, 247, 0.6);
    color: white;
    box-shadow: 
        0 8px 30px rgba(168, 85, 247, 0.4),
        0 0 0 1px rgba(168, 85, 247, 0.3);
}

#automations-container .empty-state-mini .btn-cyber-sm:hover::before {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* 📸 CAMERA SNAPSHOTS STYLES */
/* ═══════════════════════════════════════════════════════════════════════════════ */

.snapshots-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.snapshots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

@media (max-width: 480px) {
    .snapshots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.snapshot-card {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-secondary);
    border: 1px solid var(--border-dim);
    transition: all 0.3s ease;
}

.snapshot-card:hover {
    transform: scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-dim);
}

.snapshot-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.snapshot-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.snapshot-camera {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.snapshot-time {
    font-size: 9px;
    color: var(--text-dim);
}

.snapshot-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.snapshot-card:hover .snapshot-actions {
    opacity: 1;
}

.snapshot-actions button {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: rgba(0,0,0,0.7);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.2s;
}

.snapshot-actions button:hover {
    background: var(--primary);
    color: white;
}

.snapshot-actions button:last-child:hover {
    background: var(--danger);
}

/* Fullscreen Snapshot Modal */
.snapshot-fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.snapshot-fullscreen-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
}

.snapshot-fullscreen-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.snapshot-fullscreen-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.snapshot-fullscreen-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.snapshot-fullscreen-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.snapshot-fullscreen-close:hover {
    opacity: 1;
}

.snapshot-fullscreen-actions {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
}

/* Camera Snapshot Button */
.camera-snapshot-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-bright));
    border: 2px solid rgba(255,255,255,0.2);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--primary-glow);
    transition: all 0.3s ease;
    z-index: 10;
}

.camera-snapshot-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px var(--primary);
}

.camera-snapshot-btn:active {
    transform: scale(0.95);
}

.camera-snapshot-btn.capturing {
    animation: snapshotFlash 0.3s ease;
}

@keyframes snapshotFlash {
    0%, 100% { background: linear-gradient(135deg, var(--primary), var(--primary-bright)); }
    50% { background: white; }
}

/* Snapshot Button on Camera Card */
.camera-btn.snapshot-btn {
    background: linear-gradient(135deg, var(--success), var(--success));
    color: white;
}

.camera-btn.snapshot-btn:hover:not(.disabled) {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

.camera-btn.snapshot-btn.capturing {
    animation: snapshotFlash 0.3s ease;
}

/* Empty State Mini */
.empty-state-mini {
    text-align: center;
    padding: 20px;
    color: var(--text-dim);
}

.empty-state-mini i {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.empty-state-mini p {
    font-size: 13px;
}

/* Button Cyber XS */
.btn-cyber-xs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 10px;
    font-size: 10px;
    font-weight: 600;
    background: linear-gradient(145deg, var(--surface), rgba(20, 20, 35, 0.9));
    border: 1px solid var(--border-dim);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s var(--ease-butter);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.btn-cyber-xs i {
    font-size: 0.9em;
    line-height: 1;
}

.btn-cyber-xs:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-dim);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.2);
    transform: translateY(-1px);
}

.btn-cyber-xs:active {
    transform: translateY(0) scale(0.98);
}

/* Modal Max Height */
#modal-automation {
    max-height: 90vh;
    overflow-y: auto;
}

#modal-automation::-webkit-scrollbar {
    width: 6px;
}

#modal-automation::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

#modal-automation::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

#modal-automation::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ===== SNAPSHOTS GALLERY PREMIUM STYLES ===== */

.snapshot-category-tab {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
}

.snapshot-category-tab:hover {
    background: var(--surface-elevated);
    border-color: var(--border-light);
    color: var(--text-main);
}

.snapshot-category-tab.active {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(236, 72, 153, 0.2));
    border-color: var(--primary);
    color: var(--text-main);
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.2);
}

.snapshot-category-tab.active i {
    color: var(--primary);
}

/* Premium Snapshot Card */
.snapshot-card-premium {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--surface) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-dim);
    transition: all 0.4s var(--ease-smooth);
    transform: translateZ(0);
}

.snapshot-card-premium:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(249, 115, 22, 0.15);
}

.snapshot-card-premium .snapshot-image-wrapper {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
}

.snapshot-card-premium .snapshot-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s var(--ease-smooth);
}

.snapshot-card-premium:hover .snapshot-image-wrapper img {
    transform: scale(1.05);
}

.snapshot-card-premium .snapshot-type-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.snapshot-card-premium .snapshot-type-badge.type-snapshot {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.9), rgba(168, 85, 247, 0.9));
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.snapshot-card-premium .snapshot-type-badge.type-360 {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.9), rgba(249, 115, 22, 0.9));
    color: white;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
}

.snapshot-card-premium .snapshot-frame-count {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    border-radius: 8px;
}

.snapshot-card-premium .snapshot-timer {
    position: absolute;
    bottom: 12px;
    left: 12px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.snapshot-card-premium .snapshot-timer i {
    animation: pulse 1s ease-in-out infinite;
}

.snapshot-card-premium .snapshot-info {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.snapshot-card-premium .snapshot-meta {
    flex: 1;
    min-width: 0;
}

.snapshot-card-premium .snapshot-camera-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.snapshot-card-premium .snapshot-timestamp {
    font-size: 12px;
    color: var(--text-dim);
}

.snapshot-card-premium .snapshot-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s var(--ease-smooth);
}

.snapshot-card-premium:hover .snapshot-actions {
    opacity: 1;
    transform: translateX(0);
}

.snapshot-card-premium .snapshot-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-dim);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s var(--ease-smooth);
}

.snapshot-card-premium .snapshot-action-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: scale(1.1);
}

.snapshot-card-premium .snapshot-action-btn.btn-delete:hover {
    background: var(--danger);
    border-color: var(--danger);
}

.snapshot-card-premium .snapshot-action-btn.btn-view:hover {
    background: var(--secondary);
    border-color: var(--secondary);
}

/* Empty State Premium */
.snapshots-empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.snapshots-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(168, 85, 247, 0.15));
    border: 1px solid rgba(236, 72, 153, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.snapshots-empty-icon i {
    font-size: 32px;
    background: linear-gradient(135deg, #ec4899, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.snapshots-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.snapshots-empty-desc {
    font-size: 14px;
    color: var(--text-dim);
    max-width: 320px;
}