/* assets/style.css */

:root {
  --brand: #FF5A5F;
  --brand-2: #E0484D;
  --accent: #FF7B50;
  --bg: #F8F9FB;
  --surface: #FFFFFF;
  --text: #1E293B;
  --muted: #64748B;
  --border: #E2E8F0;
  --radius-1: 8px;
  --radius-2: 12px;
  --radius-3: 16px;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-2: 0 4px 12px rgba(0,0,0,0.06);
  --font-sans: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Segoe UI', system-ui, sans-serif;
  --container: 1200px;
  --space-4: 32px;
  --space-5: 40px;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: 2rem;
  --step-4: 2.5rem;
  --step-5: 3rem;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-4);
}
a {
  color: inherit;
  text-decoration: none;
}
ul {
  list-style: none;
}
fieldset {
  border: none;
}
img {
  max-width: 100%;
  display: block;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-2);
  font-weight: 600;
  font-size: var(--step-0);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font-family: inherit;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn-ghost {
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--muted);
}
.btn-brand {
  background: var(--brand);
  color: #fff;
  border: none;
}
.btn-brand:hover {
  background: var(--brand-2);
  box-shadow: var(--shadow-2);
}
.btn-outline {
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(255,90,95,0.05);
}
.btn-accent {
  background: var(--accent);
  color: #fff;
  border: none;
}
.btn-accent:hover {
  background: #e66a3e;
  box-shadow: var(--shadow-2);
}
.add-btn {
  margin-top: 12px;
  font-size: 0.9rem;
  padding: 8px 16px;
}
.section-title {
  font-size: var(--step-2);
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
.badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  color: #fff;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

/* Header */
.header {
  padding: 20px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.85);
}
.header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-size: var(--step-3);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.logo-accent {
  color: var(--brand);
}
.nav {
  display: flex;
  gap: 12px;
}

/* Hero */
.hero {
  padding: 80px 0 40px;
}
.hero__card {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  border-radius: var(--radius-3);
  padding: 64px 56px;
  color: #fff;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.2);
}
.hero__card::after {
  content: '';
  position: absolute;
  right: -20px;
  top: -20px;
  width: 300px;
  height: 300px;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  pointer-events: none;
}
.hero__card h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.1;
  font-weight: 800;
  max-width: 600px;
  margin-bottom: 24px;
}
.hero__text {
  font-size: var(--step-1);
  max-width: 500px;
  opacity: 0.9;
  margin-bottom: 32px;
  line-height: 1.6;
}

/* Builder */
.builder {
  padding: 40px 0 80px;
}
.builder__layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 40px;
  align-items: start;
}
.builder__sidebar {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.template-thumb {
  aspect-ratio: 1 / 1.414;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s ease;
  position: relative;
}
.template-thumb:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.template-thumb.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand);
}
.template-thumb__inner {
  transform: scale(0.32);
  transform-origin: top left;
  width: 312.5%;
  height: 312.5%;
  pointer-events: none;
}
.template-thumb__inner .resume {
  padding: 10px !important;
  font-size: 8px !important;
  width: 100%;
  height: 100%;
}

/* Resume form */
.resume-form {
  background: var(--surface);
  border-radius: var(--radius-3);
  padding: 32px 28px;
  border: 1px solid var(--border);
}
.form-group {
  margin-bottom: 28px;
}
.form-group:last-child {
  margin-bottom: 0;
}
.form-legend {
  font-weight: 700;
  font-size: var(--step-1);
  margin-bottom: 16px;
  color: var(--text);
}
.field {
  margin-bottom: 16px;
}
.field__label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}
.field__input, .field__textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-1);
  font-size: var(--step-0);
  font-family: inherit;
  transition: border-color 0.2s ease;
  background: var(--bg);
  color: var(--text);
}
.field__input:focus, .field__textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(255,90,95,0.15);
}
.field__file {
  font-size: 0.9rem;
}
.photo-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-top: 8px;
  border: 2px solid var(--border);
}
.field__hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}
.experience-item, .education-item, .language-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
}
.remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.remove-btn:hover {
  color: var(--brand);
}

/* Preview */
.builder__preview {
  position: sticky;
  top: 100px;
}
.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.preview-title {
  font-size: var(--step-2);
  font-weight: 700;
}
.preview-container {
  background: #E0E4E9;
  border-radius: var(--radius-3);
  padding: 32px;
  display: flex;
  justify-content: center;
  border: 1px solid var(--border);
}
.resume-preview {
  width: 100%;
  max-width: 794px;
  background: #fff;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  border-radius: 8px;
  overflow: hidden;
}
.resume-preview .resume {
  width: 100%;
  min-height: 1123px;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}

/* Footer */
.footer {
  padding: 32px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

/* ============ RESUME TEMPLATES ============ */
.resume {
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #333;
  background: #fff;
  --resume-font: 'Segoe UI', system-ui, sans-serif;
  --resume-accent: #2563EB;
  --resume-heading-color: #111;
  --resume-bg: #fff;
  --resume-sidebar-bg: #F8FAFC;
  --resume-border: #E2E8F0;
  padding: 40px 48px;
}
.resume * {
  box-sizing: border-box;
}
.resume__header {
  margin-bottom: 24px;
}
.resume__name {
  font-size: 2rem;
  font-weight: 700;
  color: var(--resume-heading-color);
  line-height: 1.2;
}
.resume__title {
  font-size: 1.1rem;
  color: var(--resume-accent);
  font-weight: 500;
  margin-top: 4px;
}
.resume__contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  font-size: 0.9rem;
  color: #555;
}
.resume__contacts a {
  color: inherit;
  text-decoration: underline;
}
.resume__photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 20px;
}
.resume__summary {
  margin-bottom: 24px;
  font-size: 0.95rem;
  color: #444;
  line-height: 1.6;
}
.resume__section-title {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--resume-heading-color);
  border-bottom: 2px solid var(--resume-accent);
  padding-bottom: 4px;
  margin-bottom: 16px;
  margin-top: 28px;
}
.resume__experience-item, .resume__education-item {
  margin-bottom: 18px;
}
.resume__item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.resume__item-title {
  font-weight: 600;
  font-size: 0.95rem;
}
.resume__item-sub {
  color: #555;
  font-size: 0.9rem;
}
.resume__item-date {
  font-size: 0.85rem;
  color: #777;
  white-space: nowrap;
}
.resume__item-desc {
  font-size: 0.9rem;
  color: #555;
  margin-top: 4px;
  line-height: 1.5;
}
.resume__skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.resume__skill-tag {
  background: var(--resume-accent);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}
.resume__languages-list {
  list-style: none;
  padding: 0;
}
.resume__language-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--resume-border);
  font-size: 0.9rem;
}

/* --- Template 1: Minimal Classic --- */
.template-1 .resume {
  --resume-accent: #2563EB;
  --resume-heading-color: #0F172A;
  --resume-border: #CBD5E1;
}

/* --- Template 2: Sidebar Professional (border-left effect) --- */
.template-2 .resume {
  --resume-accent: #0D9488;
  --resume-heading-color: #115e59;
  border-left: 40px solid #CCFBF1;
  padding-left: 24px;
}
.template-2 .resume__section-title {
  border-bottom: none;
  border-left: 3px solid var(--resume-accent);
  padding-left: 8px;
}

/* --- Template 3: Creative --- */
.template-3 .resume {
  --resume-accent: #D946EF;
  --resume-heading-color: #4A044E;
  background: #FAFAFF;
}
.template-3 .resume__header {
  background: linear-gradient(90deg, #F5D0FE, #FBCFE8);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
}
.template-3 .resume__skill-tag {
  background: #F5D0FE;
  color: #86198F;
}

/* --- Template 4: Tech Mono --- */
.template-4 .resume {
  --resume-font: 'Consolas', 'Courier New', monospace;
  font-family: var(--resume-font);
  --resume-accent: #10B981;
  --resume-heading-color: #064E3B;
  background: #0F172A;
  color: #F8FAFC;
}
.template-4 .resume__header,
.template-4 .resume__contacts,
.template-4 .resume__summary,
.template-4 .resume__item-desc {
  color: #CBD5E1;
}
.template-4 .resume__section-title {
  color: #34D399;
  border-bottom-color: #34D399;
}
.template-4 .resume__skill-tag {
  background: #064E3B;
  color: #A7F3D0;
}

/* --- Template 5: Timeline --- */
.template-5 .resume {
  --resume-accent: #F59E0B;
  --resume-heading-color: #78350F;
}
.template-5 .resume__experience-item,
.template-5 .resume__education-item {
  position: relative;
  padding-left: 24px;
  margin-left: 12px;
  border-left: 2px solid var(--resume-accent);
}
.template-5 .resume__item-date {
  position: absolute;
  left: -80px;
  top: 0;
  width: 60px;
  text-align: right;
}

/* --- Template 6: Infographic (flat bars) --- */
.template-6 .resume {
  --resume-accent: #6366F1;
  --resume-heading-color: #1E1B4B;
}
.template-6 .resume__skills-list {
  flex-direction: column;
  gap: 8px;
}
.template-6 .resume__skill-tag {
  width: 100%;
  display: flex;
  justify-content: space-between;
  background: #E0E7FF;
  color: #4338CA;
  font-weight: 600;
  border-radius: 6px;
}

/* --- Template 7: Magazine (two columns) --- */
.template-7 .resume {
  --resume-accent: #EA580C;
  --resume-heading-color: #431407;
  column-count: 2;
  column-gap: 32px;
}
.template-7 .resume__header {
  column-span: all;
  margin-bottom: 24px;
}
.template-7 .resume__section-title {
  column-span: all;
  margin-top: 28px;
}

/* --- Template 8: Dark Elegant --- */
.template-8 .resume {
  --resume-accent: #D4AF37;
  --resume-heading-color: #F5F5F5;
  background: #1A1A1A;
  color: #E0E0E0;
}
.template-8 .resume__contacts,
.template-8 .resume__item-desc,
.template-8 .resume__summary {
  color: #A0A0A0;
}
.template-8 .resume__section-title {
  color: #D4AF37;
  border-bottom-color: #D4AF37;
}
.template-8 .resume__skill-tag {
  background: #D4AF37;
  color: #1A1A1A;
}

/* --- Template 9: Grid Modern --- */
.template-9 .resume {
  --resume-accent: #0EA5E9;
  --resume-heading-color: #0C4A6E;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto;
  gap: 20px;
  padding: 40px;
}
.template-9 .resume__header {
  grid-column: 1 / -1;
}
.template-9 .resume__summary {
  grid-column: 1 / -1;
}
.template-9 .resume__section-title {
  margin-top: 0;
}
.template-9 .resume__experience {
  grid-column: 1;
}
.template-9 .resume__education {
  grid-column: 2;
}
.template-9 .resume__skills,
.template-9 .resume__languages {
  grid-column: span 1;
}

/* --- Template 10: Corporate Blue --- */
.template-10 .resume {
  --resume-accent: #1E40AF;
  --resume-heading-color: #1E3A8A;
  border-top: 4px solid #1E40AF;
  border-bottom: 4px solid #1E40AF;
  padding: 32px 48px;
}
.template-10 .resume__section-title {
  font-size: 1rem;
  letter-spacing: 0.1em;
  border-bottom: 1px solid #BFDBFE;
}
.template-10 .resume__skill-tag {
  background: #DBEAFE;
  color: #1E40AF;
  border-radius: 0;
}

/* ===== PRINT STYLES ===== */
@media print {
  body * {
    visibility: hidden;
  }
  .builder,
  .header,
  .footer,
  .hero {
    display: none;
  }
  #resume-preview,
  .resume-preview * {
    visibility: visible;
  }
  .resume-preview {
    position: absolute;
    left: 0;
    top: 0;
    width: 210mm;
    height: auto;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
  }
  .resume-preview .resume {
    min-height: 0;
    padding: 15mm;
  }
  .preview-container {
    padding: 0;
    background: none;
    border: none;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .builder__layout {
    grid-template-columns: 1fr;
  }
  .builder__sidebar {
    order: 1;
  }
  .builder__preview {
    order: 0;
    position: static;
  }
}
@media (max-width: 600px) {
  .hero__card {
    padding: 40px 24px;
  }
  .container {
    padding: 0 20px;
  }
}