/* STREAMING_CHUNK: Defining root variables and color tokens for HUD interface */
:root {
--bg-dark: #02050c;
--bg-panel: rgba(5, 15, 35, 0.85);
--hud-cyan: #00f3ff;
--hud-blue: #0066ff;
--hud-red: #ff3e3e;
--hud-green: #00ff66;
--hud-yellow: #ffe600;
--hud-cyan-glow: 0 0 10px rgba(0, 243, 255, 0.35);
--hud-blue-glow: 0 0 10px rgba(0, 102, 255, 0.35);
--hud-red-glow: 0 0 10px rgba(255, 62, 62, 0.35);
--hud-green-glow: 0 0 10px rgba(0, 255, 102, 0.35);
--hud-panel-border: rgba(0, 243, 255, 0.15);
--hud-panel-border-active: rgba(0, 243, 255, 0.5);
--text-primary: #e2f5ff;
--text-secondary: #7fa8bf;
--text-muted: #4a6c80;
--font-mono: 'Share Tech Mono', monospace;
--font-sans: 'Inter', sans-serif;
}

/* STREAMING_CHUNK: Applying reset rules and setup generic boxes */

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

/* STREAMING_CHUNK: Designing grid background and CRT scanline overlay effect */
body.hud-theme {
background-color: var(--bg-dark);
color: var(--text-primary);
font-family: var(--font-sans);
height: 100vh;
overflow: hidden;
display: flex;
flex-direction: column;
background-image:
linear-gradient(rgba(0, 243, 255, 0.02) 1px, transparent 1px),
linear-gradient(90deg, rgba(0, 243, 255, 0.02) 1px, transparent 1px);
background-size: 30px 30px;
background-position: center;
position: relative;
}

/* 已拿掉高科技螢幕掃描線 */
body.hud-theme::after {
display: none;
}

/* STREAMING_CHUNK: Designing top structural header systems and clocks */
.hud-header {
height: 50px;
background: rgba(2, 5, 12, 0.95);
border-bottom: 2px solid var(--hud-cyan);
box-shadow: 0 2px 15px rgba(0, 243, 255, 0.2);
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 20px;
z-index: 100;
}

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

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

@keyframes pulse {
0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 102, 0.7); }
70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 255, 102, 0); }
100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 102, 0); }
}

.hud-logo {
font-size: 1.15rem;
font-weight: 700;
color: var(--hud-cyan);
text-shadow: var(--hud-cyan-glow);
letter-spacing: 1px;
}

/* STREAMING_CHUNK: Formatting header status blocks and indicators */
.header-center {
display: flex;
gap: 30px;
font-size: 0.85rem;
}

.hud-stat-box {
border-left: 3px solid var(--hud-blue);
padding-left: 10px;
}

.hud-stat-box span:first-child {
color: var(--text-secondary);
}

.text-green {
color: var(--hud-green) !important; text-shadow: var(--hud-green-glow);
}

.text-cyan {
color: var(--hud-cyan) !important; text-shadow: var(--hud-cyan-glow);
}

.text-red {
color: var(--hud-red) !important; text-shadow: var(--hud-red-glow);
}

.header-right {
font-size: 0.85rem;
color: var(--text-secondary);
}

/* STREAMING_CHUNK: Formatting body split structures and panel layouts */
.ide-body {
flex: 1;
display: flex;
position: relative;
overflow: hidden;
}

/* Sidebar Panels */
.hud-panel {
background: var(--bg-panel);
border: 1px solid var(--hud-panel-border);
display: flex;
flex-direction: column;
transition: width 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
position: relative;
z-index: 10;
}

#left-sidebar.sidebar-expanded {
width: 280px;
}

#left-sidebar.sidebar-collapsed {
width: 45px;
}

#right-sidebar.sidebar-expanded {
width: 300px;
}

#right-sidebar.sidebar-collapsed {
width: 45px;
}

#left-sidebar {
border-right: 2px solid var(--hud-panel-border);
}

#right-sidebar {
border-left: 2px solid var(--hud-panel-border);
}

.panel-header {
height: 40px;
background: rgba(3, 10, 25, 0.9);
border-bottom: 1px solid var(--hud-panel-border);
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 12px;
overflow: hidden;
white-space: nowrap;
}

.panel-title {
font-family: var(--font-mono);
font-size: 0.85rem;
font-weight: 600;
letter-spacing: 0.5px;
color: var(--hud-cyan);
}

/* STREAMING_CHUNK: Styling toggle buttons and sidebar transition overrides */
.toggle-btn {
background: transparent;
border: none;
color: var(--hud-cyan);
cursor: pointer;
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
transition: color 0.2s;
}

.toggle-btn:hover {
color: #fff;
text-shadow: var(--hud-cyan-glow);
}

.sidebar-content {
flex: 1;
padding: 12px;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 12px;
}

.sidebar-collapsed .sidebar-content {
display: none;
}

.sidebar-collapsed .panel-title {
display: none;
}

.sidebar-collapsed .panel-header {
justify-content: center;
padding: 0;
}

/* STREAMING_CHUNK: Configuring Cloudflare proxy and config input panel forms */
.github-config-panel {
border: 1px solid var(--hud-panel-border);
border-radius: 4px;
background: rgba(0, 243, 255, 0.03);
overflow: hidden;
transition: all 0.3s ease;
}

.github-config-panel:hover {
border-color: rgba(0, 243, 255, 0.35);
}

.config-header {
padding: 8px 10px;
background: rgba(5, 18, 43, 0.9);
cursor: pointer;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.8rem;
font-weight: bold;
font-family: var(--font-mono);
}

.config-body {
padding: 10px;
display: flex;
flex-direction: column;
gap: 8px;
border-top: 1px solid var(--hud-panel-border);
transition: max-height 0.3s ease-out;
}

.config-body.collapsed {
max-height: 0;
padding: 0 10px;
border-top-color: transparent;
overflow: hidden;
}

.hud-input {
background: rgba(3, 8, 20, 0.95);
border: 1px solid var(--hud-panel-border);
color: var(--text-primary);
padding: 6px 10px;
border-radius: 4px;
font-family: var(--font-mono);
font-size: 0.8rem;
outline: none;
width: 100%;
}

.hud-input:focus {
border-color: var(--hud-cyan);
box-shadow: var(--hud-cyan-glow);
}

/* STREAMING_CHUNK: Designing modular neon tactical button groups */
.hud-btn {
background: rgba(0, 102, 255, 0.1);
border: 1px solid var(--hud-blue);
color: var(--text-primary);
padding: 6px 12px;
border-radius: 4px;
font-family: var(--font-mono);
font-size: 0.8rem;
cursor: pointer;
transition: all 0.25s ease;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
}

.hud-btn:hover {
background: rgba(0, 102, 255, 0.3);
box-shadow: var(--hud-blue-glow);
border-color: var(--hud-cyan);
}

.hud-btn.glow-cyan {
border-color: var(--hud-cyan);
background: rgba(0, 243, 255, 0.05);
}

.hud-btn.glow-cyan:hover {
background: rgba(0, 243, 255, 0.2);
box-shadow: var(--hud-cyan-glow);
}

.hud-btn.glow-green {
border-color: var(--hud-green);
background: rgba(0, 255, 102, 0.05);
}

.hud-btn.glow-green:hover {
background: rgba(0, 255, 102, 0.25);
box-shadow: var(--hud-green-glow);
}

.hud-btn.glow-red {
border-color: var(--hud-red);
background: rgba(255, 62, 62, 0.05);
}

.hud-btn.glow-red:hover {
background: rgba(255, 62, 62, 0.25);
box-shadow: var(--hud-red-glow);
}

.w-full {
width: 100%;
}

.text-center {
justify-content: center;
}

.cursor-pointer {
cursor: pointer;
}

/* STREAMING_CHUNK: Structuring tactical directory action layouts */
.file-actions {
display: flex;
flex-direction: column;
gap: 8px;
border-bottom: 1px dashed rgba(0, 243, 255, 0.15);
padding-bottom: 12px;
}

.folder-action-group {
display: flex;
gap: 6px;
}

.folder-action-group button {
flex: 1;
}

.current-path-display {
background: rgba(3, 8, 20, 0.7);
border: 1px solid rgba(0, 243, 255, 0.1);
padding: 4px 8px;
border-radius: 4px;
display: flex;
gap: 6px;
font-size: 0.75rem;
}

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

.path-value {
color: var(--hud-cyan);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

/* STREAMING_CHUNK: Styling standard file tree nodes and indents */
.file-tree {
flex: 1;
overflow-y: auto;
font-family: var(--font-mono);
font-size: 0.8rem;
display: flex;
flex-direction: column;
gap: 2px;
}

.file-tree-node {
display: flex;
justify-content: space-between;
align-items: center;
padding: 6px 8px;
border-radius: 4px;
cursor: pointer;
user-select: none;
border: 1px solid transparent;
transition: all 0.15s;
}

.file-tree-node:hover {
background: rgba(0, 243, 255, 0.05);
border-color: rgba(0, 243, 255, 0.15);
}

.file-node-left {
display: flex;
align-items: center;
gap: 8px;
flex: 1;
min-width: 0;
}

.file-node-left span {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

.node-toggle-icon {
width: 12px;
display: inline-flex;
justify-content: center;
transition: transform 0.2s;
}

.node-toggle-icon.expanded {
transform: rotate(90deg);
}

/* Indent Depth */
.depth-0 { padding-left: 6px; }
.depth-1 { padding-left: 20px; }
.depth-2 { padding-left: 34px; }
.depth-3 { padding-left: 48px; }
.depth-4 { padding-left: 62px; }

/* STREAMING_CHUNK: Highlighting active elements inside virtual folder layout */
.active-dir {
background: rgba(0, 102, 255, 0.1);
border-color: rgba(0, 102, 255, 0.4);
color: var(--hud-cyan);
}

.active-file {
background: rgba(0, 243, 255, 0.08);
border-color: var(--hud-cyan);
color: #fff;
font-weight: bold;
}

.file-delete-btn {
background: transparent;
border: none;
color: var(--text-muted);
cursor: pointer;
padding: 2px 6px;
border-radius: 3px;
transition: all 0.2s;
}

.file-delete-btn:hover {
color: var(--hud-red);
background: rgba(255, 62, 62, 0.1);
}

.empty-state {
color: var(--text-muted);
font-style: italic;
text-align: center;
padding: 20px 0;
font-size: 0.75rem;
}

/* STREAMING_CHUNK: Formatting grid split panel wraps in middle containers */
#middle-container {
flex: 1;
display: flex;
height: 100%;
overflow: hidden;
background: rgba(2, 5, 12, 0.5);
}

.hud-sub-panel {
flex: 1;
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
border-right: 1px solid var(--hud-panel-border);
}

.hud-sub-panel:last-child {
border-right: none;
}

/* STREAMING_CHUNK: Structuring translation components and panel fields */
.translation-switch-box {
display: flex;
justify-content: space-between;
align-items: center;
border: 1px solid rgba(0, 243, 255, 0.1);
background: rgba(3, 10, 25, 0.6);
padding: 10px;
border-radius: 4px;
}

.switch-label {
font-size: 0.75rem;
font-family: var(--font-mono);
color: var(--text-secondary);
}

.hud-switch {
position: relative;
display: inline-block;
width: 38px;
height: 20px;
}

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

.slider {
position: absolute;
cursor: pointer;
top: 0; left: 0; right: 0; bottom: 0;
background-color: rgba(3, 10, 25, 0.9);
border: 1px solid var(--hud-panel-border);
transition: .3s cubic-bezier(0.1, 0.9, 0.2, 1);
border-radius: 10px;
}

.slider:before {
position: absolute;
content: "";
height: 12px;
width: 12px;
left: 3px;
bottom: 3px;
background-color: var(--text-muted);
transition: .3s cubic-bezier(0.1, 0.9, 0.2, 1);
border-radius: 50%;
}

input:checked + .slider {
border-color: var(--hud-cyan);
box-shadow: var(--hud-cyan-glow);
}

input:checked + .slider:before {
transform: translateX(18px);
background-color: var(--hud-cyan);
box-shadow: var(--hud-cyan-glow);
}

/* STREAMING_CHUNK: Styling translation terminal terminal fields and boxes */
.translation-section {
display: flex;
flex-direction: column;
gap: 8px;
}

.hud-section-label {
font-family: var(--font-mono);
font-size: 0.75rem;
color: var(--text-muted);
letter-spacing: 0.5px;
}

.hud-terminal-box {
background: rgba(2, 5, 12, 0.9);
border: 1px solid var(--hud-panel-border);
border-radius: 4px;
padding: 10px;
font-size: 0.8rem;
line-height: 1.4;
min-height: 90px;
max-height: 140px;
overflow-y: auto;
color: var(--text-primary);
outline: none;
transition: border-color 0.2s;
}

.hud-terminal-box.empty {
color: var(--text-muted);
}

.hud-terminal-box:focus {
border-color: var(--hud-cyan);
box-shadow: var(--hud-cyan-glow);
}

.hud-terminal-box-output {
background: rgba(3, 10, 25, 0.95);
border-left: 3px solid var(--hud-cyan);
border-top: 1px solid var(--hud-panel-border);
border-right: 1px solid var(--hud-panel-border);
border-bottom: 1px solid var(--hud-panel-border);
border-radius: 0 4px 4px 0;
padding: 12px;
font-size: 0.85rem;
line-height: 1.5;
min-height: 120px;
overflow-y: auto;
}

.hud-terminal-text {
font-family: var(--font-mono);
color: var(--text-secondary);
}

.translation-footer {
border-top: 1px dashed rgba(0, 243, 255, 0.1);
padding-top: 12px;
margin-top: auto;
}

/* STREAMING_CHUNK: Designing toast notifications and security alert bars */
.hud-toast {
position: fixed;
bottom: 25px;
left: 50%;
transform: translateX(-50%);
background: rgba(2, 5, 12, 0.95);
border: 1px solid var(--hud-cyan);
box-shadow: var(--hud-cyan-glow);
padding: 10px 25px;
border-radius: 4px;
z-index: 10000;
font-size: 0.85rem;
color: var(--text-primary);
letter-spacing: 0.5px;
transition: opacity 0.3s, transform 0.3s;
}

.hud-toast.hidden {
opacity: 0;
transform: translate(-50%, 15px);
pointer-events: none;
}

/* STREAMING_CHUNK: Overriding native scrollbars with high-tech glowing styles */
::-webkit-scrollbar {
width: 6px;
height: 6px;
}

::-webkit-scrollbar-track {
background: rgba(2, 5, 12, 0.4);
}

::-webkit-scrollbar-thumb {
background: rgba(0, 243, 255, 0.25);
border-radius: 3px;
}

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