:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #121824;
  --bg-tertiary: #1b2336;
  --text-main: #e2e8f0;
  --text-muted: #8892b0;
  --accent-cyan: #00f0ff;
  --accent-green: #39ff14;
  --accent-red: #ff4d4d;
  --accent-orange: #ffb703;
  --accent-blue: #3b82f6;
  --border-color: rgba(0, 240, 255, 0.15);
  --border-glow: 0 0 10px rgba(0, 240, 255, 0.2);
  --danger-glow: 0 0 15px rgba(255, 77, 77, 0.3);
  --success-glow: 0 0 15px rgba(57, 255, 20, 0.3);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-image: 
    radial-gradient(at 0% 0%, rgba(16, 28, 48, 0.8) 0, transparent 50%),
    radial-gradient(at 50% 0%, rgba(12, 40, 71, 0.5) 0, transparent 50%),
    radial-gradient(at 100% 0%, rgba(16, 28, 48, 0.8) 0, transparent 50%);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Header styling */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background-color: rgba(18, 24, 36, 0.85);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 24px;
  color: var(--accent-cyan);
  text-shadow: var(--border-glow);
  animation: pulse-glow 2s infinite alternate;
}

h1 {
  font-family: 'Share Tech Mono', 'Fira Code', monospace;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #ffffff, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 24px;
}

.score-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 240, 255, 0.05);
  padding: 6px 16px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  box-shadow: var(--border-glow);
}

.score-label {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.score-value {
  font-family: 'Share Tech Mono', monospace;
  font-size: 18px;
  color: var(--accent-cyan);
  font-weight: bold;
}

/* Main Container Layout */
main {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  flex: 1;
  overflow: hidden;
}

/* Left Sidebar - Asset Inventory */
.asset-sidebar {
  background-color: rgba(18, 24, 36, 0.6);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.section-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-cyan);
  padding: 16px 20px 8px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.08);
}

.scan-action-box {
  padding: 16px 20px;
}

.btn-scan {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(0, 150, 255, 0.1));
  border: 1px solid var(--accent-cyan);
  border-radius: 4px;
  color: var(--accent-cyan);
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  letter-spacing: 1px;
  text-shadow: var(--border-glow);
  box-shadow: var(--border-glow);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-scan:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.3), rgba(0, 150, 255, 0.2));
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
  transform: translateY(-1px);
}

.btn-scan:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: var(--text-muted);
  color: var(--text-muted);
  box-shadow: none;
}

.asset-list {
  list-style: none;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.asset-item {
  background-color: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.asset-item:hover {
  background-color: var(--bg-tertiary);
  border-color: rgba(0, 240, 255, 0.3);
}

.asset-item.active {
  background-color: rgba(0, 240, 255, 0.05);
  border-color: var(--accent-cyan);
  box-shadow: inset 0 0 8px rgba(0, 240, 255, 0.1);
}

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

.asset-name {
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  font-weight: bold;
}

.asset-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-unknown {
  background-color: rgba(136, 146, 176, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(136, 146, 176, 0.25);
}

.badge-vulnerable {
  background-color: rgba(255, 77, 77, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(255, 77, 77, 0.3);
  animation: pulse-red 1.5s infinite alternate;
}

.badge-secure {
  background-color: rgba(57, 255, 20, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(57, 255, 20, 0.3);
}

.asset-type {
  font-size: 11px;
  color: var(--text-muted);
}

/* Center Workspace Area */
.center-workspace {
  display: flex;
  flex-direction: column;
  background-color: rgba(10, 14, 23, 0.5);
  overflow-y: auto;
  position: relative;
}

/* Scan Loading Overlay */
.scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(10, 14, 23, 0.95);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 20;
  gap: 20px;
}

.scan-radar {
  width: 120px;
  height: 120px;
  border: 2px solid var(--accent-cyan);
  border-radius: 50%;
  position: relative;
  animation: spin 3s linear infinite;
  box-shadow: var(--border-glow);
}

.scan-radar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 50%;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.5), transparent);
  border-radius: 100% 0 0 0;
  transform-origin: 100% 100%;
}

.scanner-text {
  font-family: 'Share Tech Mono', monospace;
  color: var(--accent-cyan);
  font-size: 16px;
  letter-spacing: 2px;
  text-shadow: var(--border-glow);
}

.scanner-progress-bar {
  width: 300px;
  height: 4px;
  background-color: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.scanner-progress-fill {
  height: 100%;
  width: 0%;
  background-color: var(--accent-cyan);
  box-shadow: var(--border-glow);
  transition: width 0.1s linear;
}

/* Welcome Panel styling */
.welcome-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 1;
  text-align: center;
  padding: 40px;
  gap: 20px;
}

.welcome-icon {
  font-size: 64px;
  color: var(--accent-cyan);
  text-shadow: var(--border-glow);
  opacity: 0.8;
}

.welcome-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 28px;
  color: var(--text-main);
}

.welcome-desc {
  max-width: 500px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Dashboard detail panel */
.vuln-detail-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px;
  gap: 20px;
}

.vuln-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

.vuln-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.severity-badge {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: bold;
}

.sev-high {
  background-color: rgba(255, 77, 77, 0.2);
  color: var(--accent-red);
  border: 1px solid var(--accent-red);
}

.sev-medium {
  background-color: rgba(255, 183, 3, 0.2);
  color: var(--accent-orange);
  border: 1px solid var(--accent-orange);
}

.cve-id {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
}

.vuln-desc-card {
  background-color: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 16px;
}

.card-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.vuln-desc-text {
  font-size: 14px;
  line-height: 1.6;
}

/* Remediation Sandbox */
.remediation-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sandbox-area {
  background-color: #05080f;
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 6px;
  padding: 20px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

/* Code Editor view */
.code-editor {
  font-family: 'Fira Code', monospace;
  font-size: 13px;
  color: #a6accd;
  line-height: 1.6;
  overflow-x: auto;
}

.code-line {
  display: flex;
  gap: 12px;
  padding: 2px 4px;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.code-line:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.code-line.vulnerable-line {
  background-color: rgba(255, 77, 77, 0.06);
  border-left: 2px solid var(--accent-red);
}

.code-line.vulnerable-line:hover {
  background-color: rgba(255, 77, 77, 0.12);
}

.code-line.selected-line {
  background-color: rgba(0, 240, 255, 0.1) !important;
  border-left: 2px solid var(--accent-cyan) !important;
}

.line-num {
  width: 20px;
  text-align: right;
  color: #4b526d;
  user-select: none;
}

.code-content {
  white-space: pre;
}

/* UI Interactive Forms */
.sandbox-ui {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ui-description {
  font-size: 13px;
  color: var(--text-muted);
}

.config-toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.config-card {
  background-color: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.2s ease;
}

.config-card:hover {
  border-color: rgba(0, 240, 255, 0.2);
}

.config-label {
  font-size: 13px;
  font-weight: bold;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-tertiary);
  transition: .4s;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: rgba(57, 255, 20, 0.2);
  border-color: var(--accent-green);
}

input:checked + .slider:before {
  transform: translateX(22px);
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.patch-selector-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.patch-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background-color: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.patch-option:hover {
  background-color: var(--bg-tertiary);
  border-color: rgba(0, 240, 255, 0.25);
}

.patch-option input[type="radio"] {
  accent-color: var(--accent-cyan);
}

.patch-option-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.patch-version {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  font-weight: bold;
}

.patch-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.sandbox-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 16px;
  margin-top: 12px;
}

.btn-action {
  padding: 8px 18px;
  border-radius: 4px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
}

.btn-secondary:hover {
  border-color: var(--text-main);
  color: var(--text-main);
}

.btn-primary {
  background-color: rgba(0, 240, 255, 0.1);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: var(--border-glow);
}

.btn-primary:hover:not(:disabled) {
  background-color: rgba(0, 240, 255, 0.2);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Terminal Log Console */
.terminal-console {
  background-color: #03050a;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 12px 16px;
  font-family: 'Fira Code', monospace;
  font-size: 12px;
  height: 120px;
  overflow-y: auto;
  color: #8892b0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.terminal-line {
  line-height: 1.4;
  white-space: pre-wrap;
}

.term-cmd {
  color: var(--accent-cyan);
}

.term-success {
  color: var(--accent-green);
}

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

.term-info {
  color: var(--accent-orange);
}

/* Right Sidebar - Reference / Study Panel */
.reference-sidebar {
  background-color: rgba(18, 24, 36, 0.6);
  border-left: 1px solid var(--border-color);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.reference-card {
  background-color: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ref-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-cyan);
  border-bottom: 1px solid rgba(0, 240, 255, 0.08);
  padding-bottom: 6px;
}

.ref-term {
  font-weight: bold;
  font-size: 12px;
  color: var(--text-main);
  margin-top: 4px;
}

.ref-definition {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* System-Wide Animations */
@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse-glow {
  0% {
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.2);
  }
  100% {
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.6);
  }
}

@keyframes pulse-red {
  0% {
    box-shadow: 0 0 2px rgba(255, 77, 77, 0.1);
  }
  100% {
    box-shadow: 0 0 10px rgba(255, 77, 77, 0.3);
  }
}

/* Remediation Diff styles */
.remediation-explanation {
  font-size: 13px;
  line-height: 1.6;
  margin-top: 10px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
  padding: 14px;
  border-radius: 6px;
  border-left: 3px solid var(--accent-cyan);
}

.diff-box {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: 'Fira Code', monospace;
  font-size: 12px;
}

.diff-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.diff-line-item {
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.diff-before {
  background-color: rgba(255, 77, 77, 0.1);
  border-left: 3px solid var(--accent-red);
  padding: 8px 12px;
  color: #ff9999;
  white-space: pre-wrap;
}

.diff-after {
  background-color: rgba(57, 255, 20, 0.08);
  border-left: 3px solid var(--accent-green);
  padding: 8px 12px;
  color: #b3ffa6;
  white-space: pre-wrap;
}
