/* ============================================
   VYBORD STUDIO — MAIN STYLES
   ============================================ */

:root {
  --bg: #0D0F16;
  --surface: #161A24;
  --surface-2: #1C2130;
  --surface-3: #252A3A;
  --border: #2A2F3D;
  --border-light: #363D50;
  --text: #F0F2F5;
  --text-muted: #8B92A5;
  --text-dim: #5A6175;
  --accent: #F7C144;
  --accent-dim: #C99A2E;
  --accent-bg: rgba(247, 193, 68, 0.12);
  --indigo: #6366F1;
  --indigo-bg: rgba(99, 102, 241, 0.12);
  --success: #22C55E;
  --success-bg: rgba(34, 197, 94, 0.12);
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --error: #EF4444;
  --error-bg: rgba(239, 68, 68, 0.12);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --transition: 150ms ease;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

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

a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: var(--font); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* Utilities */
.hidden { display: none !important; }

/* ============================================
   TOP NAVIGATION
   ============================================ */
#top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  gap: 24px;
}

.nav-left { display: flex; align-items: center; gap: 32px; }
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 16px; color: var(--text);
  letter-spacing: -0.3px;
}
.nav-logo svg { flex-shrink: 0; }
.nav-logo-sub { color: var(--text-muted); font-weight: 500; font-size: 13px; }

.nav-links { display: flex; gap: 4px; }
.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--accent); }

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

.credit-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  background: var(--accent-bg);
  border: 1px solid rgba(247,193,68,0.25);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: background var(--transition);
}
.credit-badge:hover { background: rgba(247,193,68,0.2); }

.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
  position: relative;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--error);
  display: none;
}
.notif-dot.show { display: block; }

.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: background var(--transition);
}
.user-btn:hover { background: var(--surface-2); }
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
#user-name { font-size: 13px; font-weight: 500; }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  min-width: 180px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
}
.user-dropdown a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.user-dropdown a:hover { background: var(--surface-3); color: var(--text); }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 0; }

/* ============================================
   MAIN LAYOUT
   ============================================ */
#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 32px;
  margin-top: 56px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-header h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.page-subtitle { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.page-header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
}
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }
.btn-primary {
  background: var(--accent);
  color: #0D0F16;
}
.btn-primary:hover { background: var(--accent-dim); }
.btn-secondary { background: var(--surface-3); color: var(--text); }
.btn-secondary:hover { background: var(--border); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--error-bg); color: var(--error); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-row { display: flex; gap: 8px; margin-top: 16px; }
.btn-row .btn { flex: 1; }

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.3px; text-transform: uppercase; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="tel"],
select,
textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(247,193,68,0.15);
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-row-2 + .form-row-2,
.form-row-3 + .form-row-3,
.form-group + .form-group { margin-top: 12px; }

.form-error {
  background: var(--error-bg);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--error);
}
.form-hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.form-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--text-dim); font-size: 12px; }
.form-divider::before, .form-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.url-input-row { display: flex; gap: 8px; }
.url-input-row input { flex: 1; }

/* Range slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  border: none;
  padding: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: var(--shadow-sm);
}
.slider-row { display: flex; align-items: center; gap: 10px; }
.slider-row input[type="range"] { flex: 1; }
.slider-row span { font-size: 12px; font-family: var(--mono); color: var(--text-muted); min-width: 36px; text-align: right; }

/* Color input */
input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  padding: 2px;
}

/* ============================================
   SEARCH BOX
   ============================================ */
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  transition: border-color var(--transition);
}
.search-box:focus-within { border-color: var(--accent); }
.search-box svg { color: var(--text-dim); flex-shrink: 0; }
.search-box input {
  background: none;
  border: none;
  box-shadow: none;
  padding: 7px 0;
  width: 220px;
  font-size: 13px;
}
.search-box input:focus { box-shadow: none; }

/* ============================================
   MODAL
   ============================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.modal-content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
  width: 90%;
  max-width: 560px;
}

/* ============================================
   TOAST
   ============================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  pointer-events: auto;
  animation: toastIn 200ms ease;
  max-width: 340px;
}
.toast.success { border-color: rgba(34,197,94,0.4); }
.toast.error { border-color: rgba(239,68,68,0.4); }
.toast.warning { border-color: rgba(245,158,11,0.4); }
.toast-icon { flex-shrink: 0; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--error); }
.toast.warning .toast-icon { color: var(--warning); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
