/* ============================================================
   Eager — "Precision Workshop" Design System
   Day 10 visual upgrade: more character, depth, and personality
   while keeping the same 4 screens and all existing functionality.
   ============================================================ */

:root {
  --color-violet: #7C3AED;
  --color-violet-dark: #5B21B6;
  --color-violet-light: #A78BFA;
  --color-violet-tint: #F3EEFE;
  --color-gold: #D97706;
  --color-bg: #F8FAFC;
  --color-surface: #FFFFFF;
  --color-text: #0F172A;
  --color-text-muted: #64748B;
  --color-border: #E2E8F0;
  --color-error: #DC2626;

  --gradient-primary: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 50%, #6D28D9 100%);
  --gradient-text: linear-gradient(135deg, #7C3AED 0%, #5B21B6 100%);

  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card-hover: 0 12px 28px rgba(124, 58, 237, 0.14), 0 4px 10px rgba(15, 23, 42, 0.06);
  --shadow-btn: 0 8px 20px rgba(124, 58, 237, 0.32);
  --shadow-btn-hover: 0 12px 28px rgba(91, 33, 182, 0.4);

  --font-heading: 'Hanken Grotesk', sans-serif;
  --font-body: 'Manrope', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Decorative ambient background blobs — fixed, behind all content, subtle.
   Gives the page real visual depth instead of a flat single color. */
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  z-index: -1;
  pointer-events: none;
}

body::before {
  width: 480px;
  height: 480px;
  top: -220px;
  right: -160px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.16) 0%, rgba(124, 58, 237, 0) 70%);
}

body::after {
  width: 420px;
  height: 420px;
  bottom: -200px;
  left: -160px;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.10) 0%, rgba(217, 119, 6, 0) 70%);
}

h1, h2, h3 {
  font-family: var(--font-heading);
  margin: 0;
}

#app {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  position: relative;
}

.loading-placeholder {
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 4rem;
}

/* Every screen fades/slides in on render — turns instant screen swaps
   into something that feels intentional rather than jarring. */
.screen {
  animation: screenIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ===== Top Bar ===== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 760px;
  margin: 0 auto 0.5rem;
  padding: 0.5rem 0.25rem;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.logo-btn {
  background: none;
  border: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.3rem;
  background-image: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  cursor: pointer;
  padding: 0.5rem 0;
  letter-spacing: -0.02em;
}

.favorites-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-muted);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.favorites-nav-btn:hover,
.favorites-nav-btn.active {
  border-color: var(--color-violet);
  color: var(--color-violet-dark);
  transform: translateY(-1px);
}

.star-icon-sm {
  color: var(--color-gold);
}

.fav-count {
  background: var(--gradient-primary);
  color: #fff;
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  font-weight: 700;
}

/* ===== Shared ===== */
.app-title {
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background-image: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-top: 1rem;
}

.app-title-sm {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.app-subtitle {
  color: var(--color-text-muted);
  margin: 0.6rem 0 2.5rem;
  font-size: 1.1rem;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 1rem 1.85rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.02rem;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-btn);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.btn-primary:hover {
  box-shadow: var(--shadow-btn-hover);
  transform: translateY(-2px) scale(1.01);
}

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

.btn-arrow {
  font-size: 1.15rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(3px);
}

.btn-link {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
}

.btn-link:hover {
  color: var(--color-violet);
}

.btn-link:disabled,
.icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.back-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 1.25rem;
}

/* ===== Input Form ===== */
.input-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 22px;
  padding: 2rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.input-form::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.08) 0%, rgba(124, 58, 237, 0) 70%);
  pointer-events: none;
}

.form-group {
  border: none;
  padding: 0;
  margin: 0;
}

.form-group legend {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
  padding: 0;
  letter-spacing: -0.01em;
}

.radio-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.radio-option,
.checkbox-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  padding: 0.75rem 1.15rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.radio-option:hover,
.checkbox-option:hover {
  border-color: var(--color-violet-light);
  transform: translateY(-1px);
}

.radio-option input,
.checkbox-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 0.68rem;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.radio-option:has(input:checked),
.checkbox-option:has(input:checked) {
  border-color: var(--color-violet);
  background: var(--color-violet-tint);
  box-shadow: 0 0 0 1px var(--color-violet), 0 4px 12px rgba(124, 58, 237, 0.15);
}

.radio-option:has(input:checked) .check-icon,
.checkbox-option:has(input:checked) .check-icon {
  opacity: 1;
  transform: scale(1);
}

.radio-option:has(input:focus-visible),
.checkbox-option:has(input:focus-visible) {
  outline: 2px solid var(--color-violet);
  outline-offset: 2px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.65rem;
}

.time-row {
  display: flex;
  gap: 1rem;
}

.number-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-muted);
  flex: 1;
}

.number-field input {
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  transition: border-color 0.15s ease;
}

.number-field input:focus {
  outline: none;
  border-color: var(--color-violet);
  box-shadow: 0 0 0 3px var(--color-violet-tint);
}

.field-error {
  color: var(--color-error);
  font-size: 0.85rem;
  margin-top: 0.6rem;
  font-weight: 700;
}

/* ===== Idea List ===== */
.results-count {
  color: var(--color-text-muted);
  margin: 0.5rem 0 0.5rem;
  font-weight: 700;
  font-size: 1rem;
}

.results-note {
  background: var(--color-violet-tint);
  border-left: 3px solid var(--color-violet);
  padding: 0.75rem 1.1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--color-violet-dark);
  margin: 0 0 1.5rem;
  font-weight: 600;
}

.idea-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.idea-card-wrap {
  position: relative;
}

.idea-card {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-violet);
  border-radius: 16px;
  padding: 1.3rem 1.4rem;
  padding-right: 3.5rem;
  text-align: left;
  cursor: pointer;
  color: var(--color-text);
  font-family: var(--font-body);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease, transform 0.15s ease, border-left-color 0.15s ease;
}

.idea-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}

.domain-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.7rem;
  font-weight: 700;
}

.domain-web { background: #EDE9FE; color: #5B21B6; }
.domain-mobile { background: #DBEAFE; color: #1D4ED8; }
.domain-ai { background: #FCE7F3; color: #BE185D; }
.domain-dsa { background: #FEF3C7; color: #B45309; }

.idea-title {
  font-size: 1.12rem;
  margin-bottom: 0.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.idea-hook {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  margin: 0 0 0.6rem;
  line-height: 1.5;
}

.idea-meta {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  margin: 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.star-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--color-text-muted);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  z-index: 2;
}

.star-btn:hover {
  border-color: var(--color-gold);
  transform: scale(1.12) rotate(-8deg);
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.2);
}

.star-btn.favorited {
  color: var(--color-gold);
  border-color: var(--color-gold);
  background: #FFFBEB;
}

/* ===== Empty States ===== */
.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--color-surface);
  border: 1.5px dashed var(--color-border);
  border-radius: 20px;
}

.empty-state-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}

.empty-state-text {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  margin: 0;
}

/* ===== Loading ===== */
.loading-screen,
.error-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 4rem;
  gap: 1.1rem;
}

.spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-primary);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
  animation: spin 0.9s linear infinite;
}

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

.loading-text {
  color: var(--color-text-muted);
  font-size: 0.98rem;
  font-weight: 600;
}

.error-text {
  color: var(--color-error);
  font-size: 0.95rem;
  max-width: 420px;
  font-weight: 600;
}

.error-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  max-width: 280px;
}

/* ===== Detail Screen ===== */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.detail-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.icon-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-muted);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--color-violet);
  color: var(--color-violet-dark);
  transform: translateY(-1px);
}

.star-btn-lg.favorited {
  color: var(--color-gold);
  border-color: var(--color-gold);
  background: #FFFBEB;
}

.detail-title {
  font-size: 2rem;
  margin: 0.85rem 0 0.5rem;
  letter-spacing: -0.02em;
}

.detail-hook {
  color: var(--color-text-muted);
  margin: 0 0 2rem;
  font-size: 1.05rem;
}

.detail-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 1.65rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease;
}

.detail-section:hover {
  box-shadow: var(--shadow-card-hover);
}

.detail-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--color-violet-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-subheading {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 1rem 0 0.5rem;
}

.detail-subheading:first-of-type {
  margin-top: 0;
}

.feature-list {
  margin: 0;
  padding-left: 1.3rem;
  color: var(--color-text);
  font-size: 0.94rem;
  line-height: 1.7;
}

.feature-list li::marker {
  color: var(--color-violet);
}

.folder-structure {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  background: #0F172A;
  color: #E2E8F0;
  border-radius: 12px;
  padding: 1.15rem;
  overflow-x: auto;
  white-space: pre;
  margin: 0;
  line-height: 1.6;
}

.roadmap-list {
  margin: 0;
  padding-left: 1.3rem;
  font-size: 0.94rem;
  line-height: 1.8;
}

.roadmap-list li::marker {
  color: var(--color-violet);
  font-weight: 700;
}

.resume-box {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  background: var(--color-violet-tint);
  border-radius: 12px;
  padding: 1rem 1.15rem;
}

.resume-box p {
  margin: 0;
  font-size: 0.94rem;
  font-style: italic;
  color: var(--color-violet-dark);
  font-weight: 500;
}

.resume-box .btn-link {
  flex-shrink: 0;
  font-weight: 700;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--color-text);
  color: var(--color-surface);
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 30;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Site Footer ===== */
.site-footer {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  padding: 2rem 1rem 2.25rem;
  border-top: 1px solid var(--color-border);
  margin-top: 1.5rem;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Accessibility: focus rings ===== */
.idea-card:focus-visible,
.btn-primary:focus-visible,
.btn-link:focus-visible,
.icon-btn:focus-visible,
.star-btn:focus-visible,
.logo-btn:focus-visible,
.favorites-nav-btn:focus-visible {
  outline: 2px solid var(--color-violet);
  outline-offset: 2px;
}

/* ===== 404 page button helper (inline style override) ===== */
.not-found-screen .btn-primary {
  width: auto;
}

/* ===== Responsive ===== */
@media (max-width: 420px) {
  .app-title { font-size: 2.1rem; }
  .checkbox-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  .detail-header {
    flex-direction: column;
  }
  .detail-actions {
    align-self: flex-start;
  }
  .time-row {
    flex-direction: column;
  }
  .input-form {
    padding: 1.5rem;
  }
  body::before, body::after {
    width: 280px;
    height: 280px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
