/* ============================================
   PORTFOLIO GENERATOR STYLES
   Using the same design system as the portfolio
   ============================================ */

:root {
  /* Warm Terracotta Color Palette - Light Mode */
  --color-primary: #C17B5F;
  --color-primary-dark: #A66248;
  --color-primary-light: #D4967D;

  --color-bg: #FAFAF8;
  --color-bg-secondary: #F5F5F3;
  --color-bg-tertiary: #EEEEE9;
  --color-bg-elevated: #FFFFFF;

  --color-text: #1A1A1A;
  --color-text-secondary: #6B6B6B;
  --color-text-tertiary: #888888;

  --color-border: #E8E6E3;
  --color-border-hover: #D8D6D3;

  --color-shadow: rgba(0, 0, 0, 0.06);
  --color-shadow-elevated: rgba(0, 0, 0, 0.1);

  --color-error: #C75050;
  --color-error-light: #FDF2F2;
  --color-success: #5A9A5A;
  --color-success-light: #F2FDF4;

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Arial", sans-serif;

  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Spacing */
  --space-4: 0.25rem;
  --space-6: 0.375rem;
  --space-8: 0.5rem;
  --space-12: 0.75rem;
  --space-16: 1rem;
  --space-20: 1.25rem;
  --space-24: 1.5rem;
  --space-32: 2rem;
  --space-40: 2.5rem;
  --space-48: 3rem;
  --space-64: 4rem;

  /* Layout */
  --max-width-form: 720px;
  --header-height: 48px;
  --strip-height: 28px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 8px 0 rgba(0, 0, 0, 0.08), 0 1px 4px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px 0 rgba(0, 0, 0, 0.1), 0 2px 8px 0 rgba(0, 0, 0, 0.06);

  /* Transitions */
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.2s var(--ease-out);
  --transition-base: 0.3s var(--ease-out);
}

/* Dark Mode */
[data-theme="dark"] {
  --color-primary: #D4967D;
  --color-primary-dark: #C17B5F;
  --color-primary-light: #E5B09A;

  --color-bg: #1A1A1A;
  --color-bg-secondary: #222222;
  --color-bg-tertiary: #2A2A2A;
  --color-bg-elevated: #252525;

  --color-text: #F5F4F2;
  --color-text-secondary: #A0A0A0;
  --color-text-tertiary: #777777;

  --color-border: #333333;
  --color-border-hover: #444444;

  --color-shadow: rgba(0, 0, 0, 0.3);
  --color-shadow-elevated: rgba(0, 0, 0, 0.5);

  --color-error: #E07070;
  --color-error-light: #2A2020;
  --color-success: #70B070;
  --color-success-light: #202A22;
}

/* ============================================
   RESET & BASE
   ============================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding: var(--space-24);
  padding-top: calc(var(--header-height) + var(--strip-height) + var(--space-24));
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

/* ============================================
   HEADER
   ============================================ */

.header {
  position: fixed;
  top: var(--strip-height);
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  transition: background-color var(--transition-base);
}

.nav {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--space-24);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.nav__brand:hover {
  opacity: 0.7;
}

/* Site Strip - Cross-site navigation */
.site-strip {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--strip-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  background-color: var(--color-bg-tertiary);
  border-bottom: 1px solid var(--color-border);
  z-index: 1001;
}

.site-strip__link {
  font-size: 12px;
  color: var(--color-text-tertiary);
  text-decoration: none;
}

.site-strip__link:hover {
  color: var(--color-text);
  text-decoration: underline;
}

.brand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  font-size: 14px;
  font-weight: var(--font-weight-bold);
  border-radius: 50%;
}

.brand-name {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-secondary);
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-12);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  border-radius: var(--radius-full);
  position: relative;
}

.theme-toggle:hover {
  color: var(--color-text);
  background-color: var(--color-bg-tertiary);
}

.theme-toggle__icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  position: relative;
}

.theme-toggle__icon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

[data-theme="dark"] .theme-toggle__icon::before {
  width: 14px;
  height: 14px;
  background: var(--color-bg);
  top: -2px;
  left: 6px;
  transform: none;
}

/* Tooltip */
@media (min-width: 769px) {
  .theme-toggle::after {
    content: 'Dark mode';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
  }

  [data-theme="dark"] .theme-toggle::after {
    content: 'Light mode';
  }

  .theme-toggle:hover::after {
    opacity: 1;
    visibility: visible;
  }
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  text-align: center;
  padding: var(--space-48) 0 var(--space-40);
  max-width: var(--max-width-form);
  margin: 0 auto;
}

.hero__title {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: var(--space-12);
  letter-spacing: -0.02em;
}

.hero__subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  max-width: 480px;
  margin: 0 auto;
}

/* ============================================
   FORM STYLES
   ============================================ */

.generator-form {
  max-width: var(--max-width-form);
  margin: 0 auto;
  padding-bottom: var(--space-64);
}

.form-section {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-32);
  margin-bottom: var(--space-24);
  transition: border-color var(--transition-fast);
}

.form-section:hover {
  border-color: var(--color-border-hover);
}

.form-section__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-24);
  padding-bottom: var(--space-12);
  border-bottom: 2px solid var(--color-primary);
  display: inline-block;
}

.form-section__hint {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
  margin-top: calc(var(--space-24) * -1);
  margin-bottom: var(--space-24);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-20);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.form-field--full {
  grid-column: 1 / -1;
  margin-top: var(--space-20);
}

.form-field label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

.required {
  color: var(--color-error);
}

.form-field input,
.form-field textarea {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-12) var(--space-16);
  font-size: var(--font-size-base);
  font-family: inherit;
  color: var(--color-text);
  transition: all var(--transition-fast);
  width: 100%;
  min-height: 44px;
}

.form-field textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--color-text-tertiary);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(193, 123, 95, 0.15);
}

[data-theme="dark"] .form-field input:focus,
[data-theme="dark"] .form-field textarea:focus {
  box-shadow: 0 0 0 3px rgba(212, 150, 125, 0.2);
}

/* Error state */
.form-field--error input,
.form-field--error textarea {
  border-color: var(--color-error);
  background-color: var(--color-error-light);
}

.form-field--error input:focus,
.form-field--error textarea:focus {
  box-shadow: 0 0 0 3px rgba(199, 80, 80, 0.15);
}

.form-field__error {
  font-size: var(--font-size-xs);
  color: var(--color-error);
  min-height: 16px;
  display: none;
}

.form-field--error .form-field__error {
  display: block;
}

.form-field__hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
}

/* ============================================
   DYNAMIC ENTRIES (Experience / Certifications)
   ============================================ */

.dynamic-entries {
  display: flex;
  flex-direction: column;
  gap: var(--space-20);
  margin-bottom: var(--space-24);
}

.entry-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-24);
  position: relative;
  transition: border-color var(--transition-fast);
}

.entry-card:hover {
  border-color: var(--color-border-hover);
}

.entry-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-20);
}

.entry-card__number {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
}

.entry-card__remove {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-8);
  color: var(--color-text-tertiary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: calc(var(--space-8) * -1);
}

.entry-card__remove:hover {
  color: var(--color-error);
  background: var(--color-error-light);
}

.entry-card .form-grid {
  margin-bottom: var(--space-16);
}

.entry-card .form-field--full {
  margin-top: 0;
}

/* ============================================
   THEME FIELD (Label above, full-width buttons)
   ============================================ */

.theme-field {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid #e8e6e3;
  scroll-margin-top: 100px;
}

[data-theme="dark"] .theme-field {
  border-bottom-color: var(--color-border);
}

.theme-field__label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 10px;
}

.theme-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.theme-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 8px;
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.theme-btn:hover {
  border-color: var(--color-border-hover);
  background: var(--color-bg-tertiary);
}

.theme-btn input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Each theme button uses its own accent color when selected */
.theme-btn[data-theme="minimal-light"]:has(input:checked) {
  border-color: #666666;
  background: rgba(102, 102, 102, 0.08);
}

.theme-btn[data-theme="forest"]:has(input:checked) {
  border-color: #5B8A72;
  background: rgba(91, 138, 114, 0.08);
}

.theme-btn[data-theme="warm"]:has(input:checked) {
  border-color: #C17B5F;
  background: rgba(193, 123, 95, 0.08);
}

.theme-btn[data-theme="cool"]:has(input:checked) {
  border-color: #4A7C9B;
  background: rgba(74, 124, 155, 0.08);
}

[data-theme="dark"] .theme-btn[data-theme="minimal-light"]:has(input:checked) {
  background: rgba(102, 102, 102, 0.15);
}

[data-theme="dark"] .theme-btn[data-theme="forest"]:has(input:checked) {
  background: rgba(91, 138, 114, 0.15);
}

[data-theme="dark"] .theme-btn[data-theme="warm"]:has(input:checked) {
  background: rgba(193, 123, 95, 0.15);
}

[data-theme="dark"] .theme-btn[data-theme="cool"]:has(input:checked) {
  background: rgba(74, 124, 155, 0.15);
}

.theme-btn__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

[data-theme="dark"] .theme-btn__dot {
  border-color: rgba(255, 255, 255, 0.15);
}

.theme-btn__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

/* Add spacing above Basic Info title after theme section */
.theme-field + .form-section__title {
  margin-top: 4px;
}

/* Mobile: 2x2 grid */
@media (max-width: 500px) {
  .theme-buttons {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .theme-btn {
    padding: 10px 8px;
  }

  .theme-btn__name {
    font-size: 13px;
  }
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-12) var(--space-20);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  font-family: inherit;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 44px;
  border: none;
}

.btn--primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  box-shadow: 0 2px 8px rgba(193, 123, 95, 0.3);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(193, 123, 95, 0.4);
}

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

.btn--secondary {
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.btn--secondary:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text);
  background: var(--color-bg-secondary);
}

.btn--add {
  width: 100%;
}

.btn--large {
  padding: var(--space-16) var(--space-32);
  font-size: var(--font-size-base);
  min-height: 52px;
}

/* ============================================
   FORM ACTIONS
   ============================================ */

.form-actions {
  text-align: center;
  padding: var(--space-32) 0;
}

.form-actions__buttons {
  display: flex;
  gap: var(--space-16);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-16);
}

.form-actions__theme-reminder {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
}

.form-actions__theme-reminder span {
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
}

.change-theme-link {
  color: var(--color-text-tertiary);
  text-decoration: none;
  margin-left: var(--space-8);
  font-size: var(--font-size-xs);
}

.change-theme-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.form-actions__hint {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

@media (max-width: 500px) {
  .form-actions__buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions__buttons .btn {
    width: 100%;
  }
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  background-color: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
  padding: var(--space-24);
  margin-top: auto;
}

.footer__content {
  max-width: var(--max-width-form);
  margin: 0 auto;
  text-align: center;
}

.footer__text {
  color: var(--color-text-tertiary);
  font-size: var(--font-size-sm);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast {
  position: fixed;
  bottom: var(--space-24);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: var(--space-12) var(--space-24);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

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

.toast--success {
  background: var(--color-success-light);
  border-color: var(--color-success);
  color: var(--color-success);
}

.toast--error {
  background: var(--color-error-light);
  border-color: var(--color-error);
  color: var(--color-error);
}

/* ============================================
   FOCUS STATES
   ============================================ */

*:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ============================================
   ANIMATIONS
   ============================================ */

.hero__title,
.hero__subtitle,
.form-section {
  animation: fadeInUp 0.5s var(--ease-out) both;
}

.hero__title { animation-delay: 0.1s; }
.hero__subtitle { animation-delay: 0.2s; }
.form-section:nth-child(1) { animation-delay: 0.3s; }
.form-section:nth-child(2) { animation-delay: 0.35s; }
.form-section:nth-child(3) { animation-delay: 0.4s; }
.form-section:nth-child(4) { animation-delay: 0.45s; }
.form-section:nth-child(5) { animation-delay: 0.5s; }
.form-section:nth-child(6) { animation-delay: 0.55s; }
.form-section:nth-child(7) { animation-delay: 0.6s; }

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

@media (prefers-reduced-motion: reduce) {
  .hero__title,
  .hero__subtitle,
  .form-section {
    animation: none;
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  main {
    padding: var(--space-16);
    padding-top: calc(var(--header-height) + var(--strip-height) + var(--space-16));
  }

  .nav {
    padding: 0 var(--space-16);
  }

  .hero {
    padding: var(--space-32) 0 var(--space-24);
  }

  .hero__title {
    font-size: var(--font-size-2xl);
  }

  .hero__subtitle {
    font-size: var(--font-size-base);
  }

  .form-section {
    padding: var(--space-24);
  }

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

  .theme-selector {
    grid-template-columns: repeat(2, 1fr);
  }

  .toast {
    left: var(--space-16);
    right: var(--space-16);
    transform: translateX(0) translateY(100px);
  }

  .toast.show {
    transform: translateX(0) translateY(0);
  }
}

@media (max-width: 400px) {
  .theme-selector {
    grid-template-columns: 1fr;
  }
}
