@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #16161f;
  --bg-hover: #1e1e2a;
  --border: #2a2a3a;
  --text-primary: #e4e4ef;
  --text-secondary: #8888a0;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* Glass card */
.glass-card {
  background: rgba(22, 22, 31, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

/* Status indicators */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.running { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-dot.stopped { background: var(--danger); }
.status-dot.starting { background: var(--warning); animation: pulse 1s infinite; }

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

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #16a34a; }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Inputs */
.input {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--text-secondary); }

/* Select */
select.input { appearance: none; cursor: pointer; }

/* Badge */
.badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-socks { background: #6366f120; color: #818cf8; }
.badge-relay { background: #22c55e20; color: #22c55e; }
.badge-forward { background: #f59e0b20; color: #f59e0b; }

/* Table */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 12px 16px; color: var(--text-secondary); font-weight: 500; font-size: 13px; border-bottom: 1px solid var(--border); }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.table tr:hover td { background: var(--bg-hover); }

/* Toggle */
.toggle { position: relative; width: 44px; height: 24px; cursor: pointer; }
.toggle input { display: none; }
.toggle .slider { position: absolute; inset: 0; background: var(--border); border-radius: 24px; transition: 0.3s; }
.toggle .slider::before { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: white; top: 3px; left: 3px; transition: 0.3s; }
.toggle input:checked + .slider { background: var(--accent); }
.toggle input:checked + .slider::before { transform: translateX(20px); }

/* Sidebar */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
  font-size: 14px;
}
.sidebar-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-item.active { background: var(--accent); color: white; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: fadeIn 0.2s;
}
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  min-width: 420px;
  max-width: 560px;
  animation: slideUp 0.3s;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Log viewer */
.log-viewer {
  background: #0d0d12;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  height: 400px;
  overflow-y: auto;
  color: #a0a0b4;
}
.log-viewer .log-error { color: var(--danger); }
.log-viewer .log-warn { color: var(--warning); }
.log-viewer .log-info { color: var(--accent); }
