/* ============================================================
   STARGLIDER - System Configuration Terminal
   ------------------------------------------------------------
   Retro sci-fi aesthetic inspired by:
   - 1970s/80s CRT terminals
   - Classic sci-fi computer interfaces
   - Green phosphor displays
   ============================================================ */


/* ================= TOP BAR BUTTON ================= */

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

.top-bar-btn {
  background: transparent;
  border: 1px solid rgba(111, 227, 163, 0.3);
  color: #6fe3a3;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.top-bar-btn:hover {
  background: rgba(111, 227, 163, 0.15);
  border-color: #6fe3a3;
  box-shadow: 0 0 8px rgba(111, 227, 163, 0.4);
}

.top-bar-btn .btn-icon {
  font-size: 14px;
}


/* ================= MODAL OVERLAY ================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-overlay[hidden] {
  display: none;
}


/* ================= SETTINGS TERMINAL ================= */

.settings-terminal {
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  background: #0a0c10;
  border: 2px solid #1a3a2a;
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgba(111, 227, 163, 0.1),
    0 0 30px rgba(111, 227, 163, 0.15),
    inset 0 0 60px rgba(0, 20, 10, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* CRT scanline effect */
.settings-terminal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.1) 2px,
    rgba(0, 0, 0, 0.1) 4px
  );
  pointer-events: none;
  z-index: 10;
}

/* CRT flicker effect (subtle) */
.settings-terminal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(111, 227, 163, 0.02);
  pointer-events: none;
  animation: crt-flicker 0.1s infinite;
  z-index: 11;
}

@keyframes crt-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.98; }
}


/* ================= TERMINAL HEADER ================= */

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(180deg, #0f1a14 0%, #0a0c10 100%);
  border-bottom: 1px solid #1a3a2a;
}

.terminal-title {
  font-family: "SF Mono", "Monaco", "Consolas", monospace;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 3px;
  color: #6fe3a3;
  text-shadow: 0 0 10px rgba(111, 227, 163, 0.5);
}

.terminal-icon {
  margin-right: 8px;
  animation: terminal-pulse 2s ease-in-out infinite;
}

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

.terminal-blink {
  animation: blink 1s step-end infinite;
  margin-left: 4px;
}

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

.terminal-close {
  background: transparent;
  border: 1px solid #3a2020;
  color: #d94a4a;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
}

.terminal-close:hover {
  background: rgba(217, 74, 74, 0.2);
  border-color: #d94a4a;
  box-shadow: 0 0 8px rgba(217, 74, 74, 0.4);
}


/* ================= TERMINAL BODY ================= */

.terminal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* Scrollbar */
.terminal-body::-webkit-scrollbar {
  width: 8px;
}

.terminal-body::-webkit-scrollbar-track {
  background: #0a0c10;
}

.terminal-body::-webkit-scrollbar-thumb {
  background: #1a3a2a;
  border-radius: 4px;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
  background: #2a5a4a;
}


/* ================= CONFIG SECTIONS ================= */

.config-section {
  margin-bottom: 20px;
  padding: 12px;
  background: rgba(10, 30, 20, 0.3);
  border: 1px solid rgba(111, 227, 163, 0.1);
  border-radius: 4px;
}

.section-header {
  font-family: "SF Mono", "Monaco", "Consolas", monospace;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #6fe3a3;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(111, 227, 163, 0.2);
}

.section-indicator {
  color: #4a9a7a;
  margin-right: 6px;
  animation: indicator-blink 1.5s ease-in-out infinite;
}

@keyframes indicator-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}


/* ================= CONFIG ROWS ================= */

.config-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.config-row:last-child {
  margin-bottom: 0;
}

.config-label {
  font-family: "SF Mono", "Monaco", "Consolas", monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: #7f9f8f;
  text-align: right;
}

.config-input,
.config-select {
  font-family: "SF Mono", "Monaco", "Consolas", monospace;
  font-size: 13px;
  color: #6fe3a3;
  background: #050808;
  border: 1px solid #1a3a2a;
  border-radius: 3px;
  padding: 6px 10px;
  outline: none;
  transition: all 0.2s;
}

.config-input:focus,
.config-select:focus {
  border-color: #6fe3a3;
  box-shadow: 0 0 8px rgba(111, 227, 163, 0.3);
}

.config-input:hover,
.config-select:hover {
  border-color: #2a5a4a;
}

.config-input[readonly] {
  color: #4a7a6a;
  cursor: not-allowed;
}

.config-select {
  cursor: pointer;
}

.config-select option {
  background: #0a0c10;
  color: #6fe3a3;
}

.config-unit {
  font-family: "SF Mono", "Monaco", "Consolas", monospace;
  font-size: 10px;
  color: #5a7a6a;
  min-width: 50px;
}

/* Number input arrows */
.config-input[type="number"]::-webkit-inner-spin-button,
.config-input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.5;
}


/* ================= TERMINAL FOOTER ================= */

.terminal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(0deg, #0f1a14 0%, #0a0c10 100%);
  border-top: 1px solid #1a3a2a;
}

.terminal-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "SF Mono", "Monaco", "Consolas", monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: #5a7a6a;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3a3a3a;
}

.status-indicator.online {
  background: #6fe3a3;
  box-shadow: 0 0 6px rgba(111, 227, 163, 0.6);
  animation: status-pulse 2s ease-in-out infinite;
}

.status-indicator.saving {
  background: #f0ad4e;
  box-shadow: 0 0 6px rgba(240, 173, 78, 0.6);
  animation: status-pulse 0.5s ease-in-out infinite;
}

.status-indicator.error {
  background: #d94a4a;
  box-shadow: 0 0 6px rgba(217, 74, 74, 0.6);
}

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

.terminal-actions {
  display: flex;
  gap: 8px;
}

.terminal-btn {
  font-family: "SF Mono", "Monaco", "Consolas", monospace;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 2px;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;

  background: transparent;
  border: 1px solid #2a4a3a;
  color: #6fa383;
}

.terminal-btn:hover {
  background: rgba(111, 227, 163, 0.1);
  border-color: #4a7a6a;
}

.terminal-btn.primary {
  background: rgba(111, 227, 163, 0.15);
  border-color: #6fe3a3;
  color: #6fe3a3;
}

.terminal-btn.primary:hover {
  background: rgba(111, 227, 163, 0.25);
  box-shadow: 0 0 12px rgba(111, 227, 163, 0.3);
}


/* ================= RESPONSIVE ================= */

@media screen and (max-width: 600px) {
  .settings-terminal {
    width: 95%;
    max-height: 90vh;
  }

  .terminal-title {
    font-size: 12px;
    letter-spacing: 2px;
  }

  .config-row {
    grid-template-columns: 80px 1fr auto;
    gap: 8px;
  }

  .config-label {
    font-size: 9px;
  }

  .config-input,
  .config-select {
    font-size: 12px;
    padding: 5px 8px;
  }

  .config-unit {
    font-size: 9px;
    min-width: 40px;
  }

  .terminal-btn {
    font-size: 10px;
    padding: 6px 12px;
  }
}
