/* Nexus Cyberdeck OS - Industrial Sci-Fi Theme (Prosperous Universe Style) */

:root {
    /* Colors - Dark Industrial */
    --bg-deep: #0a0c10;
    --bg-dark: #12151c;
    --bg-panel: #181c26;
    --bg-panel-hover: #1e2432;
    --bg-input: #0d1018;
    
    /* Accents - Amber/Orange like Prosperous */
    --accent-primary: #e8a54b;
    --accent-secondary: #d4913d;
    --accent-glow: rgba(232, 165, 75, 0.3);
    --accent-blue: #4a90d9;
    --accent-green: #5cb85c;
    --accent-red: #d9534f;
    --accent-purple: #9d7fd9;
    
    /* Borders - Subtle industrial */
    --border-color: #2a3040;
    --border-light: #3a4560;
    --border-active: #e8a54b;
    
    /* Text */
    --text-primary: #c8cfd8;
    --text-secondary: #8a95a8;
    --text-muted: #5a6578;
    --text-accent: #e8a54b;
    
    /* Spacing & Grid */
    --header-height: 40px;
    --dock-height: 60px;
    --border-radius: 4px;
    --grid-size: 40px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-medium: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    overflow: hidden;
    font-size: 13px;
    line-height: 1.4;
}

/* App Container */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: linear-gradient(180deg, var(--bg-deep) 0%, #080a0f 100%);
    opacity: 0;
    animation: fadeIn 0.4s ease forwards;
}

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

/* Status Bar */
.status-bar {
    height: var(--header-height);
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
    flex-shrink: 0;
}

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

.status-center {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: var(--text-secondary);
}

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

#clock {
    color: var(--accent-primary);
    font-weight: 600;
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 1px;
}

.logo {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: 3px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.node-indicator {
    font-size: 14px;
    cursor: help;
    transition: var(--transition-fast);
}

.node-indicator.online { 
    color: var(--accent-green);
    text-shadow: 0 0 8px rgba(92, 184, 92, 0.5);
}
.node-indicator.offline { 
    color: var(--accent-red);
    opacity: 0.5;
}
.node-indicator.warn { 
    color: var(--accent-primary);
}

/* Tab Bar */
.tab-bar {
    display: flex;
    gap: 4px;
}

.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 5px 14px;
    font-size: 11px;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tab-btn:hover {
    background: var(--bg-panel);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--bg-panel);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: 0 0 12px rgba(232, 165, 75, 0.15);
}

/* Add Tab & Store Buttons */
#add-tab-btn {
    background: transparent;
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition-fast);
}

#add-tab-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(232, 165, 75, 0.1);
}

#widget-store-btn {
    background: rgba(232, 165, 75, 0.15);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 5px 14px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: var(--transition-fast);
}

#widget-store-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-deep);
}

/* Grid Background for Visual Snapping */
.desktop-stage {
    flex: 1;
    position: relative;
    overflow: hidden;
    padding: 16px;
    background-image: 
        linear-gradient(rgba(42, 48, 64, 0.4) 1px, transparent 1px),
        linear-gradient(90deg, rgba(42, 48, 64, 0.4) 1px, transparent 1px);
    background-size: var(--grid-size) var(--grid-size);
    background-position: 0 0;
}

/* Grid Snap Preview - Ghost overlay */
.grid-snap-preview {
    position: absolute;
    pointer-events: none;
    border: 2px dashed var(--accent-primary);
    background: rgba(232, 165, 75, 0.08);
    border-radius: var(--border-radius);
    z-index: 9998;
    transition: all 0.05s linear;
    opacity: 0;
}

.grid-snap-preview.active {
    opacity: 1;
}

/* Snap Effect Animation */
@keyframes snapFlash {
    0% { box-shadow: 0 0 0 0 rgba(232, 165, 75, 0.5); border-color: var(--accent-primary); }
    50% { box-shadow: 0 0 20px 5px rgba(232, 165, 75, 0.3); border-color: var(--text-accent); }
    100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4); border-color: var(--border-color); }
}

.window.snap-anim {
    animation: snapFlash 0.4s ease-out;
}

/* Window Styles */
.window {
    position: absolute;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    min-width: 200px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
    transition: box-shadow var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
    will-change: transform, left, top;
    backface-visibility: hidden;
}

.window:hover {
    border-color: var(--border-light);
    box-shadow: 0 6px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.window.dragging {
    opacity: 0.92;
    transform: scale(1.01);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
    cursor: grabbing;
    z-index: 9999 !important;
}

.window.spawning {
    animation: windowSpawn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.window-header {
    height: 32px;
    background: linear-gradient(180deg, var(--bg-dark) 0%, rgba(24, 28, 38, 0.95) 100%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 10px;
    cursor: grab;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    user-select: none;
}

.window-header:active {
    cursor: grabbing;
}

.window-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    pointer-events: none;
}

.window-controls {
    margin-left: auto;
    display: flex;
    gap: 4px;
}

.window-controls button {
    width: 20px;
    height: 20px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 3px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.window-controls button:hover {
    background: var(--bg-panel-hover);
    color: var(--text-primary);
}

.window-controls .window-close:hover {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

.window-controls .window-minimize:hover {
    background: var(--accent-primary);
    color: var(--bg-deep);
}

.window-controls .window-maximize:hover {
    background: var(--accent-blue);
    color: white;
}

.window-content {
    flex: 1;
    overflow: auto;
    padding: 12px;
    min-height: 100px;
}

/* Maximized Window */
.window.maximized {
    transition: all var(--transition-slow);
}

.window.maximized .window-resize {
    display: none;
}

/* Minimized Window */
.window.minimized {
    min-height: auto !important;
}

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

/* Window dragging states */
.window.dragging {
    opacity: 0.9;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transition: box-shadow 0.2s;
}

.window.dragging .window-header {
    background: var(--accent-primary);
    color: var(--bg-deep);
}

.window.dragging .window-title {
    color: var(--bg-deep);
}

.window.snapped {
    box-shadow: 0 0 20px var(--accent-glow);
}
.spotlight-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 12, 16, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-medium), visibility var(--transition-medium);
}

.spotlight-overlay.active {
    opacity: 1;
    visibility: visible;
}

.spotlight-container {
    width: 600px;
    max-width: 90vw;
    background: rgba(24, 28, 38, 0.98);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(232, 165, 75, 0.1);
    overflow: hidden;
    transform: translateY(-20px) scale(0.98);
    transition: transform var(--transition-medium), box-shadow var(--transition-medium);
}

.spotlight-overlay.active .spotlight-container {
    transform: translateY(0) scale(1);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(232, 165, 75, 0.15), 0 0 40px rgba(232, 165, 75, 0.1);
}

.spotlight-input-wrapper {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg-dark) 100%);
}

.spotlight-search-icon {
    font-size: 20px;
    color: var(--text-muted);
    margin-right: 12px;
    opacity: 0.7;
}

.spotlight-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    font-family: inherit;
    outline: none;
    padding: 4px 0;
}

.spotlight-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.spotlight-input:focus {
    outline: none;
}

.spotlight-shortcut-hint {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'IBM Plex Mono', monospace;
}

.spotlight-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}

.spotlight-section {
    margin-bottom: 8px;
}

.spotlight-section-title {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 8px 12px;
    font-weight: 600;
}

.spotlight-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin: 2px 0;
}

.spotlight-result:hover,
.spotlight-result.selected {
    background: rgba(232, 165, 75, 0.12);
}

.spotlight-result.selected {
    border-left: 3px solid var(--accent-primary);
}

.spotlight-result-icon {
    width: 36px;
    height: 36px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition-fast);
}

.spotlight-result:hover .spotlight-result-icon,
.spotlight-result.selected .spotlight-result-icon {
    border-color: var(--accent-primary);
    background: rgba(232, 165, 75, 0.15);
}

.spotlight-result-info {
    flex: 1;
}

.spotlight-result-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 2px;
}

.spotlight-result-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.spotlight-result-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.spotlight-result:hover .spotlight-result-actions,
.spotlight-result.selected .spotlight-result-actions {
    opacity: 1;
}

.spotlight-tab-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition-fast);
}

.spotlight-tab-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-deep);
}

.spotlight-no-results {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
}

.spotlight-no-results-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Spotlight Footer */
.spotlight-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-dark);
    border-top: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-muted);
}

.spotlight-hints {
    display: flex;
    gap: 16px;
}

.spotlight-hint {
    display: flex;
    align-items: center;
    gap: 4px;
}

.spotlight-hint kbd {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 2px 6px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
}

/* Empty State for Spotlight */
.spotlight-empty {
    padding: 32px;
    text-align: center;
    color: var(--text-muted);
}

.spotlight-empty-title {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* ===== DOCK & SPOTLIGHT ===== */
.dock {
    height: 64px;
    background: var(--bg-dark);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 100;
}

/* Spotlight wrapper in dock */
.spotlight-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 320px;
    position: relative;
}

.spotlight-input-container {
    display: flex;
    align-items: center;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 14px;
    width: 100%;
    transition: all 0.2s ease;
    cursor: text;
}

.spotlight-input-container:hover,
.spotlight-input-container:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(232, 165, 75, 0.15);
}

.spotlight-icon {
    color: var(--accent-primary);
    font-size: 14px;
    margin-right: 10px;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
}

.spotlight-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.spotlight-input::placeholder {
    color: var(--text-muted);
}

/* Spotlight results dropdown */
.spotlight-results {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    max-height: 320px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
}

.spotlight-results.show {
    display: block;
}

.spotlight-result {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.15s ease;
}

.spotlight-result:last-child {
    border-bottom: none;
}

.spotlight-result:hover,
.spotlight-result.active {
    background: var(--bg-panel-hover);
}

.spotlight-result-icon {
    font-size: 18px;
    margin-right: 12px;
    width: 28px;
    text-align: center;
}

.spotlight-result-content {
    flex: 1;
}

.spotlight-result-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.spotlight-result-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.spotlight-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
}

.dock-spotlight-trigger {
    height: 44px;
    padding: 0 20px;
    background: linear-gradient(135deg, rgba(232, 165, 75, 0.15) 0%, rgba(232, 165, 75, 0.05) 100%);
    border: 1px solid var(--accent-primary);
    border-radius: 22px;
    color: var(--accent-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.dock-spotlight-trigger:hover {
    background: var(--accent-primary);
    color: var(--bg-deep);
    box-shadow: 0 4px 20px rgba(232, 165, 75, 0.3);
    transform: translateY(-2px);
}

.dock-spotlight-shortcut {
    font-size: 10px;
    opacity: 0.7;
    font-family: 'IBM Plex Mono', monospace;
}

.dock-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 8px;
}

.dock-item {
    width: 44px;
    height: 44px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.dock-item:hover {
    background: var(--bg-panel-hover);
    border-color: var(--accent-primary);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.dock-item.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-primary);
}

/* Widget Styles */
.telemetry-widget {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    font-family: 'IBM Plex Mono', monospace;
}

.telemetry-item {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 8px;
    text-align: center;
}

.telemetry-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.telemetry-bar {
    height: 4px;
    background: var(--bg-dark);
    border-radius: 2px;
    margin: 6px 0;
    overflow: hidden;
}

.telemetry-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.telemetry-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-primary);
}

/* Chat Widget */
.chat-widget {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 8px;
    margin-bottom: 8px;
    min-height: 100px;
}

.chat-message {
    padding: 6px 8px;
    margin-bottom: 4px;
    border-radius: var(--border-radius);
    font-size: 12px;
    word-wrap: break-word;
    animation: messageIn 0.2s ease;
}

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

.chat-message.user {
    background: rgba(232, 165, 75, 0.15);
    border-left: 2px solid var(--accent-primary);
    margin-left: 15%;
}

.chat-message.bot {
    background: rgba(74, 144, 217, 0.15);
    border-left: 2px solid var(--accent-blue);
    margin-right: 15%;
}

.chat-input-area {
    display: flex;
    gap: 6px;
}

.chat-input-area select,
.chat-input-area input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 8px;
    border-radius: var(--border-radius);
    font-size: 12px;
}

.chat-input-area input {
    flex: 1;
}

.chat-input-area button {
    background: var(--accent-primary);
    border: none;
    color: var(--bg-deep);
    padding: 6px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition-fast);
}

.chat-input-area button:hover {
    background: var(--accent-secondary);
}

/* Terminal Widget */
.terminal-widget {
    display: flex;
    flex-direction: column;
    height: 100%;
    font-family: 'IBM Plex Mono', monospace;
}

.terminal-output {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 8px;
    font-size: 11px;
    min-height: 80px;
}

.terminal-line {
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: pre-wrap;
    word-break: break-all;
}

.terminal-line.prompt {
    color: var(--accent-green);
}

.terminal-line.error {
    color: var(--accent-red);
}

.terminal-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 6px 8px;
}

.terminal-prompt {
    color: var(--accent-green);
    font-weight: 600;
    font-size: 11px;
}

.terminal-input-area input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 11px;
    outline: none;
}

/* Files Widget */
.files-widget {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.files-path {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 6px 8px;
    font-size: 11px;
    color: var(--accent-primary);
    margin-bottom: 8px;
    font-family: 'IBM Plex Mono', monospace;
}

.files-list {
    flex: 1;
    overflow-y: auto;
}

.files-item {
    padding: 5px 8px;
    cursor: pointer;
    border-radius: var(--border-radius);
    font-size: 12px;
    transition: all var(--transition-fast);
}

.files-item:hover {
    background: var(--bg-panel-hover);
}

.files-item.directory {
    color: var(--accent-secondary);
}

/* Network Widget */
.network-widget {
    font-size: 11px;
}

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

.refresh-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition-fast);
}

.refresh-btn:hover {
    background: var(--bg-panel-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.network-self, .network-peer {
    padding: 6px 8px;
    background: var(--bg-input);
    border-radius: var(--border-radius);
    margin-bottom: 4px;
    font-size: 10px;
    border-left: 2px solid var(--accent-primary);
}

/* Torn Widget */
.torn-widget {
    font-size: 11px;
}

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

.torn-stats {
    background: var(--bg-input);
    border-radius: var(--border-radius);
    padding: 10px;
    margin-bottom: 8px;
    border-left: 2px solid var(--accent-secondary);
}

.torn-stat {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 4px;
}

.torn-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 8px;
}

.torn-tab {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition-fast);
}

.torn-tab.active {
    background: rgba(232, 165, 75, 0.2);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.torn-tab:hover {
    background: var(--bg-panel-hover);
}

.torn-content {
    background: var(--bg-input);
    border-radius: var(--border-radius);
    padding: 8px;
    max-height: 120px;
    overflow-y: auto;
    border-left: 2px solid var(--border-color);
}

/* Hermes Widget */
.hermes-widget {
    font-size: 11px;
}

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

.hermes-tasks {
    background: var(--bg-input);
    border-radius: var(--border-radius);
    padding: 8px;
    max-height: 120px;
    overflow-y: auto;
}

.hermes-task {
    padding: 5px 6px;
    border-radius: var(--border-radius);
    margin-bottom: 4px;
    transition: all var(--transition-fast);
    font-size: 11px;
}

.hermes-task:hover {
    background: var(--bg-panel-hover);
}

.task-status {
    margin-right: 6px;
}

/* Bookmarks Widget */
.bookmarks-widget {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.bookmarks-header {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.bookmarks-header input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: var(--border-radius);
    font-size: 11px;
    flex: 1;
}

.bookmarks-list {
    flex: 1;
    overflow-y: auto;
}

.bookmark-item {
    display: block;
    padding: 8px;
    background: var(--bg-input);
    border-radius: var(--border-radius);
    margin-bottom: 4px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    border-left: 2px solid var(--border-color);
}

.bookmark-item:hover {
    background: var(--bg-panel-hover);
    border-left-color: var(--accent-primary);
}

.bookmark-icon {
    margin-right: 6px;
}

.bookmark-title {
    font-size: 12px;
}

.bookmark-tags {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.bookmark-tag {
    font-size: 9px;
    background: rgba(232, 165, 75, 0.2);
    color: var(--accent-primary);
    padding: 2px 6px;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* RSS Widget */
.rss-widget {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.rss-header {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.rss-header input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 8px;
    border-radius: var(--border-radius);
    font-size: 11px;
}

.rss-header button {
    background: var(--accent-primary);
    border: none;
    color: var(--bg-deep);
    padding: 6px 10px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rss-items {
    flex: 1;
    overflow-y: auto;
}

.rss-item {
    padding: 8px;
    background: var(--bg-input);
    border-radius: var(--border-radius);
    margin-bottom: 4px;
    border-left: 2px solid var(--accent-blue);
}

.rss-item a {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 12px;
}

.rss-item a:hover {
    text-decoration: underline;
}

.rss-item .rss-date {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* AI Builder Widget */
.ai-builder-widget {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ai-builder-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px;
    border-radius: var(--border-radius);
    font-size: 12px;
    resize: none;
    min-height: 60px;
    margin-bottom: 8px;
    font-family: inherit;
}

.ai-builder-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.ai-builder-submit {
    background: var(--accent-primary);
    border: none;
    color: var(--bg-deep);
    padding: 8px 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    align-self: flex-start;
    transition: var(--transition-fast);
}

.ai-builder-submit:hover {
    background: var(--accent-secondary);
}

.ai-builder-result {
    margin-top: 12px;
    padding: 10px;
    background: var(--bg-input);
    border-radius: var(--border-radius);
    border-left: 2px solid var(--accent-primary);
}

.ai-builder-preview {
    margin-top: 8px;
}

.ai-builder-preview button {
    background: var(--accent-green);
    border: none;
    color: var(--bg-deep);
    padding: 6px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
}

/* Arcade Widget */
.arcade-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: var(--bg-input);
    border-radius: var(--border-radius);
}

.arcade-canvas {
    background: #000;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
}

/* Login Overlay */
#login-overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-deep);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.login-box {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 32px;
    text-align: center;
    min-width: 280px;
    animation: loginIn 0.4s ease;
}

@keyframes loginIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.login-box h1 {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: 4px;
    margin-bottom: 24px;
    text-transform: uppercase;
}

.login-box input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--border-radius);
    font-size: 14px;
    text-align: center;
    letter-spacing: 4px;
    margin-bottom: 16px;
    transition: var(--transition-fast);
}

.login-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(232, 165, 75, 0.1);
}

.login-box button {
    width: 100%;
    background: var(--accent-primary);
    border: none;
    color: var(--bg-deep);
    padding: 10px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: var(--transition-fast);
}

.login-box button:hover {
    background: var(--accent-secondary);
}

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

::-webkit-scrollbar-track {
    background: var(--bg-input);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

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

/* Edge Glow Effect */
.edge-glow {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.15s ease;
    opacity: 0;
}

.edge-glow.top-left {
    top: 0;
    left: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at 0 0, rgba(232, 165, 75, 0.4) 0%, transparent 70%);
}

.edge-glow.top-right {
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at 100% 0, rgba(232, 165, 75, 0.4) 0%, transparent 70%);
}

.edge-glow.bottom-left {
    bottom: 0;
    left: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at 0 100%, rgba(232, 165, 75, 0.4) 0%, transparent 70%);
}

.edge-glow.bottom-right {
    bottom: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at 100% 100%, rgba(232, 165, 75, 0.4) 0%, transparent 70%);
}

/* Settings Widget */
.settings-widget {
    font-size: 12px;
}

.settings-section {
    padding: 4px;
}

.settings-field {
    margin-bottom: 12px;
}

.settings-field label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.settings-field input,
.settings-field textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px;
    border-radius: var(--border-radius);
    font-size: 12px;
    font-family: 'IBM Plex Mono', monospace;
    transition: var(--transition-fast);
}

.settings-field input:focus,
.settings-field textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.settings-field textarea {
    resize: vertical;
    min-height: 60px;
}

/* ===== SPOTLIGHT SEARCH ===== */
.spotlight-wrapper {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.spotlight-input-container {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0 14px;
    height: 44px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.spotlight-input-container:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.spotlight-icon {
    color: var(--accent-primary);
    font-size: 14px;
    margin-right: 10px;
    font-weight: 600;
}

#spotlight-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'IBM Plex Sans', sans-serif;
    outline: none;
}

#spotlight-input::placeholder {
    color: var(--text-muted);
}

.spotlight-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    max-height: 420px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

.spotlight-result {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.spotlight-result:last-child {
    border-bottom: none;
}

.spotlight-result:hover,
.spotlight-result.active {
    background: var(--bg-panel-hover);
}

.spotlight-result-icon {
    font-size: 22px;
    margin-right: 14px;
    width: 36px;
    text-align: center;
}

.spotlight-result-content {
    flex: 1;
}

.spotlight-result-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.spotlight-result-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.spotlight-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
