/* ─── ResumeForge Editor Styles ─── */

/* ─── Editor Layout ─────────────────────────────────────────────────── */
.editor-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  height: calc(100vh - 68px);
  overflow: hidden;
}

/* ─── Editor Toolbar ────────────────────────────────────────────────── */
.editor-toolbar {
  height: 68px;
  background: rgba(8,8,20,.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.toolbar-resume-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .2s;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar-resume-name:hover {
  border-color: var(--border);
  background: var(--surface);
}

.toolbar-sep {
  height: 24px;
  width: 1px;
  background: var(--border);
  flex-shrink: 0;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ─── Form Panel ─────────────────────────────────────────────────────── */
.form-panel {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.form-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  position: sticky;
  top: 0;
  z-index: 5;
}

.form-panel-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.form-panel-tab {
  flex: 1;
  padding: 6px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  border: none;
  background: transparent;
}

.form-panel-tab.active {
  background: var(--primary);
  color: #fff;
}

/* ─── Accordion Sections ────────────────────────────────────────────── */
.accordion {
  border-bottom: 1px solid var(--border);
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  transition: background .15s;
  user-select: none;
}

.accordion-header:hover {
  background: rgba(255,255,255,.02);
}

.accordion-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.accordion-icon {
  font-size: 16px;
}

.accordion-toggle {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--surface);
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all .2s;
  flex-shrink: 0;
}

.accordion-toggle.open {
  transform: rotate(180deg);
  background: var(--primary-glow);
  color: var(--primary);
}

.accordion-body {
  padding: 16px 20px;
  display: none;
}

.accordion-body.open {
  display: block;
}

/* ─── Section Toggle ────────────────────────────────────────────────── */
.section-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.toggle-switch {
  position: relative;
  width: 32px;
  height: 18px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface2);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: .2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  left: 3px;
  top: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: .2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(14px);
  background: #fff;
}

.toggle-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ─── Repeatable Item Cards ─────────────────────────────────────────── */
.item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  position: relative;
}

.item-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  cursor: pointer;
}

.item-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.item-card-actions {
  display: flex;
  gap: 4px;
}

.item-action-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all .15s;
}

.item-action-btn:hover { color: var(--text); border-color: var(--border-hover); }
.item-action-btn.delete:hover { color: var(--danger); border-color: var(--danger); }

.add-item-btn {
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.add-item-btn:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
}

/* ─── Skill Level Slider ────────────────────────────────────────────── */
.skill-level-input {
  display: flex;
  align-items: center;
  gap: 10px;
}

.skill-level-input input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  outline: none;
}

.skill-level-input input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.skill-level-dots {
  display: flex;
  gap: 3px;
}

.skill-level-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface2);
  transition: background .15s;
}

/* ─── Preview Panel ──────────────────────────────────────────────────── */
/* ─── Preview Wrapper & Scaling ─────────────────────────────────────── */
.preview-panel {
  background: #0f101c;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 80px;
  position: relative;
  width: 100%;
}

.preview-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  overflow: visible;
  transition: all .2s ease;
}

.preview-toolbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  background: rgba(26,26,48,.92);
  backdrop-filter: blur(12px);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  border: 1px solid var(--border);
  width: auto;
  max-width: 95%;
}

.preview-scale-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

.preview-scale-btn:hover {
  background: var(--surface2);
  border-color: var(--primary);
}

.preview-scale-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 44px;
  text-align: center;
}

.preview-page {
  width: 794px;
  min-height: 1123px;
  background: #fff;
  box-shadow: 0 12px 48px rgba(0,0,0,.6);
  border-radius: 4px;
  transform-origin: top center;
  position: relative;
  margin: 0 auto;
}

/* ─── Mobile Bottom App Bar ─────────────────────────────────────────── */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(14,14,31,.96);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 200;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 10px;
  transition: all .2s;
  flex: 1;
}

.mobile-nav-item.active {
  color: var(--primary);
  background: var(--primary-glow);
}

.mobile-nav-icon {
  font-size: 18px;
}

/* ─── Template Switcher Drawer ──────────────────────────────────────── */
.template-drawer {
  position: fixed;
  bottom: -100%;
  left: 380px;
  right: 0;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  z-index: 300;
  transition: bottom .3s cubic-bezier(.4,0,.2,1);
  max-height: 65vh;
  overflow-y: auto;
}

.template-drawer.open { bottom: 0; }

.template-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.template-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.template-mini-card {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .2s;
  background: var(--surface);
}

.template-mini-card:hover { border-color: var(--primary); }
.template-mini-card.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }

.template-mini-thumb {
  height: 70px;
}

.template-mini-name {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text);
  padding: 6px 8px;
  text-align: center;
}

/* ─── Responsive Layout Rules ───────────────────────────────────────── */
@media (max-width: 1024px) {
  .editor-layout {
    grid-template-columns: 340px 1fr;
  }
  .template-drawer {
    left: 340px;
  }
}

@media (max-width: 768px) {
  .editor-layout {
    grid-template-columns: 1fr;
    height: calc(100vh - 56px - 64px);
    margin-bottom: 64px;
  }

  .editor-toolbar {
    height: 56px;
    padding: 0 12px;
  }

  .toolbar-resume-name {
    max-width: 140px;
    font-size: 0.82rem;
  }

  .form-panel {
    padding-bottom: 40px;
    border-right: none;
  }

  .preview-panel {
    display: none;
    padding: 12px 6px 80px;
  }

  .preview-panel.mobile-show {
    display: flex;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 64px;
    z-index: 100;
    background: #090915;
  }

  .preview-toolbar {
    margin-bottom: 12px;
    padding: 6px 12px;
  }

  .mobile-bottom-bar {
    display: flex;
  }

  .template-drawer {
    left: 0;
    right: 0;
    border-radius: 20px 20px 0 0;
    padding: 16px 16px 80px;
    max-height: 75vh;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

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

  .modal {
    padding: 20px 16px;
    border-radius: 16px;
  }
}


