/* ==========================================================================
   ResumeCrafted - Main Design System & Base CSS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;1,400&display=swap');

:root {
  /* Color Palette - Default Dark App Theme */
  --bg-app: #0f172a;
  --bg-app-alt: #0b1120;
  --bg-surface: #1e293b;
  --bg-surface-hover: #334155;
  --bg-surface-active: #475569;
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-color-strong: rgba(255, 255, 255, 0.2);
  
  /* Primary & Accent Colors */
  --primary: #38bdf8;
  --primary-hover: #0284c7;
  --primary-glow: rgba(56, 189, 248, 0.25);
  
  --accent-spark: #f43f5e;
  --accent-spark-glow: rgba(244, 63, 94, 0.25);
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-purple: #a855f7;
  
  /* Text Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Translucent & UI Overlays */
  --header-bg: rgba(15, 23, 42, 0.85);
  --modal-backdrop-bg: rgba(15, 23, 42, 0.8);
  --preview-grid-dot: rgba(255, 255, 255, 0.05);
  
  /* Resume Paper Defaults */
  --paper-bg: #ffffff;
  --paper-text: #1e293b;
  --paper-heading: #0f172a;
  --paper-accent: #2563eb;
  --paper-font-main: 'Inter', sans-serif;
  --paper-font-heading: 'Outfit', sans-serif;
  
  /* Layout Dimensions */
  --header-height: 64px;
  --editor-width: 480px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  /* Transitions & Shadows */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 30px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px var(--primary-glow);
}

/* ==========================================================================
   WHITE / LIGHT THEME OVERRIDES
   ========================================================================== */
[data-theme="light"] {
  /* Color Palette - White App Theme */
  --bg-app: #f8fafc;
  --bg-app-alt: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f1f5f9;
  --bg-surface-active: #e2e8f0;

  --border-color: #e2e8f0;
  --border-color-strong: #cbd5e1;

  /* Primary & Accent Colors for Light BG */
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-glow: rgba(2, 132, 199, 0.2);

  --accent-spark: #e11d48;
  --accent-spark-glow: rgba(225, 29, 72, 0.2);
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-purple: #9333ea;

  /* High Contrast Text Colors */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  /* Translucent & UI Overlays */
  --header-bg: rgba(255, 255, 255, 0.9);
  --modal-backdrop-bg: rgba(15, 23, 42, 0.4);
  --preview-grid-dot: rgba(15, 23, 42, 0.07);

  /* Soft Ambient Shadows for Light Mode */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 20px rgba(2, 132, 199, 0.15);
}

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

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app-alt);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-surface-active);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* Application Container Layout */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.workspace {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  flex: 1 1 auto;
  height: calc(100vh - var(--header-height));
  width: 100vw;
  max-width: 100vw;
  overflow: hidden;
  position: relative;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE SYSTEM
   ========================================================================== */

/* Mobile View Mode Switcher Toggle Bar */
.mobile-view-toggle {
  display: none;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 6px 12px;
  gap: 8px;
  justify-content: center;
  align-items: center;
  z-index: 100;
  width: 100%;
}

.mobile-toggle-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mobile-toggle-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary-hover);
  box-shadow: 0 2px 8px var(--primary-glow);
}

.mobile-toggle-btn svg {
  stroke: currentColor;
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
  }
  
  :root {
    --header-height: 56px;
  }

  .mobile-view-toggle {
    display: flex;
  }

  .workspace {
    flex-direction: column;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
  }

  /* Header Controls & Horizontal Slider */
  .top-bar {
    padding: 0 0.5rem !important;
    gap: 8px !important;
    overflow: hidden !important; /* Prevents the entire top bar / logo from sliding */
    width: 100vw !important;
    max-width: 100vw !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .brand {
    font-size: 0.95rem !important;
    gap: 4px !important;
    flex-shrink: 0 !important; /* Logo NEVER slides or shrinks */
    position: relative !important;
    z-index: 10 !important;
  }

  .brand-icon {
    width: 26px !important;
    height: 26px !important;
  }

  /* Horizontal touch slider ONLY for header action buttons */
  .header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    justify-content: flex-end !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important;  /* IE/Edge */
    padding: 2px 0 !important;
  }

  .header-actions::-webkit-scrollbar {
    display: none !important; /* Hide scrollbar for clean touch swipe */
  }

  #ats-score-badge {
    padding: 3px 8px !important;
    font-size: 0.72rem !important;
    flex-shrink: 0 !important;
  }

  #ats-score-badge span {
    display: none !important;
  }

  .header-actions .btn span {
    display: none !important;
  }

  .header-actions .btn {
    padding: 4px 6px !important;
    min-width: 32px !important;
    height: 32px !important;
    font-size: 0.75rem !important;
    flex-shrink: 0 !important;
  }

  .header-actions .btn {
    padding: 4px 6px !important;
    min-width: 32px !important;
    height: 32px !important;
    font-size: 0.75rem !important;
  }

  #user-chip-name {
    display: none !important;
  }

  .user-chip-btn {
    padding: 3px !important;
  }
}

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  color: var(--text-main);
  font-weight: 600;
}

/* Utility Classes */
.text-spark {
  background: linear-gradient(135deg, #38bdf8 0%, #f43f5e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .text-spark {
  background: linear-gradient(135deg, #0284c7 0%, #e11d48 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

