/* ResumeBana - Resume Builder Styles */
:root {
  --bg: #0f0f12;
  --surface: #18181c;
  --surface2: #222228;
  --text: #e8e6e3;
  --text-muted: #9a9896;
  --accent: #c9a227;
  --accent-soft: rgba(201, 162, 39, 0.15);
  --border: #2d2d34;
  --success: #2d8a5e;
  --radius: 10px;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* Header */
.site-header {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 1rem;
  text-align: center;
}

.logo {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

/* Main layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .container {
    grid-template-columns: 1fr 400px;
    padding: 2rem;
  }
}

@media (min-width: 1200px) {
  .container {
    grid-template-columns: 1fr 440px;
  }
}

/* Form */
.form-section {
  min-width: 0;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.form-card h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.form-grid .full {
  grid-column: 1 / -1;
}

@media (min-width: 500px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text);
  transition: border-color 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* Industry selector */
.industry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 500px) {
  .industry-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.industry-option {
  cursor: pointer;
  display: block;
}

.industry-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.industry-box {
  display: block;
  padding: 0.75rem 1rem;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
  transition: all 0.2s;
}

.industry-option input:checked + .industry-box {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.industry-option:hover .industry-box {
  border-color: var(--text-muted);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 500px) {
  .template-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.template-option {
  cursor: pointer;
  display: block;
}

.template-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.template-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.85rem 0.5rem;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
}

.template-option input:checked + .template-box {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.template-option:hover .template-box {
  border-color: var(--text-muted);
}

.template-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.template-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Repeatable items */
.repeatable {
  position: relative;
  padding: 1rem;
  background: var(--surface2);
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.repeatable .form-grid {
  margin-bottom: 0.5rem;
}

.btn-remove {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0;
  font-family: var(--font-sans);
}

.btn-remove:hover {
  color: #e05555;
}

.btn-add {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px dashed var(--accent);
  padding: 0.6rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}

.btn-add:hover {
  background: rgba(201, 162, 39, 0.25);
}

/* Industry-specific sections: show/hide via JS */
.industry-section {
  display: none;
}

.industry-section.visible {
  display: block;
}

.form-group.industry-section.visible {
  display: flex;
}

.print-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.print-tip {
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 280px;
  line-height: 1.4;
}

.print-tip strong {
  color: var(--text);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.checkbox-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

/* Preview panel */
.preview-section {
  position: sticky;
  top: 1rem;
  height: fit-content;
  min-width: 0;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preview-header span {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
}

.btn-print {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-print:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.35);
}

.btn-download-pdf {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-download-pdf:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.resume-preview {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 400px;
}

.resume-paper {
  background: #fff;
  color: #1a1a1a;
  min-height: 350px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  padding: 1rem 1.25rem;
}

/* Resume content - template base (print-friendly) */
.resume-paper {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.resume-paper .resume-name {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #111;
}

.resume-paper .resume-contact {
  font-size: 0.75rem;
  color: #444;
  margin-bottom: 0.75rem;
}

.resume-paper .resume-contact span + span::before {
  content: " • ";
  margin: 0 0.2rem;
}

.resume-paper .resume-section {
  margin-bottom: 0.85rem;
}

.resume-paper .resume-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #333;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.25rem;
  margin-bottom: 0.5rem;
}

.resume-paper .resume-item-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.resume-paper .resume-item-meta {
  font-size: 0.75rem;
  color: #555;
  margin-bottom: 0.2rem;
}

.resume-paper .resume-item-desc,
.resume-paper .resume-summary {
  font-size: 0.8rem;
  color: #444;
  line-height: 1.45;
  white-space: pre-line;
}

.resume-paper .resume-skills {
  font-size: 0.8rem;
  color: #444;
}

.resume-paper .resume-skills span {
  display: inline-block;
  background: #eee;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin: 0.15rem 0.15rem 0 0;
}

/* Template variants - industry accent colors */
.template-cs .resume-section-title { border-color: #2563eb; color: #2563eb; }
.template-management .resume-section-title { border-color: #059669; color: #059669; }
.template-agriculture .resume-section-title { border-color: #b45309; color: #b45309; }
.template-healthcare .resume-section-title { border-color: #dc2626; color: #dc2626; }
.template-engineering .resume-section-title { border-color: #7c3aed; color: #7c3aed; }
.template-general .resume-section-title { border-color: #475569; color: #475569; }

/* ========== LAYOUT TEMPLATES ========== */
/* Classic - default (already styled above) */

/* Modern - left accent bar on section titles */
.layout-modern .resume-section-title {
  border-bottom: none;
  border-left: 4px solid currentColor;
  padding-left: 0.5rem;
  margin-bottom: 0.4rem;
}

.layout-modern .resume-name {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

/* Minimal - clean, more whitespace */
.layout-minimal .resume-section {
  margin-bottom: 1.1rem;
}

.layout-minimal .resume-section-title {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 0.35rem;
  margin-bottom: 0.6rem;
  color: #666;
}

.layout-minimal .resume-item-desc,
.layout-minimal .resume-summary {
  line-height: 1.55;
}

/* Sidebar - two column: left = name, contact, skills, languages, certs */
.resume-sidebar-wrap {
  display: flex;
  min-height: 100%;
}

.resume-sidebar-left {
  width: 36%;
  min-width: 120px;
  padding: 1rem 1rem 1rem 1.1rem;
  background: #f5f5f5;
  border-right: 1px solid #e8e8e8;
}

.resume-sidebar-left .resume-name {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.resume-sidebar-left .resume-contact {
  font-size: 0.7rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.resume-sidebar-left .resume-contact a {
  color: #2563eb;
}

.resume-sidebar-right {
  flex: 1;
  padding: 1rem 1.2rem;
}

.resume-sidebar-left .resume-section-title {
  margin-top: 0.9rem;
  font-size: 0.75rem;
}

.resume-sidebar-left .resume-section:first-of-type {
  margin-top: 0;
}

/* Sidebar + industry accent on left border */
.layout-sidebar.template-cs .resume-sidebar-left { border-left: 3px solid #2563eb; }
.layout-sidebar.template-management .resume-sidebar-left { border-left: 3px solid #059669; }
.layout-sidebar.template-agriculture .resume-sidebar-left { border-left: 3px solid #b45309; }
.layout-sidebar.template-healthcare .resume-sidebar-left { border-left: 3px solid #dc2626; }
.layout-sidebar.template-engineering .resume-sidebar-left { border-left: 3px solid #7c3aed; }
.layout-sidebar.template-general .resume-sidebar-left { border-left: 3px solid #475569; }

/* Footer */
.site-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

/* ========== PRINT STYLES ========== */
/* Full page A4 - header/footer off karne ke liye Print dialog me "Headers and footers" uncheck karein */
@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  body {
    background: #fff;
    margin: 0;
    padding: 0;
  }

  .site-header,
  .form-section,
  .preview-header,
  .btn-print,
  .btn-download-pdf,
  .site-footer,
  .print-tip {
    display: none !important;
  }

  .container {
    display: block !important;
    max-width: none;
    padding: 0;
    margin: 0;
  }

  .preview-section {
    position: static !important;
    width: 100%;
    padding: 0;
  }

  .resume-preview {
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;
    min-height: 0;
  }

  .resume-paper {
    box-shadow: none;
    margin: 0;
    padding: 0.4in;
    width: 100% !important;
    max-width: none !important;
    min-height: 297mm;
    height: auto;
    box-sizing: border-box;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .resume-paper a {
    color: #2563eb;
  }
}
