/**
 * CodeTM - Pure White & Slate Gray Minimalist Theme
 * Ultra-Sleek Single-Bar SaaS Navigation, Monospace Typography, High Contrast, Centered Workspace.
 */

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

:root {
  /* Surface Colors */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-elevated: #ffffff;
  --bg-input: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-active: #e2e8f0;
  
  /* Borders */
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-dark: #94a3b8;
  --border-focus: #0f172a;
  
  /* Text & Typography */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-dark: #020617;

  /* Accent Colors */
  --accent-primary: #0f172a;
  --accent-primary-hover: #1e293b;
  --accent-blue: #2563eb;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #dc2626;

  /* Difficulties */
  --diff-easy: #059669;
  --diff-medium: #d97706;
  --diff-hard: #dc2626;
  
  /* Monospace Typography as Primary Font */
  --font-sans: 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace;
  --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace;

  /* Sizing */
  --font-size-xs: 11.5px;
  --font-size-sm: 13px;
  --font-size-base: 14px;
  --font-size-md: 15.5px;
  --font-size-lg: 17.5px;
  --font-size-xl: 21px;
  --font-size-2xl: 25px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.02);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: 1.6;
  min-height: 100vh;
  width: 100%;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  background-color: #f8fafc !important;
}

/* ==========================================================================
   Unified Top Navigation Header
   ========================================================================== */
.app-header {
  height: 56px;
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.4px;
  color: #0f172a !important;
}

.brand-logo .logo-mark {
  width: 28px;
  height: 28px;
  background: #0f172a !important;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff !important;
  font-size: 13px;
}

.brand-logo .logo-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 4px;
  color: #475569 !important;
}

.header-divider {
  width: 1px;
  height: 22px;
  background: #e2e8f0;
}

/* Inline Modern Nav Tabs */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
}

.nav-item {
  background: transparent !important;
  border: none !important;
  padding: 6px 12px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: #64748b !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}

.nav-item i {
  font-size: 13px;
  color: #64748b;
  transition: color 0.15s ease;
}

.nav-item:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.nav-item:hover i {
  color: #0f172a;
}

.nav-item.active {
  background: #0f172a !important;
  color: #ffffff !important;
}

.nav-item.active i {
  color: #ffffff !important;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Action Buttons */
.btn {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  line-height: 1;
}

.btn-primary {
  background: #0f172a !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
}

.btn-primary:hover {
  background: #1e293b !important;
  border-color: #1e293b !important;
}

.btn-secondary {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

.btn-secondary:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
}

.btn-sm {
  font-size: 12px;
  padding: 5px 10px;
}

/* Primary Action: Throw a Problem */
.btn-throw {
  background: #0f172a !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
}

.btn-throw i {
  transition: transform 0.4s ease;
}

.roulette-spin i {
  animation: rouletteSpin 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes rouletteSpin {
  0% { transform: rotate(0deg); }
  50% { transform: scale(1.05) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}

/* Header Streak Pill */
.streak-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 5px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 5px;
}

.streak-pill i {
  color: #f59e0b;
  font-size: 11px;
}

/* Header Auth Pill */
.auth-pill-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 5px 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #0f172a;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.auth-pill-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.guest-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #059669;
}

/* ==========================================================================
   Main Workspace Container (Comfortable Max Width & Balanced Centering)
   ========================================================================== */
.main-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 40px;
  background-color: #f8fafc !important;
  width: 100%;
}

.tab-pane {
  display: none;
  padding: 24px 20px;
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
  animation: fadeIn 0.15s ease-in-out;
}

.tab-pane.active {
  display: block;
}

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

/* Common Pills & Badges */
.diff-pill {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
}

.diff-easy {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.diff-medium {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.diff-hard {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.category-pill, .score-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  color: #475569;
}

.tag-chip, .company-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.company-chip {
  font-weight: 600;
  color: #0f172a;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-message {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideInUp 0.25s ease forwards;
  pointer-events: auto;
}

.toast-info {
  background: #0f172a;
  color: #ffffff;
}

.toast-success {
  background: #047857;
  color: #ffffff;
}

.toast-error {
  background: #b91c1c;
  color: #ffffff;
}

.toast-fadeout {
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s ease;
}

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