/* ============================
   RESUME BUILDER - LIGHT THEME STYLES
   ============================ */

.builder-toolbar {
  position: sticky;
  top: 64px;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.toolbar-left a {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
}

.toolbar-left a:hover {
  color: var(--text-primary);
}

.toolbar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.toolbar-title i {
  color: var(--accent-primary);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ============================
   SPLIT SCREEN LAYOUT
   ============================ */

.builder-workspace {
  display: flex;
  height: calc(100vh - 64px - 50px);
  overflow: hidden;
}

.form-panel {
  width: 50%;
  overflow-y: auto;
  padding: 28px;
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
}

.preview-panel {
  width: 50%;
  overflow-y: auto;
  padding: 28px;
  background: var(--bg-secondary);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* ============================
   FORM STYLING
   ============================ */

.privacy-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.12);
  border-radius: 12px;
  margin-bottom: 24px;
}

.privacy-notice i {
  color: #059669;
  font-size: 1rem;
  margin-top: 2px;
}

.privacy-notice strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.privacy-notice span {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Accordion Sections */
.form-section {
  margin-bottom: 12px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-section.open {
  border-color: rgba(79, 70, 229, 0.2);
  box-shadow: 0 2px 12px rgba(79, 70, 229, 0.06);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-primary);
  cursor: pointer;
  transition: background 0.2s;
  user-select: none;
}

.section-header:hover {
  background: var(--bg-secondary);
}

.section-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  background: var(--bg-secondary);
  color: var(--text-muted);
  transition: all 0.3s;
}

.form-section.open .section-icon {
  background: rgba(79, 70, 229, 0.08);
  color: var(--accent-primary);
}

.section-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.section-header .toggle-icon {
  color: var(--text-muted);
  font-size: 0.7rem;
  transition: transform 0.3s;
}

.form-section.open .toggle-icon {
  transform: rotate(180deg);
}

.section-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.form-section.open .section-body {
  max-height: 3000px;
}

.section-inner {
  padding: 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea,
.form-group select {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: all 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
  background: var(--bg-primary);
}

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

.form-group textarea {
  resize: vertical;
  min-height: 90px;
}

/* Dynamic Entry Cards */
.entry-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  position: relative;
  margin-bottom: 14px;
}

.entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.entry-header h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-remove {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-remove:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.btn-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border: 1px dashed rgba(79, 70, 229, 0.25);
  border-radius: 12px;
  background: rgba(79, 70, 229, 0.03);
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.btn-add:hover {
  background: rgba(79, 70, 229, 0.06);
  border-color: rgba(79, 70, 229, 0.4);
}

/* Skill Tags */
.skills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.skill-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.skill-tag input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: var(--font-sans);
  outline: none;
  width: 110px;
}

.skill-tag .remove-skill {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.7rem;
  transition: color 0.2s;
}

.skill-tag .remove-skill:hover {
  color: #ef4444;
}

/* ============================
   RESUME PREVIEW (A4 Paper)
   ============================ */

.resume-paper {
  width: 100%;
  max-width: 794px;
  min-height: 1123px;
  background: #ffffff;
  color: #1a1a2e;
  border-radius: 8px;
  box-shadow: var(--shadow-xl);
  padding: 48px;
  font-family: 'Inter', sans-serif;
  position: relative;
  overflow: hidden;
}

.resume-paper .resume-header {
  border-bottom: 3px solid #4f46e5;
  padding-bottom: 24px;
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.resume-paper .resume-name {
  font-size: 2.2rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.resume-paper .resume-jobtitle {
  font-size: 1.1rem;
  color: #4f46e5;
  font-weight: 600;
  margin-top: 6px;
}

.resume-contact {
  text-align: right;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.8;
}

.resume-contact i {
  width: 16px;
  margin-right: 4px;
  color: #4f46e5;
}

.resume-body {
  display: flex;
  gap: 32px;
}

.resume-main { flex: 2; }
.resume-sidebar { flex: 1; }

.resume-section-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
  margin-bottom: 16px;
}

.resume-entry { margin-bottom: 20px; }

.resume-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.resume-entry h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.resume-date-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.08);
  padding: 3px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

.resume-entry .company {
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 500;
}

.resume-entry .description {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.7;
  margin-top: 6px;
  white-space: pre-wrap;
}

.resume-skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.resume-skill-tag {
  font-size: 0.75rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  padding: 5px 12px;
  border-radius: 6px;
}

.resume-edu h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.resume-edu .school {
  font-size: 0.85rem;
  color: #4f46e5;
  font-weight: 500;
}

.resume-edu .dates {
  font-size: 0.8rem;
  color: #94a3b8;
}

.placeholder {
  color: #cbd5e1;
  font-style: italic;
}

/* ============================
   MIT ACADEMIC TEMPLATE (Classic)
   ============================ */

.resume-paper.template-mit {
  font-family: "Computer Modern Serif", "Times New Roman", Times, serif;
  color: #000000;
  padding: 36px 48px;
  line-height: 1.2;
}

.template-mit .resume-header {
  border-bottom: none;
  display: block;
  text-align: center;
  padding-bottom: 0;
  margin-bottom: 12px;
}

.template-mit .resume-name {
  font-size: 24pt;
  font-weight: normal;
  color: #000000;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.template-mit .resume-jobtitle {
  display: none;
}

.template-mit .resume-contact {
  text-align: center;
  font-size: 10pt;
  color: #000000;
  line-height: 1.4;
}

.template-mit .resume-contact i {
  display: none;
}

.template-mit .resume-contact div {
  display: inline-block;
}

.template-mit .resume-contact div:not(:last-child)::after {
  content: " | ";
  margin: 0 4px;
}

.template-mit .resume-contact a {
  color: #000000;
  text-decoration: none;
}

.template-mit .resume-contact a:hover {
  text-decoration: underline;
}

.template-mit .resume-body {
  display: block;
}

.template-mit .resume-section-title {
  font-size: 11pt;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #000000;
  border-bottom: 1px solid #000000;
  padding-bottom: 2px;
  margin-bottom: 8px;
  margin-top: 12px;
}

.template-mit .resume-entry {
  margin-bottom: 8px;
}

.template-mit .resume-entry-header {
  margin-bottom: 0;
}

.template-mit .resume-entry h4 {
  font-size: 10.5pt;
  font-weight: bold;
  display: inline-block;
}

.template-mit .resume-date-badge {
  font-size: 10pt;
  font-weight: normal;
  color: #000000;
  background: transparent;
  padding: 0;
  float: right;
}

.template-mit .company,
.template-mit .school {
  font-size: 10.5pt;
  font-weight: normal;
  font-style: italic;
  color: #000000;
}

.template-mit .dates {
  float: right;
  font-size: 10pt;
  color: #000000;
}

.template-mit .description {
  font-size: 10pt;
  color: #000000;
  line-height: 1.35;
  margin-top: 2px;
}

.template-mit .resume-skills-grid {
  display: block;
}

.template-mit .resume-skill-tag {
  background: transparent;
  color: #000000;
  padding: 0;
  font-size: 10.5pt;
  font-weight: normal;
  display: inline;
}

.template-mit .resume-skill-tag:not(:last-child)::after {
  content: ", ";
}

/* Simulate LaTeX Bullet Points */
.template-mit .description {
  padding-left: 14px;
  position: relative;
}
.template-mit .description::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
}

/* ============================
   CUSTOM DESKTOP TEMPLATE (Tech/ATS style)
   ============================ */

.resume-paper.template-custom {
  font-family: 'Arial', sans-serif;
  color: #111827;
  padding: 40px;
}

.template-custom .resume-header {
  border-bottom: 2px solid #111827;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.template-custom .resume-name {
  font-size: 26pt;
  font-weight: 700;
  text-transform: uppercase;
  color: #111827;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.template-custom .resume-jobtitle {
  font-size: 12pt;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.template-custom .resume-contact {
  text-align: center;
  font-size: 10pt;
  color: #4b5563;
  width: 100%;
}

.template-custom .resume-contact div {
  display: inline-flex;
  align-items: center;
  margin: 0 8px;
}

.template-custom .resume-contact i {
  color: #111827;
  margin-right: 4px;
  font-size: 0.9em;
}

.template-custom .resume-contact a {
  color: #2563eb;
  text-decoration: none;
}

.template-custom .resume-contact a:hover {
  text-decoration: underline;
}

.template-custom .resume-body {
  display: flex;
  gap: 24px;
}

.template-custom .resume-main {
  flex: 2.5;
}

.template-custom .resume-sidebar {
  flex: 1;
}

.template-custom .resume-section-title {
  font-size: 12pt;
  font-weight: 700;
  text-transform: uppercase;
  color: #111827;
  border-bottom: 1px solid #d1d5db;
  padding-bottom: 4px;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.template-custom .resume-entry {
  margin-bottom: 16px;
}

.template-custom .resume-entry-header {
  margin-bottom: 2px;
}

.template-custom .resume-entry h4 {
  font-size: 11pt;
  font-weight: 700;
  color: #111827;
}

.template-custom .resume-date-badge {
  font-size: 9.5pt;
  font-weight: 600;
  color: #4b5563;
  background: transparent;
  padding: 0;
}

.template-custom .company,
.template-custom .school {
  font-size: 10.5pt;
  font-weight: 600;
  color: #374151;
}

.template-custom .dates {
  font-size: 9.5pt;
  color: #6b7280;
}

.template-custom .description {
  font-size: 10pt;
  color: #374151;
  line-height: 1.5;
}

.template-custom .resume-skill-tag {
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 9pt;
  padding: 4px 8px;
}

/* Responsive */
@media (max-width: 1024px) {
  .builder-workspace {
    flex-direction: column;
    height: auto;
  }
  .form-panel,
  .preview-panel {
    width: 100%;
    height: auto;
    border-right: none;
  }
  .form-panel {
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .builder-toolbar { padding: 10px 16px; }
  .resume-paper { padding: 24px; min-height: auto; }
  .resume-body { flex-direction: column; }
  .resume-paper .resume-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .resume-contact { text-align: left; margin-top: 12px; }
}
