/* ==========================================================================
   WELCOME STARTING SCREEN STYLES
   ========================================================================== */

.welcome-screen-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.98));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.welcome-screen-overlay.active {
  opacity: 1;
  visibility: visible;
}

.welcome-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 620px;
  width: 100%;
  padding: 3rem 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.welcome-icon-box {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--accent-primary), #818cf8);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.75rem;
  color: white;
  box-shadow: var(--shadow-glow);
}

.welcome-card h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.welcome-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 480px;
}

.welcome-features-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
  text-align: left;
  margin: 0.5rem 0;
}

.feature-pill {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.welcome-select-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

.btn-start-fresh {
  width: 100%;
  padding: 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
  box-shadow: var(--shadow-glow);
}

/* Base Resets & Colors from main design system */
:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.8);
  --bg-glass: rgba(15, 23, 42, 0.75);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-light: rgba(99, 102, 241, 0.15);
  
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --info: #0ea5e9;

  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(248, 250, 252, 0.85);
  --border-color: rgba(0, 0, 0, 0.08);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
}

[data-theme="pastel"] {
  --bg-primary: #faf5ef;
  --bg-secondary: #fffaf3;
  --bg-tertiary: #f3e9dc;
  --bg-card: rgba(255, 250, 243, 0.9);
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(250, 245, 239, 0.85);
  --border-color: rgba(184, 150, 120, 0.15);
  --text-primary: #3d2c29;
  --text-secondary: #705851;
  --text-muted: #a48c84;
  --accent-primary: #d97706;
}

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

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 72px 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar main";
  min-height: 100vh;
}

.app-sidebar {
  grid-area: sidebar;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 20;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem 1.5rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent-primary), #818cf8);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 1.25rem;
  box-shadow: var(--shadow-glow);
}

.brand-text h1 { font-size: 1.15rem; font-weight: 700; }
.brand-text p { font-size: 0.75rem; color: var(--text-muted); }

.nav-menu {
  display: flex; flex-direction: column; gap: 0.4rem; margin-top: 1.5rem;
}

.nav-btn {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.75rem 1rem; border-radius: var(--radius-md);
  border: none; background: transparent; color: var(--text-secondary);
  font-family: inherit; font-size: 0.925rem; font-weight: 600; cursor: pointer;
  transition: all var(--transition-fast); text-align: left; width: 100%;
}

.nav-btn:hover { background-color: var(--bg-tertiary); color: var(--text-primary); }
.nav-btn.active {
  background: linear-gradient(90deg, var(--accent-light), transparent);
  color: var(--accent-primary); border-left: 3px solid var(--accent-primary);
}

.nav-badge {
  margin-left: auto; background-color: var(--accent-primary);
  color: white; font-size: 0.725rem; font-weight: 700;
  padding: 0.15rem 0.5rem; border-radius: var(--radius-full);
}

.sidebar-footer { padding-top: 1rem; border-top: 1px solid var(--border-color); }
.preset-card { background: var(--bg-tertiary); border-radius: var(--radius-md); padding: 0.85rem; margin-bottom: 1rem; }
.preset-card h4 { font-size: 0.8rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.5rem; }
.preset-select { width: 100%; padding: 0.5rem; background-color: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-sm); color: var(--text-primary); font-family: inherit; font-size: 0.85rem; cursor: pointer; }

.app-header {
  grid-area: header; background-color: var(--bg-glass); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color); padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 15;
}

.header-title-group h2 { font-size: 1.35rem; font-weight: 700; }
.header-title-group p { font-size: 0.825rem; color: var(--text-secondary); }
.header-actions { display: flex; align-items: center; gap: 1rem; }

.theme-toggle-group { display: flex; background: var(--bg-tertiary); border-radius: var(--radius-full); padding: 3px; }
.theme-btn { border: none; background: transparent; color: var(--text-secondary); padding: 0.4rem 0.75rem; border-radius: var(--radius-full); font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.theme-btn.active { background: var(--bg-secondary); color: var(--text-primary); box-shadow: var(--shadow-sm); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
  color: white; border: none; padding: 0.65rem 1.25rem; border-radius: var(--radius-md);
  font-family: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer;
  display: flex; align-items: center; gap: 0.5rem; transition: all var(--transition-fast);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background-color: var(--bg-tertiary); color: var(--text-primary);
  border: 1px solid var(--border-color); padding: 0.65rem 1rem; border-radius: var(--radius-md);
  font-family: inherit; font-weight: 600; font-size: 0.875rem; cursor: pointer;
  display: flex; align-items: center; gap: 0.5rem; transition: all var(--transition-fast);
}

.btn-icon-only { padding: 0.65rem; border-radius: var(--radius-md); }

.app-main { grid-area: main; padding: 2rem; overflow-y: auto; max-width: 1600px; width: 100%; margin: 0 auto; }
.view-section { display: none; animation: fadeIn 0.3s ease-out forwards; }
.view-section.active { display: block; }

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

.card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.5rem; backdrop-filter: blur(8px); }
.pill-tag { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.65rem; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600; }

.modal-overlay { position: fixed; inset: 0; background-color: rgba(0, 0, 0, 0.65); backdrop-filter: blur(6px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1.5rem; opacity: 0; visibility: hidden; transition: all var(--transition-fast); }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-container { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); width: 100%; max-width: 520px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; }
.modal-close-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 0.25rem; font-size: 1.2rem; }
.modal-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.15rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.825rem; font-weight: 600; color: var(--text-secondary); }
.form-input, .form-select, .form-textarea { width: 100%; padding: 0.65rem 0.85rem; background-color: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: var(--radius-md); color: var(--text-primary); font-family: inherit; font-size: 0.9rem; }
.form-select option { background-color: var(--bg-secondary); color: var(--text-primary); font-family: inherit; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 0.75rem; background-color: rgba(0, 0, 0, 0.1); }
