/* ─────────────────────────────────────────────────────────────
   SSH Web Manager - Global Styles
   Dark professional theme with glassmorphism
───────────────────────────────────────────────────────────────── */

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

/* ── CSS Custom Properties ──────────────────────────────────── */
:root {
  /* Brand palette */
  --bg-primary:    #0d1117;
  --bg-secondary:  #161b22;
  --bg-tertiary:   #21262d;
  --bg-glass:      rgba(22, 27, 34, 0.85);

  /* Accent colors */
  --accent-blue:   #388bfd;
  --accent-teal:   #00b4d8;
  --accent-green:  #3fb950;
  --accent-orange: #d29922;
  --accent-red:    #f85149;
  --accent-purple: #bc8cff;

  /* Text */
  --text-primary:  #e6edf3;
  --text-secondary:#8b949e;
  --text-muted:    #484f58;

  /* Borders */
  --border-default: #30363d;
  --border-muted:   #21262d;

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #388bfd 0%, #00b4d8 100%);
  --gradient-bg:    radial-gradient(ellipse at top left, #1a2332 0%, #0d1117 60%);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;

  /* Spacing */
  --radius-sm:  6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-std:  250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background: var(--gradient-bg);
  background-attachment: fixed;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Scrollbars ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Glass Card ─────────────────────────────────────────────── */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 0 20px rgba(56, 139, 253, 0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(56, 139, 253, 0.4);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}
.btn-ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.btn-danger {
  background: rgba(248, 81, 73, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(248, 81, 73, 0.3);
}
.btn-danger:hover {
  background: rgba(248, 81, 73, 0.25);
}

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon {
  padding: 6px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
}
.btn-icon:hover { background: var(--bg-tertiary); color: var(--text-primary); }

/* ── Form elements ──────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-control {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 10px 14px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  width: 100%;
}
.form-control:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(56, 139, 253, 0.2);
}
.form-control::placeholder { color: var(--text-muted); }

.form-control-mono { font-family: var(--font-mono); font-size: 12px; }

/* ── Badge ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}
.badge-green { background: rgba(63,185,80,0.15); color: var(--accent-green); }
.badge-blue  { background: rgba(56,139,253,0.15); color: var(--accent-blue); }
.badge-orange{ background: rgba(210,153,34,0.15); color: var(--accent-orange); }
.badge-red   { background: rgba(248,81,73,0.15);  color: var(--accent-red); }

/* ── Spinner ────────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast notifications ────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-size: 13px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: slideIn 0.25s ease;
  min-width: 260px;
  max-width: 400px;
}
.toast.success { border-color: var(--accent-green); }
.toast.error   { border-color: var(--accent-red); }
.toast.info    { border-color: var(--accent-blue); }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInOverlay 0.2s ease;
}
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: min(90vw, 480px);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: slideUp 0.25s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-body  { display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ── Context menu ───────────────────────────────────────────── */
.context-menu {
  position: fixed;
  z-index: 2000;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 4px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  min-width: 180px;
  animation: scaleIn 0.15s ease;
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  transition: background var(--transition-fast);
}
.context-menu-item:hover { background: var(--bg-tertiary); }
.context-menu-item.danger { color: var(--accent-red); }
.context-menu-item.danger:hover { background: rgba(248,81,73,0.1); }
.context-menu-separator {
  height: 1px;
  background: var(--border-default);
  margin: 4px 0;
}

/* ── Drag and drop overlay ──────────────────────────────────── */
.drop-overlay {
  position: absolute; inset: 0;
  background: rgba(56, 139, 253, 0.1);
  border: 2px dashed var(--accent-blue);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  font-size: 16px;
  font-weight: 500;
  color: var(--accent-blue);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.drop-overlay.visible { opacity: 1; }

/* ── Utility classes ────────────────────────────────────────── */
.hidden { display: none !important; }
.flex   { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-secondary); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-mono { font-family: var(--font-mono); }
