/* ==========================================================================
   BOLTOOLS DESIGN SYSTEM STYLESHEET
   100% Visually Synchronized with software/src/core/theme.py
   Option 3 Typography Standard: Instrument Sans + Satoshi + DM Mono
   Quiet, Minimal, Refined Raycast / Apple Aesthetic
   ========================================================================== */

@import url('https://api.fontshare.com/v2/css?f[]=satoshi@400,500,600,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=Instrument+Sans:ital,wght@0,400..700;1,400..700&display=swap');

:root {
  /* ── Layered Surface Palette (Exact Match: theme.py) ── */
  --surface-base: #0B0E14;        /* Window background canvas */
  --surface-sidebar: #0F131D;     /* Navigation panel & top header */
  --surface-card: #131824;        /* Primary content card */
  --surface-card-hover: #1A2234;  /* Hover interaction state */
  --surface-elevated: #1B2232;    /* Modals, toolbars, popovers */
  --surface-inset: #07090E;       /* Deep dropzones, terminal log */
  --surface-pill: #1C2436;        /* Micro-badges and domain tags */
  
  /* ── Hairline Borders & Dividers ── */
  --border-subtle: #1E2638;       /* Hairline 1px border */
  --border-hover: #2D3B55;        /* Card hover border highlight */
  --border-active: #005AE0;       /* Focused input border */
  --border-light: #151B29;        /* Minimal inner divider */

  /* ── Brand & Signature Accents ── */
  --brand-primary: #005AE0;       /* SurfBoard Signature Electric Blue */
  --brand-hover: #1268C0;         /* Button active/hover state */
  --brand-light: #0A254D;         /* Tinted brand badge background */
  --brand-accent: #38BDF8;        /* Sky cyan glow highlight in dark mode */
  --brand-glow: rgba(0, 90, 224, 0.22);

  /* ── Semantic Feedback Tokens ── */
  --status-success: #10B981;      /* Emerald */
  --status-success-bg: #064E3B;
  --status-warning: #F59E0B;      /* Amber */
  --status-warning-bg: #451A03;
  --status-error: #EF4444;        /* Red */
  --status-info: #38BDF8;

  /* ── High-Contrast Typography Palette ── */
  --text-primary: #F1F5F9;        /* Primary titles and body copy */
  --text-secondary: #94A3B8;      /* Subtitles and descriptions */
  --text-muted: #475569;          /* Micro-labels, shortcuts, hints */
  --text-on-brand: #FFFFFF;

  /* ── Corner Radii ── */
  --radius-input: 8px;
  --radius-button: 8px;
  --radius-card: 12px;
  --radius-pill: 20px;
  --radius-modal: 14px;
}

/* Base Document Reset */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--surface-base);
  color: var(--text-primary);
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Precision Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--surface-base);
}
::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* Subtle Engineering Grid Background */
.bg-tech-grid {
  background-image: 
    linear-gradient(to right, rgba(30, 38, 56, 0.25) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30, 38, 56, 0.25) 1px, transparent 1px);
  background-size: 32px 32px;
}

.radial-glow-top {
  background: radial-gradient(circle 900px at 50% -120px, rgba(0, 90, 224, 0.12), transparent 75%);
}

/* Hairline Cards (1px precision border) */
.hairline-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.hairline-card:hover {
  border-color: var(--border-hover);
  background-color: var(--surface-card-hover);
}

.hairline-card.active-card {
  border-color: var(--brand-primary);
  box-shadow: 0 0 24px rgba(0, 90, 224, 0.18);
}

/* Typography Helpers - Option 3 Mapping */
.font-display {
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -0.025em;
}

.font-body {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
}

.font-mono {
  font-family: 'DM Mono', monospace;
  letter-spacing: -0.01em;
}

/* Understated, Refined Tactile Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--brand-primary);
  color: var(--text-on-brand);
  font-family: 'Satoshi', sans-serif;
  font-weight: 500;
  border-radius: var(--radius-button);
  padding: 0.55rem 1.15rem;
  font-size: 0.8125rem;
  letter-spacing: -0.01em;
  transition: all 0.15s ease-in-out;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 10px var(--brand-glow);
}

.btn-primary:hover {
  background-color: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 90, 224, 0.32);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--surface-card);
  color: var(--text-primary);
  font-family: 'Satoshi', sans-serif;
  font-weight: 500;
  border-radius: var(--radius-button);
  padding: 0.55rem 1.15rem;
  font-size: 0.8125rem;
  letter-spacing: -0.01em;
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease-in-out;
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  background-color: var(--surface-card-hover);
  color: #FFFFFF;
}

/* Pill Badges matching software's SURFACE_PILL */
.badge-pill {
  background-color: var(--surface-pill);
  color: var(--brand-accent);
  border: 1px solid var(--border-subtle);
  font-family: 'DM Mono', monospace;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: 0.02em;
}

.badge-installed {
  background-color: rgba(16, 185, 129, 0.1);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.2);
  font-family: 'DM Mono', monospace;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-drop {
  background-color: rgba(56, 189, 248, 0.08);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.2);
  font-family: 'DM Mono', monospace;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ==========================================================================
   DESKTOP APP WINDOW IMMERSION FRAME (Mac / Linear 3-Pane Structure)
   ========================================================================== */
.desktop-app-frame {
  background-color: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: 
    0 25px 60px -15px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 35px rgba(0, 90, 224, 0.12);
  overflow: hidden;
}

.desktop-app-titlebar {
  background-color: #0A0D13;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.desktop-app-header {
  background-color: var(--surface-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  height: 56px;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.desktop-app-sidebar {
  background-color: var(--surface-sidebar);
  border-right: 1px solid var(--border-subtle);
  width: 230px;
  flex-shrink: 0;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sidebar-section-header {
  font-size: 0.625rem;
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  padding: 0.5rem 0.6rem 0.25rem 0.6rem;
}

.sidebar-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-button);
  font-size: 0.75rem;
  font-family: 'Satoshi', sans-serif;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.12s ease;
  text-align: left;
}

.sidebar-nav-btn:hover {
  background-color: var(--surface-card-hover);
  color: #FFFFFF;
}

.sidebar-nav-btn.active {
  background-color: var(--surface-card);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.terminal-box {
  background-color: var(--surface-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: #94A3B8;
  line-height: 1.5;
  padding: 0.875rem;
  max-height: 180px;
  overflow-y: auto;
}

/* Modals with Apple-grade Blur */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(4, 6, 10, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-modal);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 90, 224, 0.2);
  max-width: 640px;
  width: 100%;
  transform: scale(0.96);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-overlay.open .modal-content {
  transform: scale(1);
}

/* Live Pulse Beacon */
@keyframes beacon-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.live-beacon {
  animation: beacon-pulse 2s infinite;
}
