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

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Colors */
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --primary-glow: rgba(14, 165, 233, 0.2);
  --secondary: #38bdf8;
  --accent: #f472b6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Backgrounds */
  --bg-root: #f4f7fb;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-glass: rgba(255, 255, 255, 0.7);
  --bg-glass-border: rgba(0, 0, 0, 0.06);
  --bg-input: rgba(14, 165, 233, 0.03);

  /* Text */
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-accent: #0284c7;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
  --grad-card: linear-gradient(145deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,1) 100%);
  --grad-hero: radial-gradient(ellipse at 50% 0%, rgba(14,165,233,0.1) 0%, transparent 70%);
  --grad-sidebar: linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);

  /* Borders */
  --border: rgba(0, 0, 0, 0.06);
  --border-active: rgba(14, 165, 233, 0.5);
  --border-radius: 12px;
  --border-radius-lg: 20px;
  --border-radius-xl: 28px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 30px rgba(14, 165, 233, 0.15);
  --shadow-success-glow: 0 0 20px rgba(16, 185, 129, 0.15);

  /* Spacing */
  --sidebar-width: 300px;
  --header-height: 64px;

  /* Transitions */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-root);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 100vh;
  background: var(--grad-hero);
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-root); }
::-webkit-scrollbar-thumb {
  background: rgba(108, 99, 255, 0.4);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.25; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h2 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
h3 { font-size: 1.1rem; }

.gradient-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px; height: 36px;
  background: var(--grad-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-glow);
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-text span { color: var(--secondary); }

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.header-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}

.header-tab {
  padding: 6px 18px;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.header-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.2);
}

.header-tab:hover:not(.active) {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Main layout */
.main-layout {
  display: flex;
  flex: 1;
  min-height: calc(100vh - var(--header-height));
}

/* Content area */
.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px;
  gap: 24px;
}

/* ============================================================
   GLASS CARD BASE
   ============================================================ */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition);
}

.glass-card:hover {
  border-color: rgba(0,0,0,0.12);
  background: var(--bg-card-hover);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: none;
  transition: var(--transition-spring);
  white-space: nowrap;
  text-decoration: none;
}

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

.btn-primary {
  background: var(--grad-primary);
  color: white;
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(108, 99, 255, 0.5);
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.45);
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
  border-radius: 12px;
}

.btn-icon {
  padding: 8px;
  border-radius: 8px;
  width: 36px;
  height: 36px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ============================================================
   BADGE / TAG
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-primary {
  background: rgba(108, 99, 255, 0.15);
  color: var(--primary);
  border: 1px solid rgba(108, 99, 255, 0.25);
}

.badge-success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ============================================================
   TOOLTIPS
   ============================================================ */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 35, 0.95);
  color: #fff;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 0.75rem;
  white-space: nowrap;
  border: 1px solid var(--border);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 999;
}

[data-tooltip]:hover::after { opacity: 1; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(108, 99, 255, 0.2); }
  50%       { box-shadow: 0 0 40px rgba(108, 99, 255, 0.5); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes bounceIn {
  0%   { transform: scale(0.8); opacity: 0; }
  60%  { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes checkmark {
  0%   { stroke-dashoffset: 50; }
  100% { stroke-dashoffset: 0; }
}

.animate-fade-in    { animation: fadeIn 0.4s ease forwards; }
.animate-fade-up    { animation: fadeInUp 0.5s ease forwards; }
.animate-bounce-in  { animation: bounceIn 0.4s ease forwards; }

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(14, 165, 233, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ============================================================
   NOTIFICATION / TOAST
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(14, 14, 26, 0.95);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  backdrop-filter: blur(16px);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.3s ease;
  max-width: 340px;
}

.toast.success { border-color: rgba(16, 185, 129, 0.4); }
.toast.error   { border-color: rgba(239, 68, 68, 0.4); }
.toast.info    { border-color: rgba(14, 165, 233, 0.4); }

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ============================================================
   DISCLAIMER FOOTER
   ============================================================ */
.disclaimer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 16px 24px 24px;
  line-height: 1.7;
}

.disclaimer a {
  color: var(--primary);
  text-decoration: none;
}

.disclaimer a:hover { text-decoration: underline; }

/* ============================================================
   SECTION TITLES
   ============================================================ */
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.section-title h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-title .title-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================================
   SPEC GRID
   ============================================================ */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.spec-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.spec-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.spec-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.spec-item.highlight {
  border-color: rgba(108, 99, 255, 0.3);
  background: rgba(108, 99, 255, 0.06);
}

.spec-item.highlight .spec-value { color: var(--primary); }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.hidden  { display: none !important; }
.invisible { visibility: hidden; }
.flex    { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2   { gap: 8px; }
.gap-4   { gap: 16px; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.w-full  { width: 100%; }
.mt-2    { margin-top: 8px; }
.mt-4    { margin-top: 16px; }
.mb-4    { margin-bottom: 16px; }
.p-4     { padding: 16px; }
.rounded { border-radius: var(--border-radius); }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
