/* WebSSH UI Kit v2.0 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Colors */
  --bg: #0A0F14;
  --surface: #131A23;
  --surface-2: #0F1620;
  --border: #1F2933;

  --primary: #3B82F6;
  --primary-hover: #60A5FA;
  --primary-active: #2563EB;

  --text: #E6EDF3;
  --text-muted: #9AA4AE;
  --text-dim: #6B7280;

  --success: #22C55E;
  --error: #EF4444;
  --warning: #F59E0B;

  --terminal-bg: #05080C;
  --terminal-text: #22C55E;

  /* Spacing (4px base) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 32px;
  --space-4xl: 40px;

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

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-card: 0 4px 20px rgba(0,0,0,0.25);
  --shadow-hover: 0 6px 24px rgba(0,0,0,0.35);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea {
  font-family: inherit;
  border: none;
  outline: none;
  background: none;
}

/* Typography */
h1 { font-size: 28px; line-height: 36px; font-weight: 600; }
h2 { font-size: 22px; line-height: 30px; font-weight: 600; }
h3 { font-size: 18px; line-height: 26px; font-weight: 600; }

.text-body { font-size: 14px; line-height: 22px; }
.text-small { font-size: 12px; line-height: 18px; }
.text-mono { font-family: var(--font-mono); font-size: 13px; line-height: 20px; }

.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.15s ease-out;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Primary Button */
.btn-primary {
  height: 40px;
  padding: 0 var(--space-lg);
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:active {
  background: var(--primary-active);
}

/* Secondary Button */
.btn-secondary {
  height: 40px;
  padding: 0 var(--space-lg);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface-2);
}

/* Ghost Button */
.btn-ghost {
  height: 40px;
  padding: 0 var(--space-lg);
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--surface);
}

/* Mobile buttons */
@media (max-width: 768px) {
  .btn-primary, .btn-secondary, .btn-ghost {
    height: 52px;
    padding: 0 18px;
  }
}

/* Floating Button (Mobile) */
.btn-float {
  position: fixed;
  bottom: 20px;
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 24px;
  box-shadow: var(--shadow-hover);
  z-index: 100;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  gap: var(--space-md);
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease-out;
}

.card-title {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}

.card-desc {
  font-size: 13px;
  line-height: 20px;
  color: var(--text-muted);
}

.card-code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface-2);
  padding: 10px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  white-space: nowrap;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

/* Mobile card */
@media (max-width: 768px) {
  .card {
    gap: 14px;
  }
}

/* Terminal Block */
.terminal-block {
  background: var(--terminal-bg);
  color: var(--terminal-text);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 20px;
  overflow-x: auto;
  cursor: pointer;
  transition: all 0.15s ease-out;
}

.terminal-block:active {
  transform: scale(0.98);
}

/* Search */
.search {
  height: 44px;
  padding: 0 var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
  width: 100%;
  transition: all 0.15s ease-out;
}

.search::placeholder {
  color: var(--text-dim);
}

.search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}

@media (max-width: 768px) {
  .search {
    height: 52px;
  }
}

/* Header */
.header {
  height: 64px;
  padding: 0 var(--space-2xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 50;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 20px;
  font-weight: 600;
}

.header-logo svg {
  width: 32px;
  height: 32px;
  color: var(--primary);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

@media (max-width: 768px) {
  .header {
    height: 56px;
    padding: 0 var(--space-lg);
  }
  .header-logo span {
    display: none;
  }
}

/* Grid */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .grid { gap: var(--space-md); }
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-2xl);
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-lg);
  }
}

/* Section */
.section {
  padding: var(--space-3xl) 0;
}

.section-title {
  margin-bottom: var(--space-xl);
}

/* Form */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.form-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.form-input {
  height: 44px;
  padding: 0 var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}

.form-textarea {
  min-height: 120px;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
  resize: vertical;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success {
  background: rgba(34,197,94,0.15);
  color: var(--success);
}

.badge-error {
  background: rgba(239,68,68,0.15);
  color: var(--error);
}

.badge-warning {
  background: rgba(245,158,11,0.15);
  color: var(--warning);
}

.badge-primary {
  background: rgba(59,130,246,0.15);
  color: var(--primary);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all 0.18s ease-out;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  max-width: 480px;
  width: 90%;
  transform: translateY(20px);
  transition: all 0.18s ease-out;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

/* Bottom Sheet (Mobile) */
.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-lg);
  transform: translateY(100%);
  transition: transform 0.18s ease-out;
  z-index: 150;
}

.bottom-sheet.active {
  transform: translateY(0);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.animate-fade {
  animation: fadeIn 0.2s ease-out;
}

/* Utility */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.hidden { display: none; }

@media (max-width: 768px) {
  .hide-mobile { display: none; }
}

@media (min-width: 769px) {
  .show-mobile { display: none; }
}