/* ============================================
   FIELDPULSE — Generator Page Stylesheet
   ============================================ */

/* ---- NAV ---- */
.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 60px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-2);
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 100px;
}

/* ---- GENERATOR LAYOUT ---- */
.generator-section {
  min-height: calc(100vh - 65px);
  padding: 60px;
  background: var(--bg);
}

.generator-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

/* ---- FORM PANEL ---- */
.gen-form-panel {
  position: sticky;
  top: 85px;
}

.gen-form-header {
  margin-bottom: 48px;
}

.gen-headline {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(56px, 6vw, 80px);
  line-height: 0.92;
  letter-spacing: 0.01em;
  color: var(--white);
  margin-bottom: 20px;
}

.gen-sub {
  font-size: 16px;
  color: var(--fg-2);
  line-height: 1.7;
  max-width: 420px;
}

.gen-form {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

/* ---- FORM GROUPS ---- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-2);
}

/* ---- SELECTOR GRID ---- */
.selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.selector-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  text-align: center;
  color: var(--fg);
}

.selector-btn:hover {
  border-color: var(--accent-border);
  background: var(--bg-3);
}

.selector-btn.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.selector-icon {
  font-size: 22px;
  line-height: 1;
}

.selector-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
}

.selector-desc {
  font-size: 11px;
  color: var(--fg-2);
  line-height: 1.3;
}

.selector-btn.active .selector-name {
  color: var(--accent);
}

/* ---- GENERATE BUTTON ---- */
.gen-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 28px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.gen-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.gen-btn:not(:disabled):hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.btn-icon {
  font-size: 20px;
}

/* ---- OUTPUT PANEL ---- */
.gen-output-panel {
  min-height: 400px;
  border-radius: var(--radius);
}

/* Empty / Loading / Error states */
.output-empty,
.output-loading,
.output-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 40px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  min-height: 360px;
}

.empty-icon { margin-bottom: 8px; }

.empty-text {
  font-size: 15px;
  color: var(--fg-2);
  line-height: 1.7;
}

/* Loading spinner */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
}

.loading-sub {
  font-size: 13px;
  color: var(--fg-2);
}

/* Error */
.error-icon { font-size: 32px; }

.error-text {
  font-size: 15px;
  color: var(--fg-2);
}

.error-retry {
  margin-top: 8px;
  padding: 10px 24px;
  background: transparent;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.error-retry:hover {
  background: var(--accent-dim);
}

/* ---- PLAN OUTPUT ---- */
.output-plan {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.plan-header {
  padding: 32px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: none;
}

.plan-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.plan-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  padding: 4px 12px;
  border-radius: 100px;
}

.plan-tag-level {
  color: var(--fg-2);
  background: var(--bg-3);
  border-color: var(--border);
}

.plan-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  color: var(--white);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.plan-summary {
  font-size: 14px;
  color: var(--fg-2);
  line-height: 1.65;
}

/* Day cards */
.plan-days {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.plan-day {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-top: none;
  padding: 0;
}

.plan-day-recovery {
  background: var(--bg-3);
}

.day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.day-number-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.day-icon {
  font-size: 20px;
  line-height: 1;
}

.day-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
}

.day-focus {
  font-size: 12px;
  color: var(--accent);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.day-duration {
  font-size: 12px;
  color: var(--fg-2);
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.day-drills {
  padding: 12px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Individual drill rows */
.drill-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.drill-row .drill-icon {
  width: 28px;
  height: 28px;
  background: var(--accent-dim);
  border-radius: 50%;
  border: 1px solid var(--accent-border);
  flex-shrink: 0;
  margin-top: 2px;
}

.drill-body {
  flex: 1;
}

.drill-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.drill-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

.drill-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.drill-stat {
  font-size: 11px;
  color: var(--fg-2);
}

.drill-dot {
  font-size: 11px;
  color: var(--border);
}

.drill-cue {
  font-size: 12px;
  color: var(--accent);
  font-style: italic;
  line-height: 1.5;
  opacity: 0.85;
}

/* Plan footer */
.plan-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}

.plan-footer > span {
  font-size: 11px;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.5;
}

.plan-new-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent-border);
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}

.plan-new-btn:hover {
  background: var(--accent-dim);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .generator-section {
    padding: 32px 24px;
  }

  .generator-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .gen-form-panel {
    position: static;
  }

  .app-nav {
    padding: 16px 24px;
  }

  .selector-grid {
    grid-template-columns: 1fr;
  }

  .drill-top {
    flex-direction: column;
    gap: 4px;
  }

  .plan-footer {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
