/* ============================================================
   TEMPLATES.CSS — Resume Template Styles
   All templates use .resume-tpl-* prefix
   ============================================================ */

/* ── Shared Resume Base ─────────────────────────────────── */
.resume-tpl {
  font-family: var(--resume-font-primary, 'Merriweather'), Georgia, serif;
  color: #2d2d2d;
  background: white;
  line-height: var(--resume-line-height, 1.5);
  font-size: var(--resume-body-size, 10pt);
  width: 100%;
  min-height: 100%;
  box-sizing: border-box;
}

.resume-tpl * {
  box-sizing: border-box;
}

.resume-tpl a {
  color: inherit;
  text-decoration: none;
}

/* ============================================================
   TEMPLATE 1: MODERN (Dark Sidebar)
   ============================================================ */
.tpl-modern {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 100%;
}

.tpl-modern .sidebar {
  background: var(--resume-accent, #1a5c45);
  color: white;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tpl-modern .sidebar-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto;
  border: 3px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
}

.tpl-modern .sidebar-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tpl-modern .sidebar-name {
  text-align: center;
  font-size: var(--resume-heading-size, 15pt);
  font-weight: var(--resume-primary-weight, 700);
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.tpl-modern .sidebar-title {
  text-align: center;
  font-size: var(--resume-secondary-heading-size, 8pt);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.85;
  margin-top: 3px;
}

.tpl-modern .sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.2);
  margin: 0 -4px;
}

.tpl-modern .sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tpl-modern .sidebar-section-title {
  font-size: 7pt;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.7;
  font-weight: 600;
  margin-bottom: 4px;
}

.tpl-modern .sidebar-item {
  font-size: 8.5pt;
  line-height: 1.5;
  opacity: 0.92;
}

.tpl-modern .sidebar-item-label {
  font-size: 7pt;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.65;
  margin-bottom: 1px;
}

.tpl-modern .sidebar-item a {
  color: rgba(255,255,255,0.9);
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.3);
}

.tpl-modern .skill-bar-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tpl-modern .skill-bar-item {}

.tpl-modern .skill-bar-name {
  font-size: 8.5pt;
  opacity: 0.92;
  margin-bottom: 3px;
}

.tpl-modern .skill-bar-track {
  height: 3px;
  background: rgba(255,255,255,0.2);
  border-radius: 99px;
}

.tpl-modern .skill-bar-fill {
  height: 100%;
  background: white;
  border-radius: 99px;
}

.tpl-modern .lang-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8.5pt;
  margin-bottom: 4px;
}

.tpl-modern .lang-level {
  font-size: 7.5pt;
  opacity: 0.7;
}

/* Main Content Area */
.tpl-modern .main-content {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tpl-modern .section-title {
  font-size: var(--resume-section-title-size, 9pt);
  font-weight: var(--resume-section-title-weight, 700);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--resume-accent, #1a5c45);
  border-bottom: 1.5px solid var(--resume-accent, #1a5c45);
  padding-bottom: 4px;
  margin-bottom: 10px;
}

.tpl-modern .entry-item {
  margin-bottom: 12px;
}

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

.tpl-modern .entry-title-text {
  font-size: 10.5pt;
  font-weight: 700;
  color: #1a1a1a;
}

.tpl-modern .entry-date {
  font-size: 8.5pt;
  color: #777;
  white-space: nowrap;
  margin-left: 8px;
}

.tpl-modern .entry-subtitle {
  font-size: 9.5pt;
  color: #555;
  margin-bottom: 3px;
}

.tpl-modern .entry-description {
  font-family: var(--resume-font-secondary, inherit);
  font-size: var(--resume-body-size, 9pt);
  color: #444;
}

.tpl-modern .entry-description ul {
  list-style: disc;
  padding-left: 16px;
}

.tpl-modern .entry-description li { margin-bottom: 2px; }

/* ============================================================
   TEMPLATE 2: CLASSIC (Traditional)
   ============================================================ */
.tpl-classic {
  padding: 36px 40px;
}

.tpl-classic .header {
  text-align: center;
  margin-bottom: 20px;
  border-bottom: 2px solid #1a1a1a;
  padding-bottom: 14px;
}

.tpl-classic .header-name {
  font-size: var(--resume-heading-size, 22pt);
  font-weight: var(--resume-primary-weight, 700);
  letter-spacing: 0.04em;
  color: #1a1a1a;
  font-family: var(--resume-font-primary, 'Times New Roman'), serif;
}

.tpl-classic .header-title {
  font-size: var(--resume-secondary-heading-size, 11pt);
  color: #555;
  margin: 4px 0 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tpl-classic .header-contact {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 9pt;
  color: #444;
}

.tpl-classic .header-contact-sep {
  color: #999;
}

.tpl-classic .section-title {
  font-size: var(--resume-section-title-size, 10pt);
  font-weight: var(--resume-section-title-weight, 700);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #1a1a1a;
  border-bottom: 1px solid #ccc;
  padding-bottom: 3px;
  margin-bottom: 8px;
  margin-top: 16px;
}

.tpl-classic .entry-item {
  margin-bottom: 10px;
}

.tpl-classic .entry-header {
  display: flex;
  justify-content: space-between;
}

.tpl-classic .entry-title-text {
  font-size: 10pt;
  font-weight: 700;
}

.tpl-classic .entry-date {
  font-size: 9pt;
  color: #666;
  white-space: nowrap;
}

.tpl-classic .entry-subtitle {
  font-size: 9.5pt;
  font-style: italic;
  color: #555;
  margin-bottom: 3px;
}

.tpl-classic .entry-description {
  font-family: var(--resume-font-secondary, inherit);
  font-size: var(--resume-body-size, 9pt);
  color: #333;
}

.tpl-classic .entry-description ul {
  list-style: disc;
  padding-left: 16px;
}

.tpl-classic .skills-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 9pt;
}

.tpl-classic .skill-tag {
  color: #333;
}

.tpl-classic .skill-tag::after { content: ' •'; color: #999; }
.tpl-classic .skill-tag:last-child::after { content: ''; }

/* ============================================================
   TEMPLATE 3: MINIMAL (Ultra Clean)
   ============================================================ */
.tpl-minimal {
  padding: 40px 44px;
  font-family: var(--resume-font-primary, 'Open Sans'), 'Helvetica Neue', sans-serif;
}

.tpl-minimal .header {
  margin-bottom: 28px;
}

.tpl-minimal .header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.tpl-minimal .header-photo {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.tpl-minimal .header-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tpl-minimal .header-name {
  font-size: var(--resume-heading-size, 24pt);
  font-weight: var(--resume-primary-weight, 300);
  letter-spacing: -0.02em;
  color: #1a1a1a;
  line-height: 1.1;
}

.tpl-minimal .header-name strong {
  font-weight: 700;
}

.tpl-minimal .header-title {
  font-size: var(--resume-secondary-heading-size, 10pt);
  color: var(--resume-accent, #1a5c45);
  font-weight: var(--resume-secondary-weight, 400);
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.tpl-minimal .header-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  font-size: 8.5pt;
  color: #666;
}

.tpl-minimal .header-divider {
  height: 1px;
  background: #e0e0e0;
  margin: 16px 0;
}

.tpl-minimal .section {
  margin-bottom: 22px;
}

.tpl-minimal .section-title {
  font-size: var(--resume-section-title-size, 8pt);
  font-weight: var(--resume-section-title-weight, 700);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--resume-accent, #1a5c45);
  margin-bottom: 10px;
}

.tpl-minimal .entry-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 9pt;
}

.tpl-minimal .entry-dates {
  color: #999;
  font-size: 8.5pt;
  padding-top: 1px;
}

.tpl-minimal .entry-title-text {
  font-size: 9.5pt;
  font-weight: 600;
  color: #1a1a1a;
}

.tpl-minimal .entry-subtitle {
  font-size: 9pt;
  color: #666;
  margin-bottom: 3px;
}

.tpl-minimal .entry-description {
  font-family: var(--resume-font-secondary, inherit);
  font-size: var(--resume-body-size, 9pt);
  color: #444;
}

.tpl-minimal .entry-description ul {
  list-style: none;
  padding-left: 0;
}

.tpl-minimal .entry-description li::before {
  content: '– ';
  color: #999;
}

.tpl-minimal .skills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.tpl-minimal .skill-item {
  font-size: 9pt;
  color: #444;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tpl-minimal .skill-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--resume-accent, #1a5c45);
  flex-shrink: 0;
}

/* ============================================================
   TEMPLATE 4: CREATIVE (Bold Accents)
   ============================================================ */
.tpl-creative {
  font-family: var(--resume-font-primary, 'Raleway'), sans-serif;
}

.tpl-creative .header {
  background: var(--resume-accent, #1a5c45);
  color: white;
  padding: 32px 36px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.tpl-creative .header-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.4);
  flex-shrink: 0;
}

.tpl-creative .header-photo img {
  width: 100%; height: 100%; object-fit: cover;
}

.tpl-creative .header-info { flex: 1; }

.tpl-creative .header-name {
  font-size: var(--resume-heading-size, 26pt);
  font-weight: var(--resume-primary-weight, 700);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.tpl-creative .header-title {
  font-size: var(--resume-secondary-heading-size, 10pt);
  opacity: 0.85;
  font-weight: var(--resume-secondary-weight, 300);
  margin-top: 4px;
  letter-spacing: 0.08em;
}

.tpl-creative .header-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 12px;
  font-size: 8.5pt;
  opacity: 0.9;
}

.tpl-creative .header-contact-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tpl-creative .body {
  padding: 28px 36px;
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 32px;
}

.tpl-creative .body.body-full {
  grid-template-columns: 1fr;
  gap: 0;
}

.tpl-creative .section-title {
  font-size: var(--resume-section-title-size, 10pt);
  font-weight: var(--resume-section-title-weight, 700);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--resume-accent, #1a5c45);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tpl-creative .section-title::before {
  content: '';
  width: 24px;
  height: 3px;
  background: var(--resume-accent, #1a5c45);
  border-radius: 2px;
  flex-shrink: 0;
}

.tpl-creative .section { margin-bottom: 20px; }

.tpl-creative .entry-item { margin-bottom: 14px; }

.tpl-creative .entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.tpl-creative .entry-title-text {
  font-size: 10.5pt;
  font-weight: 700;
  color: #1a1a1a;
}

.tpl-creative .entry-date {
  font-size: 8.5pt;
  color: var(--resume-accent, #1a5c45);
  font-weight: 600;
  white-space: nowrap;
}

.tpl-creative .entry-subtitle {
  font-size: 9.5pt;
  color: #666;
  margin-bottom: 4px;
}

.tpl-creative .entry-description {
  font-family: var(--resume-font-secondary, inherit);
  font-size: var(--resume-body-size, 9pt);
  color: #444;
}

.tpl-creative .entry-description ul {
  list-style: none;
  padding-left: 12px;
}

.tpl-creative .entry-description li::before {
  content: '▸ ';
  color: var(--resume-accent, #1a5c45);
}

.tpl-creative .sidebar-section {
  margin-bottom: 18px;
}

.tpl-creative .sidebar-section-title {
  font-size: 8.5pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--resume-accent, #1a5c45);
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(26,92,69,0.2);
  padding-bottom: 4px;
}

.tpl-creative .skill-chip {
  display: inline-block;
  background: rgba(26,92,69,0.08);
  color: var(--resume-accent, #1a5c45);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 8.5pt;
  font-weight: 500;
  margin: 2px 2px 2px 0;
}

/* ============================================================
   TEMPLATE 5: EXECUTIVE (Corporate Premium)
   ============================================================ */
.tpl-executive {
  font-family: var(--resume-font-primary, 'Crimson Text'), 'Georgia', serif;
}

.tpl-executive .header {
  padding: 32px 40px;
  border-bottom: 3px solid var(--resume-accent, #1a5c45);
}

.tpl-executive .header-top {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 12px;
}

.tpl-executive .header-photo {
  width: 76px;
  height: 76px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid #e0e0e0;
}
.tpl-executive .header-photo img {
  width: 100%; height: 100%; object-fit: cover;
}

.tpl-executive .header-name {
  font-size: var(--resume-heading-size, 28pt);
  font-weight: var(--resume-primary-weight, 400);
  letter-spacing: 0.04em;
  color: var(--resume-accent, #1a5c45);
  line-height: 1.1;
}

.tpl-executive .header-title {
  font-size: var(--resume-secondary-heading-size, 11pt);
  font-weight: var(--resume-secondary-weight, 400);
  color: #666;
  font-style: italic;
  margin-top: 3px;
}

.tpl-executive .header-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 9pt;
  color: #555;
  font-family: 'DM Sans', sans-serif;
}

.tpl-executive .body {
  padding: 24px 40px;
}

.tpl-executive .section { margin-bottom: 22px; }

.tpl-executive .section-title {
  font-size: var(--resume-section-title-size, 13pt);
  font-weight: var(--resume-section-title-weight, 700);
  color: var(--resume-accent, #1a5c45);
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 5px;
  margin-bottom: 12px;
  letter-spacing: 0.03em;
}

.tpl-executive .entry-item { margin-bottom: 14px; }

.tpl-executive .entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.tpl-executive .entry-title-text {
  font-size: 11pt;
  font-weight: 700;
  color: #1a1a1a;
}

.tpl-executive .entry-date {
  font-size: 9pt;
  color: #888;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}

.tpl-executive .entry-subtitle {
  font-size: 10pt;
  color: #666;
  font-style: italic;
  margin-bottom: 5px;
}

.tpl-executive .entry-description {
  font-family: var(--resume-font-secondary, inherit);
  font-size: var(--resume-body-size, 9.5pt);
  color: #333;
}

.tpl-executive .entry-description ul {
  list-style: square;
  padding-left: 18px;
  color: #444;
}

.tpl-executive .executive-skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.tpl-executive .exec-skill {
  padding: 4px 8px;
  background: #f5f5f0;
  border-left: 2px solid var(--resume-accent, #1a5c45);
  font-size: 9pt;
  color: #333;
}

/* ── Template Thumbnail Grid (Customize Panel) ──────────── */
.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}

.template-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}

.template-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,92,69,0.1);
}

.template-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,92,69,0.15);
}

.template-card-thumb {
  aspect-ratio: 0.707;
  overflow: hidden;
  background: var(--bg-sidebar);
}

.template-card-thumb iframe {
  width: 400%;
  height: 400%;
  transform: scale(0.25);
  transform-origin: top left;
  pointer-events: none;
  border: none;
}

.template-card-thumb .thumb-preview {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.template-card-info {
  padding: 8px 10px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
}

.template-card-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.template-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.template-card .active-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.template-filter-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 16px 0;
  flex-wrap: wrap;
}

.template-filter-tab {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-panel);
}

.template-filter-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.template-filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Color Presets */
.color-section {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.color-section-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.color-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.color-preset {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--transition-fast);
  border: 2px solid transparent;
  position: relative;
}

.color-preset:hover { transform: scale(1.15); }

.color-preset.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px white, 0 0 0 4px var(--text-primary);
}

.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.custom-color-input {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  cursor: pointer;
  padding: 2px;
  background: var(--bg-panel);
}

.custom-color-hex {
  flex: 1;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-family: var(--font-mono);
  color: var(--text-primary);
  background: var(--bg-panel);
}

.custom-color-hex:focus {
  border-color: var(--primary);
  outline: none;
}
