/* === Y2K RETROFUTURE — SILVER/PURPLE === */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Orbitron:wght@400;700;900&display=swap');

:root {
  --bg: #ffffff;
  --bg-panel: rgba(255, 255, 255, 0.55);
  --bg-panel-hover: rgba(255, 255, 255, 0.72);
  --border: rgba(160, 140, 200, 0.25);
  --border-glow: rgba(140, 100, 220, 0.45);
  --silver: linear-gradient(135deg, #d6d3e0, #eae8f2, #c8c4d8, #e2dff0);
  --silver-flat: #d4d0e0;
  --silver-shine: rgba(255, 255, 255, 0.7);
  --accent: #7c3aed;
  --accent-dim: rgba(124, 58, 237, 0.3);
  --accent-light: #a78bfa;
  --accent2: #ec4899;
  --accent3: #3b82f6;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --text: #3b2e5a;
  --text-dim: #8a80a5;
  --text-bright: #1e1235;
  --font-mono: 'Space Mono', monospace;
  --font-display: 'Orbitron', sans-serif;
  --grad-1: #c084fc;
  --grad-2: #818cf8;
  --grad-3: #e879f9;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  min-height: 100vh;
  overflow-x: hidden;
}

/* === BACKGROUND — WHITE + WARPED GRID (canvas) === */

#grid-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}

/* === CRT EFFECTS (subtle) === */

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(124, 58, 237, 0.008) 3px,
    rgba(124, 58, 237, 0.008) 6px
  );
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(124, 58, 237, 0.04) 100%
  );
}

/* === HEADER === */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255,255,255,0.6) 100%);
  position: relative;
  backdrop-filter: blur(16px);
}

header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--grad-1), var(--grad-3), var(--grad-2), transparent);
  opacity: 0.6;
}

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

.logo-mark {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent-dim);
  border: 1px solid var(--accent-dim);
  padding: 6px 10px;
  background: rgba(124, 58, 237, 0.06);
  animation: logo-flicker 5s ease-in-out infinite;
}

@keyframes logo-flicker {
  0%, 95%, 100% { opacity: 1; }
  96% { opacity: 0.7; }
  97% { opacity: 1; }
  98% { opacity: 0.8; }
}

h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  color: var(--text-bright);
  letter-spacing: 5px;
  text-shadow: 0 0 20px rgba(124, 58, 237, 0.15);
  position: relative;
}

h1::before,
h1::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

h1::before {
  color: var(--accent2);
  opacity: 0.05;
  animation: glitch-1 4s infinite;
}

h1::after {
  color: var(--accent3);
  opacity: 0.05;
  animation: glitch-2 4s infinite;
}

@keyframes glitch-1 {
  0%, 92%, 100% { clip-path: inset(0); transform: translate(0); }
  94% { clip-path: inset(20% 0 40% 0); transform: translate(-2px, 0); }
  96% { clip-path: inset(60% 0 10% 0); transform: translate(2px, 0); }
}

@keyframes glitch-2 {
  0%, 90%, 100% { clip-path: inset(0); transform: translate(0); }
  92% { clip-path: inset(40% 0 20% 0); transform: translate(2px, 0); }
  95% { clip-path: inset(10% 0 60% 0); transform: translate(-2px, 0); }
}

h1 .accent {
  color: var(--accent);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
}

.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 6px var(--green), 0 0 14px rgba(16, 185, 129, 0.3);
  animation: pulse 2s ease-in-out infinite;
}

.header-status {
  color: var(--green);
  font-weight: 700;
}

.header-sep {
  width: 1px;
  height: 28px;
  background: var(--border);
  margin: 0 4px;
}

/* === HARDWARE STATS === */

.hw-stats {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hw-stat {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hw-label {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-dim);
  min-width: 30px;
}

.hw-bar {
  width: 48px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.hw-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-light), var(--accent));
  border-radius: 3px;
  transition: width 0.6s ease;
}

.hw-val {
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--text);
  min-width: 32px;
}

.hw-temp {
  min-width: 38px;
}

.btn-logout {
  font-size: 16px;
  color: var(--text-dim);
  text-decoration: none;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 2px;
  transition: all 0.15s;
  line-height: 1;
}

.btn-logout:hover {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.06);
}

.header-time {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 14px;
  min-width: 80px;
  text-align: right;
}

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

/* === MAIN GRID === */

main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  padding: 28px 32px;
  max-width: 1500px;
  margin: 0 auto;
}

/* === PANELS === */

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  border-radius: 3px;
  box-shadow: 0 2px 16px rgba(100, 80, 160, 0.06);
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--grad-1), var(--grad-3), transparent);
  opacity: 0.5;
}

.panel::after {
  content: '';
  position: absolute;
  inset: 5px;
  pointer-events: none;
  border: 1px solid transparent;
  border-image: linear-gradient(
    135deg,
    var(--accent-dim) 0%, var(--accent-dim) 10px,
    transparent 10px, transparent calc(100% - 10px),
    var(--accent-dim) calc(100% - 10px), var(--accent-dim) 100%
  ) 1;
  opacity: 0.18;
}

.panel:hover {
  border-color: var(--border-glow);
  background: var(--bg-panel-hover);
  box-shadow: 0 6px 36px rgba(124, 58, 237, 0.08);
}

.panel:hover::before {
  opacity: 0.85;
}

.panel:hover::after {
  opacity: 0.32;
}

.panel-wide {
  grid-column: span 2;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent);
  text-transform: uppercase;
  position: relative;
}

.panel-header::before {
  content: '//';
  color: var(--text-dim);
  opacity: 0.3;
  font-family: var(--font-mono);
  font-size: 12px;
  margin-right: 2px;
}

.panel-icon {
  font-size: 10px;
}

.panel-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.panel-body {
  padding: 20px;
}

/* === STATUS GRID === */

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: rgba(124, 58, 237, 0.03);
  border: 1px solid var(--border);
  position: relative;
  transition: all 0.2s;
}

.status-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 3px;
  background: var(--accent-dim);
  transition: all 0.2s;
}

.status-item:hover {
  background: rgba(124, 58, 237, 0.06);
}

.status-item:hover::before {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-dim);
  top: 8%;
  bottom: 8%;
}

.status-item .label {
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 2px;
}

.status-item .value {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 1px;
}

.value.online { color: var(--green); font-weight: 700; }
.value.offline { color: var(--red); font-weight: 700; }
.value.pending { color: var(--yellow); font-weight: 700; }

/* === LINKS === */

a.status-link {
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

a.status-link:hover {
  background: rgba(124, 58, 237, 0.06);
  border-color: var(--accent);
  box-shadow: 0 2px 14px rgba(124, 58, 237, 0.1);
}

/* === LAPTOP CONTROL === */

.laptop-status {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.laptop-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--border);
  position: relative;
}

.ring::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid var(--border);
  opacity: 0.3;
}

.ring::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--red);
  opacity: 0.12;
}

.laptop-indicator.on .ring {
  border-color: var(--green);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.laptop-indicator.on .ring::before {
  border-color: rgba(16, 185, 129, 0.2);
}

.laptop-indicator.on .ring::after {
  background: var(--green);
  opacity: 0.3;
  box-shadow: 0 0 14px var(--green);
}

.laptop-indicator.booting .ring {
  border-color: var(--yellow);
  border-top-color: transparent;
  animation: spin-ring 1.5s linear infinite;
}

.laptop-indicator.booting .ring::before {
  border-color: rgba(245, 158, 11, 0.15);
  border-bottom-color: transparent;
  animation: spin-ring 3s linear infinite reverse;
}

.laptop-indicator.booting .ring::after {
  background: var(--yellow);
  opacity: 0.18;
  animation: pulse 1s ease-in-out infinite;
}

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

#laptop-state {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--text-dim);
}

.laptop-indicator.on #laptop-state {
  color: var(--green);
  font-weight: 700;
}
.laptop-indicator.booting #laptop-state {
  color: var(--yellow);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0.3; }
}

.laptop-controls {
  display: flex;
  gap: 10px;
}

/* === BUTTONS === */

.btn {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 2px;
  padding: 13px 20px;
  border: 1px solid var(--border);
  background: rgba(124, 58, 237, 0.04);
  color: var(--text);
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  position: relative;
}

.btn::before {
  content: '[';
  color: var(--text-dim);
  opacity: 0;
  transition: all 0.15s;
  margin-right: -4px;
}

.btn::after {
  content: ']';
  color: var(--text-dim);
  opacity: 0;
  transition: all 0.15s;
  margin-left: -4px;
}

.btn:hover::before,
.btn:hover::after {
  opacity: 0.5;
  color: var(--accent);
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(124, 58, 237, 0.08);
  box-shadow: 0 2px 14px rgba(124, 58, 237, 0.12);
}

.btn-power {
  flex: 1;
  justify-content: center;
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--green);
  background: rgba(16, 185, 129, 0.04);
}

.btn-power:hover {
  border-color: var(--green);
  color: var(--green);
  background: rgba(16, 185, 129, 0.1);
  box-shadow: 0 2px 14px rgba(16, 185, 129, 0.15);
}

.btn-power:hover::before,
.btn-power:hover::after {
  color: var(--green);
}

.btn-danger {
  flex: 1;
  justify-content: center;
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--red);
  background: rgba(239, 68, 68, 0.04);
}

.btn-danger:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(239, 68, 68, 0.1);
  box-shadow: 0 2px 14px rgba(239, 68, 68, 0.15);
}

.btn-danger:hover::before,
.btn-danger:hover::after {
  color: var(--red);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 11px;
}

.btn-sm::before,
.btn-sm::after {
  display: none;
}

.btn-accent {
  border-color: var(--accent-dim);
  color: var(--accent);
  cursor: pointer;
}

.btn-full {
  width: 100%;
  justify-content: center;
  text-align: center;
  margin-top: 16px;
}

.btn-icon {
  font-size: 16px;
}

/* === FILE MANAGER === */

.file-path {
  padding: 10px 16px;
  background: rgba(124, 58, 237, 0.03);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-dim);
  margin-bottom: 14px;
  font-size: 14px;
}

.path-prefix {
  color: var(--accent-light);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 350px;
  overflow-y: auto;
}

.file-list::-webkit-scrollbar {
  width: 5px;
}

.file-list::-webkit-scrollbar-track {
  background: rgba(124, 58, 237, 0.03);
}

.file-list::-webkit-scrollbar-thumb {
  background: var(--accent-dim);
  border-radius: 3px;
}

.file-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.1s;
  border-left: 3px solid transparent;
  font-size: 14px;
}

.file-entry:hover {
  background: rgba(124, 58, 237, 0.04);
  border-left-color: var(--accent);
}

.file-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
}

.file-icon.dir { color: var(--accent); }
.file-icon.file { color: var(--text-dim); }

.file-name {
  flex: 1;
}

.file-name.dir { color: var(--accent); }

.file-size {
  color: var(--text-dim);
  font-size: 13px;
  min-width: 80px;
  text-align: right;
}

.file-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.1s;
}

.file-entry:hover .file-actions {
  opacity: 1;
}

.file-action-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  padding: 3px 8px;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: all 0.1s;
}

.file-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.file-action-btn.delete:hover {
  border-color: var(--red);
  color: var(--red);
}

.file-empty {
  color: var(--text-dim);
  text-align: center;
  padding: 32px;
  font-style: italic;
  font-size: 14px;
}

/* === PI-HOLE STATS === */

.pihole-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-block {
  text-align: center;
  padding: 18px 10px;
  background: rgba(236, 72, 153, 0.03);
  border: 1px solid var(--border);
  position: relative;
}

.stat-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent2), transparent);
  opacity: 0.3;
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent2);
  margin-bottom: 6px;
}

.stat-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
}

/* === FOOTER === */

footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 20px 32px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--grad-1), var(--grad-3), var(--grad-2), transparent);
  opacity: 0.3;
}

.footer-sep {
  color: var(--border);
}

/* === RESPONSIVE === */

@media (max-width: 900px) {
  main {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .panel-wide {
    grid-column: span 1;
  }

  header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
    padding: 16px 20px;
  }

  .header-right {
    font-size: 11px;
  }

  .hw-stats {
    display: none;
  }

  .header-sep {
    display: none;
  }

  h1 {
    font-size: 20px;
  }

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

  .laptop-controls {
    flex-direction: column;
  }
}

/* === SELECTION === */

::selection {
  background: var(--accent);
  color: white;
}
