/* ============================================
   Resume Template Styles (Live Preview)
   ============================================ */

.resume-preview {
  --resume-primary: #4F46E5;
  --resume-secondary: #7C3AED;
  --resume-accent: #06B6D4;
  --resume-text: #0F172A;
  --resume-muted: #64748B;
  --resume-border: #E2E8F0;
  --resume-surface: #F8FAFC;
}

.resume-preview.theme-indigo {
  --resume-primary: #4F46E5;
  --resume-secondary: #4338CA;
}

.resume-preview.theme-violet {
  --resume-primary: #7C3AED;
  --resume-secondary: #6D28D9;
}

.resume-preview.theme-teal {
  --resume-primary: #0D9488;
  --resume-secondary: #06B6D4;
}

.resume-preview.theme-slate {
  --resume-primary: #334155;
  --resume-secondary: #1E293B;
}

/* Shared */
.resume-inner {
  padding: 32px 36px;
}

.resume-header-block {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--resume-border);
}

.resume-name {
  font-size: 26pt;
  font-weight: 800;
  margin: 0 0 6px;
  line-height: 1.15;
  color: var(--resume-text);
  letter-spacing: -0.02em;
}

.resume-job-title {
  font-size: 12pt;
  font-weight: 600;
  color: var(--resume-primary);
  margin: 0 0 12px;
}

.resume-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 9pt;
  color: var(--resume-muted);
}

.resume-contact span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.resume-contact i {
  color: var(--resume-primary);
  opacity: 0.85;
}

.resume-section {
  margin-bottom: 22px;
  page-break-inside: avoid;
}

.resume-section-title {
  font-size: 10pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--resume-primary);
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--resume-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.resume-section-title::before {
  content: '';
  width: 4px;
  height: 14px;
  background: var(--resume-primary);
  border-radius: 2px;
  flex-shrink: 0;
}

.resume-section-body {
  font-size: 9.5pt;
  color: var(--resume-text);
}

.resume-summary {
  color: var(--resume-muted);
  line-height: 1.65;
  margin: 0;
  font-size: 10pt;
}

.resume-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.resume-skill-pill {
  padding: 5px 12px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--resume-primary);
  border-radius: 6px;
  font-size: 8.5pt;
  font-weight: 600;
  border: 1px solid rgba(79, 70, 229, 0.15);
}

.theme-violet .resume-skill-pill { background: rgba(124, 58, 237, 0.1); border-color: rgba(124, 58, 237, 0.2); }
.theme-teal .resume-skill-pill { background: rgba(13, 148, 136, 0.1); border-color: rgba(13, 148, 136, 0.2); }
.theme-slate .resume-skill-pill { background: rgba(51, 65, 85, 0.1); border-color: rgba(51, 65, 85, 0.2); }
.theme-violet .resume-entry-date,
.theme-teal .resume-entry-date,
.theme-slate .resume-entry-date { background: var(--resume-surface); color: var(--resume-primary); }

.resume-entry {
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 2px solid var(--resume-border);
  transition: border-color 0.2s ease;
}

.resume-entry:hover {
  border-left-color: var(--resume-primary);
}

.resume-entry:last-child {
  margin-bottom: 0;
}

.resume-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 6px;
}

.resume-entry-title {
  font-weight: 700;
  font-size: 10.5pt;
  margin: 0;
  color: var(--resume-text);
}

.resume-entry-sub {
  font-size: 9pt;
  color: var(--resume-muted);
  margin: 2px 0 0;
}

.resume-entry-date {
  font-size: 8.5pt;
  font-weight: 600;
  color: var(--resume-primary);
  background: rgba(79, 70, 229, 0.08);
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.resume-entry-desc {
  font-size: 9pt;
  color: var(--resume-muted);
  margin: 8px 0 0;
  line-height: 1.55;
}

.resume-entry-desc ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.resume-lang-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
}

.resume-lang-item {
  display: flex;
  justify-content: space-between;
  font-size: 9pt;
  padding: 6px 10px;
  background: var(--resume-surface);
  border-radius: 6px;
}

.resume-lang-level {
  color: var(--resume-muted);
  font-weight: 600;
}

.resume-social-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.resume-social-link {
  font-size: 9pt;
  color: var(--resume-primary);
  font-weight: 500;
  text-decoration: none;
}

.resume-ref-item {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--resume-surface);
  border-radius: 8px;
  font-size: 9pt;
}

.resume-ref-name {
  font-weight: 700;
  color: var(--resume-text);
}

/* ============================================
   TEMPLATE: Minimal Professional
   ============================================ */
.template-minimal .resume-inner {
  font-family: 'Source Sans 3', 'Inter', sans-serif;
  border-top: none;
  padding-top: 32px;
}

.template-minimal .resume-section-title {
  border-bottom-width: 1px;
  letter-spacing: 0.12em;
  font-size: 9pt;
}

.template-minimal .resume-section-title::before {
  display: none;
}

.template-minimal .resume-entry {
  border-left: none;
  padding-left: 0;
}

.template-minimal .resume-entry-header {
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--resume-border);
}

/* ============================================
   TEMPLATE: Creative Modern
   ============================================ */
.template-creative {
  overflow: hidden;
}

.template-creative .resume-creative-wrap {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 297mm;
}

.template-creative .resume-sidebar {
  background: linear-gradient(165deg, var(--resume-primary) 0%, var(--resume-secondary) 55%, var(--resume-secondary) 100%);
  color: #fff;
  padding: 32px 22px;
  position: relative;
}

.template-creative .resume-sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.06) 0%, transparent 40%);
  pointer-events: none;
}

.template-creative .resume-sidebar > * {
  position: relative;
  z-index: 1;
}

.template-creative .resume-sidebar .resume-name {
  color: #fff;
  font-size: 17pt;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 6px;
}

.template-creative .resume-sidebar .resume-job-title {
  color: rgba(255, 255, 255, 0.9);
  font-size: 9.5pt;
  margin-bottom: 24px;
  font-weight: 500;
}

.template-creative .resume-sidebar .resume-contact {
  flex-direction: column;
  gap: 10px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 8pt;
  margin-bottom: 8px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.template-creative .resume-sidebar .resume-contact i {
  color: rgba(255, 255, 255, 0.9);
}

.template-creative .resume-sidebar .resume-section {
  margin-bottom: 20px;
}

.template-creative .resume-sidebar .resume-section-title {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.35);
  font-size: 8pt;
  letter-spacing: 0.14em;
}

.template-creative .resume-sidebar .resume-section-title::before {
  background: rgba(255, 255, 255, 0.6);
}

.template-creative .resume-sidebar .resume-skill-pill {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.template-creative .resume-sidebar .resume-lang-item {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.95);
}

.template-creative .resume-sidebar .resume-lang-level {
  color: rgba(255, 255, 255, 0.65);
}

.template-creative .resume-sidebar .resume-social-link {
  color: #fff;
}

.template-creative .resume-main {
  padding: 32px 32px 36px;
  background: #fff;
}

.template-creative .resume-main .resume-section-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 10pt;
}

.template-creative .resume-main .resume-entry-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.template-creative .resume-main .resume-entry {
  border-left-color: rgba(79, 70, 229, 0.25);
}

@media (max-width: 400px) {
  .template-creative .resume-creative-wrap {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   TEMPLATE: Corporate Elegant
   ============================================ */
.template-corporate .resume-inner {
  font-family: 'Inter', sans-serif;
  padding: 0;
}

.template-corporate .resume-corp-header {
  background: linear-gradient(135deg, var(--resume-secondary) 0%, var(--resume-primary) 100%);
  color: #fff;
  padding: 40px 40px 32px;
  text-align: center;
  position: relative;
}

.template-corporate .resume-corp-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--resume-primary), var(--resume-accent), var(--resume-primary));
}

.template-corporate .resume-corp-header .resume-name {
  color: #fff;
  font-family: 'Merriweather', Georgia, serif;
  font-size: 26pt;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.template-corporate .resume-corp-header .resume-job-title {
  color: rgba(255, 255, 255, 0.88);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 12pt;
  margin-top: 8px;
}

.template-corporate .resume-corp-header .resume-contact {
  justify-content: center;
  color: rgba(255, 255, 255, 0.78);
  font-size: 9pt;
  margin-top: 16px;
}

.template-corporate .resume-corp-header .resume-contact i {
  color: rgba(255, 255, 255, 0.9);
}

.template-corporate .resume-corp-body {
  padding: 32px 40px 40px;
}

.template-corporate .resume-section-title {
  font-family: 'Merriweather', Georgia, serif;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12pt;
  border-bottom: 2px solid var(--resume-border);
  color: var(--resume-secondary);
  padding-bottom: 8px;
}

.template-corporate .resume-section-title::before {
  display: none;
}

.template-corporate .resume-entry {
  border-left: none;
  padding: 0;
  background: transparent;
}

.template-corporate .resume-entry-header {
  border-bottom: none;
}

.template-corporate .resume-entry-date {
  background: var(--resume-surface);
  color: var(--resume-secondary);
}

.template-corporate .resume-skill-pill {
  border-radius: 4px;
  background: var(--resume-surface);
  border: 1px solid var(--resume-border);
}

/* Print */
@media print {
  .resume-preview {
    box-shadow: none !important;
    min-height: auto;
    width: 100%;
    margin: 0;
  }

  .resume-section {
    page-break-inside: avoid;
  }

  .resume-entry:hover {
    border-left-color: var(--resume-border);
  }
}

.resume-preview.pdf-mode {
  box-shadow: none;
  margin: 0;
}

/* ============================================
   Avatars & header layouts
   ============================================ */
.resume-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14pt;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--resume-primary), var(--resume-secondary));
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.resume-header-with-avatar {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  border-bottom: none;
  padding-bottom: 0;
}

.resume-header-text {
  flex: 1;
  min-width: 0;
}

.template-minimal .resume-header-text::after {
  content: '';
  display: block;
  width: 48px;
  height: 4px;
  background: linear-gradient(90deg, var(--resume-primary), var(--resume-accent));
  border-radius: 2px;
  margin-top: 14px;
}

.template-minimal .resume-header-block {
  border-bottom: 1px solid var(--resume-border);
  padding-bottom: 20px;
}

.template-minimal .resume-inner {
  position: relative;
}

.template-minimal .resume-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, var(--resume-primary), var(--resume-accent));
  border-radius: 0 3px 3px 0;
}

.template-minimal .resume-inner {
  padding-left: 42px;
}

.template-creative .resume-avatar-creative {
  width: 72px;
  height: 72px;
  font-size: 16pt;
  margin: 0 auto 16px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.template-creative .resume-sidebar .resume-name {
  text-align: center;
}

.template-creative .resume-sidebar .resume-job-title {
  text-align: center;
}

.template-creative .resume-main {
  background: linear-gradient(180deg, #fff 0%, #FAFBFC 100%);
}

.template-creative .resume-main .resume-section {
  background: #fff;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--resume-border);
  margin-bottom: 16px;
}

.template-corporate .resume-corp-header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.template-corporate .resume-avatar-corporate {
  width: 80px;
  height: 80px;
  font-size: 18pt;
  border: 4px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

.template-corporate .resume-corp-body {
  background: #fff;
}

.template-corporate .resume-section {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--resume-border);
}

.template-corporate .resume-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Enhanced section titles */
.resume-section-title {
  position: relative;
}

.template-minimal .resume-summary {
  padding: 12px 14px;
  background: var(--resume-surface);
  border-radius: 8px;
  border-left: 3px solid var(--resume-primary);
}

.template-minimal .resume-entry-date {
  font-size: 8pt;
}

/* Print: keep avatars */
@media print {
  .resume-avatar {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
