/* =====================================================
   CV MAKER PRO — WIZARD STYLES
   ===================================================== */

/* ── Step Visibility ── */
.wizard-step {
  display: none;
  animation: fadeSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.wizard-step.active {
  display: block;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── Two-column Layout (form + preview) ── */
.wizard-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 2rem;
  align-items: start;
}

/* ── Form Panel ── */
.form-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
}

/* ── Form Elements ── */
.form-group {
  margin-bottom: 1.25rem;
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 11px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition-med);
  outline: none;
}



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

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
  background: rgba(99, 102, 241, 0.03);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.form-select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0a0c0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-section {
  margin-bottom: 1.5rem;
}

.section-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.optional-tag {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
}

.char-counter {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  display: block;
  margin-top: 4px;
}

/* ── Photo Upload ── */
.photo-upload-area {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.photo-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color var(--transition-med);
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.photo-preview.has-photo {
  border-color: var(--primary);
}

.photo-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-upload {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-sm);
  color: var(--primary-light);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition-med);
}

.btn-upload:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: var(--primary);
}

.photo-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Dynamic List Items (Experience, Education) ── */
.dynamic-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
  position: relative;
  transition: border-color var(--transition-med);
}

.dynamic-item:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.item-title-display {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.btn-remove-item {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition-fast);
}

.btn-remove-item:hover {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

/* ── Skill Row ── */
.skill-row {
  display: grid;
  grid-template-columns: 1fr auto 28px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.skill-level-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 4px;
  background: linear-gradient(to right, var(--primary) var(--val, 70%), var(--border-color) var(--val, 70%));
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.skill-level-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  transition: transform var(--transition-fast);
  box-shadow: 0 0 6px rgba(99, 102, 241, 0.5);
}

.skill-level-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.btn-remove-small {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color var(--transition-fast);
}

.btn-remove-small:hover {
  color: var(--danger);
}

/* ── Language Row ── */
.language-row {
  display: grid;
  grid-template-columns: 1fr 1fr 28px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

/* =====================================================
   PREVIEW PANEL
   ===================================================== */
.preview-panel {
  position: sticky;
  top: calc(var(--header-height) + var(--progress-height) + 1.5rem);
  height: calc(100vh - var(--header-height) - var(--progress-height) - 3rem);
  display: flex;
  flex-direction: column;
}

.preview-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview-label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

.preview-container {
  flex: 1;
  background: #e8e8e8;
  border-radius: var(--radius-md);
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12px;
}

.cv-preview-wrapper {
  transform-origin: top center;
  transform: scale(0.45);
  width: 210mm;
  min-height: 297mm;
  flex-shrink: 0;
}

/* =====================================================
   TEMPLATE SELECTION (Step 1)
   ===================================================== */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.template-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-med);
  position: relative;
}

.template-card:hover {
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.template-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), 0 12px 40px rgba(0, 0, 0, 0.4);
}

.template-card.selected::after {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: white;
  font-weight: 700;
}

.template-thumbnail {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  position: relative;
  background: white;
}

.template-thumbnail-inner {
  position: absolute;
  inset: 0;
  transform-origin: top left;
}

.template-info {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
}

.template-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.template-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.template-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  background: rgba(99, 102, 241, 0.12);
  border-radius: 20px;
  font-size: 0.7rem;
  color: var(--primary-light);
  font-weight: 500;
}

/* =====================================================
   FINAL SCREEN
   ===================================================== */
.final-screen {
  max-width: 900px;
  margin: 0 auto;
}

.final-header {
  text-align: center;
  margin-bottom: 2rem;
}

.success-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--success), #34d399);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin: 0 auto 1rem;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
  animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successPop {
  from {
    transform: scale(0);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.export-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.btn-export {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition-med);
}

.btn-export.pdf {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-export.pdf:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.45);
}

.btn-export.image {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-export.image:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45);
}

.btn-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition-med);
}

.btn-edit:hover {
  border-color: var(--primary);
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.08);
}

.final-preview-area {
  display: flex;
  justify-content: center;
  background: #d0d0d0;
  border-radius: var(--radius-xl);
  padding: 2rem;
  overflow: auto;
}

.cv-final-wrapper {
  transform-origin: top center;
  transform: scale(0.65);
  width: 210mm;
  min-height: 297mm;
  flex-shrink: 0;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1100px) {
  .wizard-layout {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    display: none;
  }
}

@media (max-width: 640px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .skill-row {
    grid-template-columns: 1fr auto 28px;
  }

  .language-row {
    grid-template-columns: 1fr 1fr 28px;
  }

  .template-grid {
    grid-template-columns: 1fr 1fr;
  }

  .export-actions {
    flex-direction: column;
    align-items: center;
  }

  .cv-final-wrapper {
    transform: scale(0.4);
  }
}

.lang-level option{
    background-color: black;
}