/* === THE WORLD DESKTOP HUD === */
/* .hack meets Cyberpunk 2077 Interface */

:root {
    /* Dark base canvas */
    --bg-primary: #120025;
    --bg-secondary: #1e003f;
    --bg-dark: #0d001a;
    
    /* Neon accents */
    --neon-green: #00ff88;
    --neon-cyan: #00ddff;
    --neon-magenta: #ff00cc;
    --neon-amber: #ffcc00;
    
    /* UI colors */
    --text-primary: #f2f2f2;
    --text-secondary: #a0a0a0;
    --panel-bg: rgba(30, 0, 63, 0.6);
    --panel-border: rgba(0, 255, 221, 0.3);
    
    /* Window shadows */
    --window-glow: 0 0 30px rgba(0, 221, 255, 0.3);
    --active-glow: 0 0 40px rgba(0, 255, 136, 0.4);
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><polygon points="12,2 2,12 12,22" fill="%2300ff88" stroke="%2300ddff" stroke-width="1"/></svg>'), auto;
}

body {
    font-family: 'Source Code Pro', monospace;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-dark) 100%);
    color: var(--text-primary);
    overflow: hidden;
    min-height: 100vh;
    position: relative;
}

/* === CRT EFFECT === */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
    opacity: 0.5;
}

.crt-overlay::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 4px;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(100vh); }
}

/* === SCANLINES === */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 136, 0.02) 2px,
        rgba(0, 255, 136, 0.02) 4px
    );
    opacity: 0.1;
}

/* === PARTICLE FIELD === */
.particle-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--neon-cyan);
    border-radius: 50%;
    opacity: 0;
    animation: drift 20s linear infinite;
}

@keyframes drift {
    0% {
        opacity: 0;
        transform: translateY(100vh) translateX(0);
    }
    10% {
        opacity: 0.4;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) translateX(100px);
    }
}

/* === VIRTUAL DESKTOP === */
.virtual-desktop {
    position: relative;
    width: 100%;
    height: 100vh;
    perspective: 1000px;
    z-index: 10;
}

/* === MENU BAR === */
.menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(90deg, rgba(18, 0, 37, 0.9) 0%, rgba(30, 0, 63, 0.8) 50%, rgba(18, 0, 37, 0.9) 100%);
    border-bottom: 1px solid var(--neon-cyan);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.menu-logo {
    font-family: 'Silkscreen', monospace;
    font-size: 14px;
    color: var(--neon-green);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--neon-green);
}

.server-status {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: var(--neon-amber);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--neon-green);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    margin: 0 5px;
}

.server-status[data-status="offline"] .pulse-dot {
    background: var(--neon-magenta);
    animation: none;
}

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

.system-time {
    font-family: 'Orbitron', monospace;
    color: var(--neon-cyan);
    font-size: 14px;
    margin-right: 20px;
}

.user-status {
    font-size: 12px;
    color: var(--text-secondary);
}

/* === DESKTOP CONTAINER === */
.desktop-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 80px);
    margin-top: 40px;
}

/* === WINDOW PANELS === */
.window-panel {
    position: absolute;
    min-width: 400px;
    min-height: 300px;
    background: rgba(30, 0, 63, 0.7);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    backdrop-filter: blur(20px);
    box-shadow: var(--window-glow);
    transition: box-shadow 0.3s ease;
}

.window-panel.active {
    box-shadow: var(--active-glow);
    z-index: 100;
}

.window-panel.hidden {
    display: none;
}

.window-panel.minimized {
    display: none;
}

/* Window Header */
.window-header {
    height: 32px;
    background: linear-gradient(90deg, rgba(0, 255, 136, 0.1) 0%, rgba(0, 221, 255, 0.1) 100%);
    border-bottom: 1px solid var(--panel-border);
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    cursor: move;
}

.window-title {
    font-family: 'Silkscreen', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--neon-cyan);
    display: flex;
    align-items: center;
    gap: 8px;
}

.window-controls {
    display: flex;
    gap: 8px;
    order: -1;
}

.control-btn {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    color: var(--neon-green);
    text-shadow: 0 0 5px currentColor;
}

.control-btn.close:hover {
    color: var(--neon-magenta);
}

/* Window Content */
.window-content {
    padding: 20px;
    color: var(--text-primary);
}

/* === GLITCH TEXT === */
.glitch-text {
    font-family: 'Press Start 2P', monospace;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    position: relative;
    animation: glitch 3s ease-in-out infinite alternate;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-text::before {
    animation: glitch-1 0.5s infinite;
    color: var(--neon-magenta);
    z-index: -1;
}

.glitch-text::after {
    animation: glitch-2 0.5s infinite;
    color: var(--neon-cyan);
    z-index: -2;
}

@keyframes glitch {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-2px); }
    40% { transform: translateX(2px); }
    60% { transform: translateX(-1px); }
    80% { transform: translateX(1px); }
}

@keyframes glitch-1 {
    0%, 100% { clip-path: inset(0 0 0 0); transform: translateX(0); }
    20% { clip-path: inset(20% 0 30% 0); transform: translateX(-2px); }
    40% { clip-path: inset(50% 0 20% 0); transform: translateX(2px); }
    60% { clip-path: inset(10% 0 60% 0); transform: translateX(-1px); }
    80% { clip-path: inset(80% 0 5% 0); transform: translateX(1px); }
}

@keyframes glitch-2 {
    0%, 100% { clip-path: inset(0 0 0 0); transform: translateX(0); }
    20% { clip-path: inset(60% 0 10% 0); transform: translateX(2px); }
    40% { clip-path: inset(20% 0 60% 0); transform: translateX(-2px); }
    60% { clip-path: inset(30% 0 40% 0); transform: translateX(1px); }
    80% { clip-path: inset(10% 0 80% 0); transform: translateX(-1px); }
}

/* === TERMINAL TEXT === */
.terminal-text {
    font-family: 'Source Code Pro', monospace;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.6;
}

.warning-text {
    color: var(--neon-amber);
    font-size: 12px;
    margin-bottom: 20px;
}

/* === CYBER BUTTONS === */
.cyber-btn {
    display: inline-block;
    position: relative;
    padding: 12px 30px;
    background: transparent;
    border: 1px solid var(--neon-cyan);
    border-radius: 4px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    color: var(--text-primary);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.cyber-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    transition: left 0.5s ease;
}

.cyber-btn:hover::before {
    left: 100%;
}

.cyber-btn:hover {
    border-color: var(--neon-green);
    text-shadow: 0 0 10px currentColor;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, var(--neon-cyan) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.cyber-btn:active .btn-glow {
    width: 200px;
    height: 200px;
    opacity: 0.3;
}

/* Button Variants */
.primary-action {
    border-color: var(--neon-green);
}

.primary-action:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 30px rgba(0, 255, 221, 0.6);
}

.secondary-action {
    border-color: var(--neon-magenta);
}

.secondary-action:hover {
    border-color: var(--neon-amber);
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.6);
}

.world-action {
    border-color: var(--neon-amber);
    background: linear-gradient(45deg, transparent 48%, rgba(255, 204, 0, 0.1) 50%, transparent 52%);
    background-size: 200% 200%;
    animation: shimmer 3s linear infinite;
}

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

/* === DATA STREAM === */
.data-stream {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 2px solid var(--neon-green);
}

.stream-line {
    font-family: 'Source Code Pro', monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

.stream-line .value {
    color: var(--neon-green);
    font-weight: 600;
}

/* === WORLD STATS === */
.world-stats {
    margin: 20px 0;
}

.stat-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.stat-label {
    font-family: 'Silkscreen', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    min-width: 100px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 221, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan) 0%, var(--neon-green) 100%);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px currentColor;
}

.progress-fill.pulse {
    animation: pulse-bar 2s ease-in-out infinite;
}

@keyframes pulse-bar {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.stat-value {
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    color: var(--neon-green);
    min-width: 50px;
    text-align: right;
}

/* === SYSTEM MONITOR === */
.monitor-display {
    font-family: 'Source Code Pro', monospace;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.monitor-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.status-value {
    color: var(--neon-amber);
    font-weight: 600;
}

.status-value.active {
    color: var(--neon-green);
}

.status-value.error {
    color: var(--neon-magenta);
}

.terminal-output {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 4px;
    padding: 10px;
    height: 150px;
    overflow-y: auto;
    font-family: 'Source Code Pro', monospace;
    font-size: 11px;
}

.output-line {
    color: var(--neon-green);
    margin-bottom: 5px;
    opacity: 0.8;
}

.output-line:last-child {
    opacity: 1;
}

/* === DESKTOP ICONS === */
.desktop-icons {
    position: absolute;
    top: 60px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.desktop-icon i {
    font-size: 32px;
    color: var(--neon-cyan);
    filter: drop-shadow(0 0 5px currentColor);
}

.desktop-icon span {
    font-family: 'Silkscreen', monospace;
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-primary);
    text-align: center;
}

.desktop-icon:hover {
    transform: scale(1.1);
}

.desktop-icon:hover i {
    color: var(--neon-green);
    filter: drop-shadow(0 0 10px currentColor);
}

/* === DESKTOP FOOTER === */
.desktop-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(90deg, rgba(18, 0, 37, 0.9) 0%, rgba(30, 0, 63, 0.8) 50%, rgba(18, 0, 37, 0.9) 100%);
    border-top: 1px solid var(--neon-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    z-index: 1000;
}

.footer-text {
    font-family: 'Silkscreen', monospace;
    font-size: 10px;
    color: var(--neon-green);
    opacity: 0.6;
    letter-spacing: 1px;
}

.terminal-cursor {
    color: var(--neon-green);
    animation: blink 1s ease-in-out infinite;
    margin-left: 5px;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* === DRAGGABLE WINDOWS === */
.draggable {
    cursor: move;
}

.draggable.dragging {
    opacity: 0.8;
    cursor: grabbing;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .window-panel {
        min-width: 300px;
        min-height: 200px;
    }
    
    .desktop-icons {
        flex-direction: row;
        bottom: 50px;
        top: auto;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .menu-bar {
        font-size: 12px;
    }
    
    .glitch-text {
        font-size: 12px;
    }
}

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

.desktop-icon.hidden {
    display: none !important;
}