@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Orbitron:wght@400;500;600;700&family=Barlow+Condensed:wght@300;400;500;600;700&display=swap');

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

:root {
  --bg: #080a0c;
  --surface: #0b0e12;
  --panel: rgba(10, 14, 18, 0.92);
  --border: rgba(150, 224, 235, 0.14);
  --border-dim: rgba(150, 224, 235, 0.07);
  --cyan: #96E0EB;
  --cyan-mid: #4ea8b8;
  --cyan-dim: rgba(150, 224, 235, 0.503);
  --cyan-glow: rgba(150, 224, 235, 0.1);
  --orange: #e85d3a;
  --orange-dim: rgba(232, 93, 58, 0.12);
  --text: #7aa0ae;
  --text-dim: #5589a0;
  --text-bright: #daf0f6;
  --white: #daf0f6;
  --status-up: #3ddc84;
  --status-down: #e85d3a;
  --status-warn: #f5a623;
  --mono: 'Share Tech Mono', monospace;
  --display: 'Orbitron', sans-serif;
  --ui: 'Barlow Condensed', sans-serif;
}

/* === THEME: RED === */
[data-theme="red"] {
  --bg: #060a10;
  --surface: #0a1018;
  --panel: rgba(10, 16, 24, 0.92);
  --border: rgba(255, 120, 40, 0.14);
  --border-dim: rgba(255, 120, 40, 0.07);
  --cyan: #ff6a20;
  --cyan-mid: #c85010;
  --cyan-dim: rgba(255, 106, 32, 0.5);
  --cyan-glow: rgba(255, 106, 32, 0.1);
  --orange: #ff6a20;
  --orange-dim: rgba(255, 106, 32, 0.12);
  --text: #607088;
  --text-dim: #405068;
  --text-bright: #c8d0dc;
  --white: #c8d0dc;
}

/* === THEME: GOLD === */
[data-theme="gold"] {
  --bg: #08080a;
  --surface: #0c0c0e;
  --panel: rgba(12, 12, 14, 0.92);
  --border: rgba(238, 182, 5, 0.16);
  --border-dim: rgba(238, 182, 5, 0.08);
  --cyan: #EEB605;
  --cyan-mid: #c89b04;
  --cyan-dim: rgba(238, 182, 5, 0.5);
  --cyan-glow: rgba(238, 182, 5, 0.1);
  --orange: #EEB605;
  --orange-dim: rgba(238, 182, 5, 0.12);
  --text: #a09880;
  --text-dim: #706850;
  --text-bright: #f0ece0;
  --white: #f0ece0;
}

html {
  font-size: 15px;
}

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

/* Scanlines */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.015) 2px,
    rgba(0, 0, 0, 0.015) 3px
  );
  pointer-events: none;
  z-index: 9998;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 45%,
    rgba(0, 0, 0, 0.35) 100%
  );
  pointer-events: none;
  z-index: 9997;
}

/* Layout */
.container {
  max-width: 1800px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.logo {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  font-family: var(--ui);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 16px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--cyan);
  border-color: var(--border);
}

/* Buttons */
.btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--cyan);
  padding: 6px 14px;
  font-family: var(--ui);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--cyan);
  background: var(--cyan-glow);
}

.btn-primary {
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-primary:hover {
  background: var(--cyan-glow);
  box-shadow: 0 0 16px var(--cyan-glow);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.55rem;
}

.btn-danger {
  border-color: var(--orange);
  color: var(--orange);
}

.btn-danger:hover {
  background: var(--orange-dim);
  border-color: var(--orange);
}

/* Cards */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 20px;
}

.card-header {
  font-family: var(--display);
  font-size: 1.1rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-dim);
}

/* Grid */
.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Status indicators */
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  position: relative;
}

.status-dot.up {
  background: var(--status-up);
  box-shadow: 0 0 10px var(--status-up);
}

.status-dot.down {
  background: var(--status-down);
  box-shadow: 0 0 10px var(--status-down);
  animation: pulse 1.5s infinite;
}

.status-dot.warn {
  background: var(--status-warn);
  box-shadow: 0 0 10px var(--status-warn);
}

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

/* Monitor item */
.monitor-item {
  background: var(--surface);
  border: 1px solid var(--border-dim);
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.2s;
}

.monitor-item:hover {
  border-color: var(--border);
}

.monitor-info {
  flex: 1;
}

.monitor-name {
  font-family: var(--ui);
  font-size: 1rem;
  color: var(--text-bright);
  margin-bottom: 5px;
  font-weight: 500;
}

.monitor-url {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-family: var(--mono);
}

.monitor-meta {
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 0.85rem;
}

.monitor-type {
  font-family: var(--ui);
  text-transform: uppercase;
  color: var(--cyan-dim);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.monitor-response {
  color: var(--text);
}

.monitor-actions {
  display: flex;
  gap: 10px;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

/* Custom checkbox */
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.form-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}

.form-check input[type="checkbox"]:checked {
  border-color: var(--cyan);
  background: var(--cyan-glow);
}

.form-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 4px;
  width: 4px;
  height: 7px;
  border-right: 1.5px solid var(--cyan);
  border-bottom: 1.5px solid var(--cyan);
  transform: rotate(45deg);
}

.form-check input[type="checkbox"]:focus {
  outline: none;
  border-color: var(--cyan);
}

.form-check span {
  font-family: var(--ui);
  font-size: 0.9rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-label {
  display: block;
  font-family: var(--ui);
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-dim);
  color: var(--text-bright);
  padding: 10px;
  font-family: var(--mono);
  font-size: 0.9rem;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 30000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--panel);
  border: 1px solid var(--border);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
}

.modal-header {
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-dim);
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-dim);
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-family: var(--display);
  font-size: 2.5rem;
  color: var(--cyan);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-family: var(--ui);
  font-size: 0.85rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Chart */
.chart-container {
  height: 200px;
  margin-top: 15px;
  position: relative;
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.hidden { display: none; }
