/* =============================================
   Builder Pages CSS (builder.css)
   Shared by resume-builder & biodata-builder
   ============================================= */

/* ===== BUILDER LAYOUT ===== */
.builder-page {
  min-height: 100vh;
  padding-top: 72px;
  display: flex;
  flex-direction: column;
}

.builder-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
}
.builder-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.builder-title {
  font-size: 22px;
  font-weight: 800;
}
.builder-title span {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}
.builder-progress {
  flex: 1;
  max-width: 400px;
}
.builder-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ===== STEP WIZARD ===== */
.builder-body {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 72px - 100px);
}
.builder-sidebar {
  width: 280px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 32px 0;
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar-steps {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 16px;
}
.sidebar-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}
.sidebar-step:hover {
  background: rgba(255,255,255,0.04);
}
.sidebar-step.active {
  background: rgba(99,102,241,0.1);
}
.sidebar-step.completed .step-s-num { background: var(--success); color: #fff; border-color: var(--success); }
.sidebar-step.active .step-s-num { border-color: var(--primary); color: var(--primary); background: rgba(99,102,241,0.1); }
.step-s-num {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: var(--transition-fast);
}
.step-s-label {
  flex: 1;
}
.step-s-label strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}
.sidebar-step.active .step-s-label strong { color: var(--text-primary); }
.step-s-label span {
  font-size: 11px;
  color: var(--text-muted);
}
.sidebar-step.completed .step-s-num::after {
  content: '✓';
  font-size: 13px;
}
.sidebar-step.completed .step-s-num span { display: none; }

.builder-main {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  max-width: 780px;
}

.step-panel {
  display: none;
  animation: fadeInUp 0.4s ease;
}
.step-panel.active { display: block; }

.step-panel-header {
  margin-bottom: 32px;
}
.step-panel-header h2 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
}
.step-panel-header p {
  font-size: 15px;
  color: var(--text-secondary);
}
.step-panel-header .step-icon-big {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: rgba(99,102,241,0.1);
  border: 1.5px solid rgba(99,102,241,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.step-panel-header .step-icon-big svg {
  width: 24px; height: 24px;
  stroke: var(--primary-light);
}

.step-actions {
  display: flex;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ===== WORK EXPERIENCE / EDUCATION BLOCKS ===== */
.entry-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}
.entry-block {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  transition: var(--transition);
}
.entry-block:hover { border-color: rgba(99,102,241,0.3); }
.entry-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.entry-block-title { font-size: 15px; font-weight: 700; }
.entry-block-actions { display: flex; gap: 8px; }
.entry-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}
.entry-btn svg { width: 16px; height: 16px; stroke: var(--text-muted); }
.entry-btn:hover { background: rgba(236,72,153,0.1); border-color: rgba(236,72,153,0.3); }
.entry-btn:hover svg { stroke: var(--secondary); }
.add-entry-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}
.add-entry-btn:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(99,102,241,0.05);
}
.add-entry-btn svg { width: 20px; height: 20px; stroke: currentColor; }

/* ===== TEMPLATE SELECTION ===== */
.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.template-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.template-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}
.template-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-thumb {
  height: 180px;
  overflow: hidden;
  position: relative;
}
.template-thumb-inner {
  transform-origin: top left;
  transform: scale(0.22);
  width: 455%;
  height: 455%;
  pointer-events: none;
}
.template-info {
  padding: 14px 16px;
  background: var(--bg-card2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.template-info h4 { font-size: 14px; font-weight: 700; }
.template-info span { font-size: 12px; color: var(--text-muted); }
.template-selected-badge {
  position: absolute;
  top: 10px; right: 10px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition-fast);
}
.template-card.selected .template-selected-badge { opacity: 1; }
.template-selected-badge svg { width: 14px; height: 14px; stroke: #fff; }

/* ===== CUSTOMIZE COLORS ===== */
.color-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.color-swatch {
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: var(--transition-fast);
  position: relative;
}
.color-swatch.active {
  border-color: var(--text-primary);
  transform: scale(1.2);
}
.color-swatch::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: inherit;
}

.font-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.font-btn {
  padding: 8px 20px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  background: none;
  color: var(--text-secondary);
  font-size: 14px;
  transition: var(--transition-fast);
}
.font-btn.active, .font-btn:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(99,102,241,0.08);
}

/* ===== PREVIEW PANEL ===== */
.preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.preview-overlay.open {
  opacity: 1;
  visibility: visible;
}
.preview-panel {
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.preview-header h3 { font-size: 18px; font-weight: 700; }
.preview-actions { display: flex; gap: 10px; }
.preview-close {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}
.preview-close:hover { background: rgba(236,72,153,0.1); }
.preview-close svg { width: 18px; height: 18px; stroke: var(--text-secondary); }
.preview-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  justify-content: center;
}
.preview-doc-wrap {
  width: 100%;
  max-width: 794px;
  min-height: 500px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  border-radius: 4px;
  overflow: hidden;
}

/* ===== BIODATA BORDER STYLES ===== */
.border-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.border-option {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  text-align: center;
  transition: var(--transition-fast);
}
.border-option:hover, .border-option.active {
  border-color: var(--gold);
  background: rgba(245,158,11,0.05);
}
.border-preview-thumb {
  height: 80px;
  border-radius: 6px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.border-option span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ===== BUILDER RESPONSIVE ===== */
@media (max-width: 900px) {
  .builder-sidebar { display: none; }
  .builder-main { padding: 24px 16px; max-width: 100%; }
  .template-grid { grid-template-columns: 1fr; }
  .border-options { grid-template-columns: repeat(2, 1fr); }
}
