@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&display=swap");

:root {
  --primary: #3b82f6;
  --primary-light: #60a5fa;
  --primary-glow: rgba(59, 130, 246, 0.15);
  --gradient-start: #0f172a;
  --gradient-end: #1e293b;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --text-light: #cbd5e1;
  --sidebar-width: 290px;
  --resume-width: 840px;
  --resume-height: 1188px; /* A4 aspect ratio 1:1.414 */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  list-style: none;
  font-family: "Montserrat", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-size: 11.5px;
  line-height: 17px;
  color: #334155;
  background: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #0f172a 100%);
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* Обертка для центрирования на больших экранах */
.resume-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  width: 100%;
  padding: 40px 20px;
  overflow: visible;
  position: relative; /* Centering reference for absolute loader */
}

/* Базовый макет резюме (A4 пропорции) */
.resume {
  width: var(--resume-width);
  height: var(--resume-height);
  display: flex;
  background: transparent;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.4s ease;
  opacity: 0; /* Hidden by default to prevent FOUC */
}

.resume.loaded {
  opacity: 1; /* Revealed dynamically after database hydration finishes */
}

/* Специальный класс экспорта (отключает тени, скругления для идеального PDF) */
.resume.exporting {
  box-shadow: none !important;
  border-radius: 0 !important;
  transform: none !important;
  margin: 0 !important;
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  z-index: 9999 !important;
}

.resume.exporting .resume_left,
.resume.exporting .resume_right {
  border-radius: 0 !important;
}

/* Левая колонка (сайдбар) */
.resume .resume_left {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #070a13 0%, #111827 100%);
  display: flex;
  flex-direction: column;
  height: 100%;
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.resume .resume_left .resume_profile {
  width: 100%;
  padding: 25px 0 12px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.resume .resume_left .resume_profile .avatar-container {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.25);
}

.resume .resume_left .resume_profile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #080d16;
  display: block;
}

.resume .resume_left .resume_content {
  padding: 0 24px;
}

/* Заголовки разделов в сайдбаре */
.resume .resume_left .title {
  margin-bottom: 0;
}

/* Фикс для html2canvas: убираем Webkit-Background-Clip и градиенты на тексте, так как они вызывают белые полосы */
.resume .resume_left .title .bold {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  text-transform: uppercase;
  line-height: 1.2;
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: initial !important;
}

.resume .resume_left .title .regular {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--primary-light);
  margin-top: 3px;
}

.resume .resume_left .title.profile-title {
  text-align: center;
  margin-bottom: 12px;
}

/* Элементы разделов */
.resume .resume_left .resume_item {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.resume .resume_left .resume_item:last-child {
  border-bottom: 0px;
}

.resume .resume_left .resume_item .title .bold {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: #ffffff;
  text-transform: uppercase;
  margin-bottom: 10px;
  position: relative;
  padding-left: 10px;
  font-weight: 700;
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: initial !important;
}

.resume .resume_left .resume_item .title .bold::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 11px;
  background: var(--primary);
  border-radius: 1px;
}

/* Контакты */
.resume .resume_left .resume_info ul li {
  display: flex;
  margin-bottom: 8px;
  align-items: center;
}

.resume .resume_left .resume_info ul li:last-child {
  margin-bottom: 0;
}

.resume .resume_left .resume_info ul li .icon {
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--primary-light);
  border-radius: 6px;
  margin-right: 12px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.resume .resume_left .resume_info ul li:hover .icon {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

.resume .resume_left .resume_info ul li .data {
  color: var(--text-light);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.3;
  word-break: break-all;
}

.resume .resume_left .resume_info ul li .data a {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
}

.resume .resume_left .resume_info ul li .data a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Навыки ПК */
.resume .resume_left .resume_skills.pc-skills ul li {
  font-size: 10.5px;
  color: var(--text-light);
  margin-bottom: 8px;
  line-height: 1.5;
  display: flex;
  align-items: center;
}

.resume .resume_left .resume_skills.pc-skills ul li:last-child {
  margin-bottom: 0;
}

.resume .resume_left .resume_skills.pc-skills ul li b {
  color: #ffffff;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 0 4px;
  border-radius: 3px;
  margin-right: 6px;
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 14px;
}

/* Языки с прогресс-барами */
.resume .resume_left .resume_skills.languages ul li {
  margin-bottom: 8px;
}

.resume .resume_left .resume_skills.languages ul li:last-child {
  margin-bottom: 0;
}

.resume .resume_left .resume_skills.languages ul li .skill_name {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-light);
  margin-bottom: 4px;
  font-weight: 600;
}

.resume .resume_left .resume_skills.languages ul li .skill_progress {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.resume .resume_left .resume_skills.languages ul li .skill_progress span {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  border-radius: 10px;
  display: block;
}

/* О себе / Личные качества */
.resume .resume_left .resume_about p {
  color: var(--text-light);
  font-size: 10.5px;
  line-height: 1.5;
}

.resume .resume_left .resume_about p strong {
  color: #ffffff;
  font-weight: 600;
}

/* Правая колонка (Основная информация) */
.resume .resume_right {
  width: calc(var(--resume-width) - var(--sidebar-width));
  background: #ffffff;
  padding: 30px 32px;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.resume .resume_right .resume_item {
  padding: 0;
  border-bottom: 0;
}

/* Заголовок разделов в правой колонке */
.resume .resume_right .title {
  margin-bottom: 18px;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 8px;
}

.resume .resume_right .title .bold {
  font-size: 14px;
  color: var(--text-dark);
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  position: relative;
  display: inline-block;
}

.resume .resume_right .title .bold::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 45px;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  border-radius: 2px;
}

/* Опыт работы - Таймлайн */
.resume .resume_right .resume_work > ul {
  position: relative;
  padding-left: 25px;
  margin: 0;
  list-style: none;
}

.resume .resume_right .resume_work > ul::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: #e2e8f0;
}

.resume .resume_right .resume_work > ul > li {
  position: relative;
  margin-bottom: 14px;
  list-style: none;
}

.resume .resume_right .resume_work > ul > li:last-child {
  margin-bottom: 0;
}

/* Точки таймлайна */
.resume .resume_right .resume_work > ul > li::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--primary);
  z-index: 2;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  transition: var(--transition);
}



.resume .resume_right .resume_work ul li .date {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
  padding: 1px 8px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 14px;
}

.resume .resume_right .resume_work ul li .info {
  margin-bottom: 0;
}

.resume .resume_right .resume_work ul li .info .semi-bold {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1px;
}

.resume .resume_right .resume_work ul li .info .department-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  font-style: normal;
  margin-bottom: 5px;
  display: inline-block;
}

.resume .resume_right .resume_work ul li .info ul.no-bullets {
  padding-left: 0;
}

.resume .resume_right .resume_work ul li .info ul.no-bullets li {
  font-size: 11px;
  color: #475569;
  margin-bottom: 3px;
  line-height: 1.4;
  position: relative;
  padding-left: 10px;
}

.resume .resume_right .resume_work ul li .info ul.no-bullets li:last-child {
  margin-bottom: 0;
}

.resume .resume_right .resume_work ul li .info ul.no-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 3.5px;
  height: 3.5px;
  border-radius: 50%;
  background: var(--primary);
}

/* Кнопка скачивания PDF в правом верхнем углу Work Experience */
#downloadPdf {
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--text-dark);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

#downloadPdf i {
  font-size: 12px;
  color: var(--primary);
  transition: color 0.25s ease;
}

#downloadPdf:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

#downloadPdf:hover i {
  color: #ffffff;
}

#downloadPdf:active {
  transform: translateY(1px);
}

/* Скрытие кнопки при экспорте в PDF через класс .exporting */
.resume.exporting #downloadPdf {
  display: none !important;
}

/* Flexbox выравнивание для заголовка правой колонки */
.resume .resume_right .title.header-title-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 8px;
}

/* Стили для печати через Ctrl+P / Cmd+P */
@media print {
  body {
    background: #ffffff !important;
    padding: 0 !important;
  }
  .resume-container {
    padding: 0 !important;
  }
  .resume {
    box-shadow: none !important;
    border-radius: 0 !important;
    transform: none !important;
    margin: 0 !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
  }
  #downloadPdf {
    display: none !important;
  }
  .resume .resume_left .resume_info ul li.phone-contact {
    display: flex !important;
  }
}

/* По умолчанию скрываем телефон на вебе */
.resume .resume_left .resume_info ul li.phone-contact {
  display: none !important;
}

/* Показываем телефон при экспорте в PDF через JS */
.resume.exporting .resume_left .resume_info ul li.phone-contact {
  display: flex !important;
}

/* Эффект размытия и затемнения сайта при открытой модалке */
body.modal-open .resume-container {
  filter: blur(8px) brightness(0.5);
  pointer-events: none;
}



.resume-container {
  transition: filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}



/* Модальное окно - Подложка */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 10, 19, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Карточка модалки */
.modal-card {
  width: 90%;
  max-width: 380px;
  background: linear-gradient(135deg, #090d16 0%, #111827 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(6, 182, 212, 0.15);
  border-radius: 16px;
  padding: 24px;
  transform: scale(0.9) translateY(10px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-header i {
  color: #06b6d4;
  font-size: 20px;
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.modal-header h3 {
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-body p {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.modal-body input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 14px;
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  transition: var(--transition);
}

.modal-body input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.modal-body .error-msg {
  color: #ef4444;
  font-size: 11px;
  margin-top: 8px;
  display: none;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.modal-footer button {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition);
}

#modalCancelBtn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}

#modalCancelBtn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.1);
}

#modalSubmitBtn {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.2);
}

#modalSubmitBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.35);
}

#modalSubmitBtn:active {
  transform: translateY(0);
}

/* ==========================================================================
   WYSIWYG Editor Styles
   ========================================================================== */

.editor-controls-overlay {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 1500;
  background: rgba(7, 10, 19, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(6, 182, 212, 0.15);
  border-radius: 14px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.editor-controls-overlay.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.editor-title {
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  padding-right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-title i {
  color: #06b6d4;
  font-size: 11px;
  animation: editorPulse 2s infinite ease-in-out;
  text-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}

@keyframes editorPulse {
  0% { opacity: 0.5; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0.5; transform: scale(0.95); }
}

.editor-btn {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.editor-btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.editor-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.editor-btn-primary {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.editor-btn-primary:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 15px rgba(6, 182, 212, 0.35);
}

/* Мягкая подсветка активной области редактирования */
[contenteditable="true"] {
  outline: none;
  transition: var(--transition);
  border-radius: 3px;
}

[contenteditable="true"]:hover {
  background: rgba(59, 130, 246, 0.06);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

[contenteditable="true"]:focus {
  background: rgba(59, 130, 246, 0.09);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

/* Кнопки управления элементами в DOM (+ / -) */
.editor-node-controls {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  gap: 5px;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  pointer-events: none;
}

/* Создаем невидимый мост для стабильного наведения и предотвращения исчезновения при движении мыши */
.editor-node-controls::before {
  content: '';
  position: absolute;
  top: -12px;
  bottom: -12px;
  left: -40px;
  right: -10px;
  z-index: -1;
  pointer-events: auto;
}

/* Показываем управление при наведении на элементы списков */
li:hover > .editor-node-controls,
.resume_left ul li:hover > .editor-node-controls,
.resume_right ul li:hover > .editor-node-controls {
  opacity: 1;
  pointer-events: auto;
}

/* Внутреннее позиционирование кнопок в режиме редактирования */
.resume.editing li {
  position: relative !important;
  padding-right: 65px !important; /* Space for the controls inside the li */
}

.resume.editing .editor-node-controls {
  right: 5px !important;
}

/* Перенос управления должностями на правую верхнюю часть карточки работы (предотвращает наложение) */
.resume.editing .resume_work > ul > li > .editor-node-controls {
  right: 5px !important;
  left: auto !important;
  top: 5px !important;
  transform: none !important;
}

.editor-action-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #ffffff;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
}

.btn-add-node {
  background: #10b981;
}

.btn-add-node:hover {
  background: #059669;
  transform: scale(1.15);
}

.btn-delete-node {
  background: #ef4444;
}

.btn-delete-node:hover {
  background: #dc2626;
  transform: scale(1.15);
}

/* Toast уведомление о сохранении */
.toast-notification {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  z-index: 2100;
  background: rgba(16, 185, 129, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
  border-radius: 50px;
  padding: 12px 28px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-notification.active {
  transform: translateX(-50%) translateY(0);
}

.toast-notification i {
  font-size: 13px;
}

/* Скрытие всех элементов редактора при экспорте */
.resume.exporting .editor-node-controls {
  display: none !important;
}

.resume.exporting [contenteditable="true"] {
  background: none !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Floating formatting toolbar for WYSIWYG editor */
.editor-rich-toolbar {
  position: absolute;
  background: rgba(7, 10, 19, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(6, 182, 212, 0.25);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  gap: 4px;
  z-index: 2000;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.editor-rich-toolbar.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.editor-rich-btn {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 11px;
  transition: var(--transition);
}

.editor-rich-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.editor-rich-btn.active {
  background: rgba(6, 182, 212, 0.2);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

/* Hide rich toolbar when exporting */
.resume.exporting .editor-rich-toolbar {
  display: none !important;
}

/* Guarantee deterministic click bubbling on overlay action buttons */
.editor-action-btn i,
.editor-action-btn svg,
.editor-action-btn path {
  pointer-events: none !important;
}

/* Premium Loader Styles */
body.loading {
  overflow: hidden; /* Prevent scrolling during hydration and loader animations */
}

.premium-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-loader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 10, 19, 0.75);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 1;
}

.loader-card {
  position: relative;
  z-index: 2;
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.75) 0%, rgba(9, 13, 22, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(59, 130, 246, 0.15);
  border-radius: 24px;
  padding: 40px;
  width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  animation: floatLoader 4s ease-in-out infinite;
}

.spinner-container {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-outer-ring {
  position: absolute;
  width: 90px;
  height: 90px;
  border: 3px solid rgba(59, 130, 246, 0.08);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spinClockwise 1.4s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.25);
}

.spinner-inner-ring {
  position: absolute;
  width: 74px;
  height: 74px;
  border: 2px solid rgba(6, 182, 212, 0.05);
  border-bottom: 2px solid #06b6d4;
  border-radius: 50%;
  animation: spinCounterClockwise 1s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

.loader-avatar-container {
  position: absolute;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.loader-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.loader-text {
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  animation: textPulse 1.8s ease-in-out infinite;
  text-align: center;
  margin-top: 5px;
  white-space: nowrap;
}

.loader-subtext {
  color: #64748b;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-align: center;
}

@keyframes spinClockwise {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes spinCounterClockwise {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

@keyframes textPulse {
  0%, 100% { opacity: 0.6; filter: drop-shadow(0 0 0px rgba(59, 130, 246, 0)); }
  50% { opacity: 1; filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.4)); }
}

@keyframes floatLoader {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ==========================================================================
   Advanced Visual Editor Features
   ========================================================================== */

/* Visual Drag-and-Drop Handles */
.editor-drag-handle {
  cursor: grab !important;
  color: #64748b;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  opacity: 0.3;
  transition: opacity 0.2s, color 0.2s;
  flex-shrink: 0;
  vertical-align: middle;
  pointer-events: auto !important;
}

li:hover > .editor-drag-handle,
.title:hover > .editor-drag-handle {
  opacity: 0.8;
}

.editor-drag-handle:hover {
  opacity: 1 !important;
  color: var(--primary-light) !important;
}

.editor-drag-handle:active {
  cursor: grabbing !important;
}

/* Hide handles on print/export */
.resume.exporting .editor-drag-handle,
.resume.exporting .editor-delete-section-btn,
.resume.exporting .editor-add-section-container,
.resume.exporting .editor-add-job-container {
  display: none !important;
}

/* Section Position adjustments for deletion */
.resume_item {
  position: relative !important;
}

/* Deletion Button Overlay */
.editor-delete-section-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(239, 68, 68, 0.95);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.2s ease-in-out, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 100;
  pointer-events: auto !important;
}

.resume_item:hover > .editor-delete-section-btn {
  opacity: 1;
  transform: scale(1);
}

.editor-delete-section-btn:hover {
  background: #ef4444;
  transform: scale(1.15);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.editor-delete-section-btn i {
  pointer-events: none !important;
}

/* Interactive Progress Slider Range */
.editor-progress-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 55px;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  outline: none;
  cursor: pointer;
  margin-right: 8px;
  display: inline-block;
  vertical-align: middle;
  pointer-events: auto !important;
  transition: background 0.2s;
}

.editor-progress-slider:hover {
  background: rgba(255, 255, 255, 0.25);
}

.editor-progress-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-light);
  box-shadow: 0 0 6px var(--primary);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.editor-progress-slider::-webkit-slider-thumb:hover {
  transform: scale(1.35);
}

/* Section Addition Controllers */
.editor-add-section-container {
  display: flex;
  justify-content: center;
  padding: 12px 0;
  width: 100%;
  position: relative;
}

.btn-add-section {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  width: 85%;
  justify-content: center;
  pointer-events: auto !important;
}

.resume_right .btn-add-section {
  background: rgba(15, 23, 42, 0.02);
  border: 1px dashed rgba(15, 23, 42, 0.15);
  color: #64748b;
}

.btn-add-section:hover {
  background: rgba(6, 182, 212, 0.12);
  border-color: #06b6d4;
  color: #ffffff;
  transform: translateY(-1.5px);
  box-shadow: 0 5px 12px rgba(6, 182, 212, 0.15);
}

.resume_right .btn-add-section:hover {
  color: var(--primary);
  background: rgba(59, 130, 246, 0.04);
  border-color: var(--primary);
  box-shadow: 0 5px 12px rgba(59, 130, 246, 0.08);
}

.btn-add-section i {
  font-size: 11px;
}

/* Dropdown Menu for Section Layout Choices */
.editor-section-selector-menu {
  position: absolute;
  bottom: 45px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(7, 10, 19, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(6, 182, 212, 0.2);
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 1200;
  width: 210px;
  animation: selectorMenuOpen 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto !important;
}

@keyframes selectorMenuOpen {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.95); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.editor-section-selector-menu .menu-item {
  padding: 8px 12px;
  color: #cbd5e1;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 5px;
  transition: var(--transition);
  text-align: left;
}

.editor-section-selector-menu .menu-item:hover {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  color: #ffffff;
}

/* SortableJS Ghost Drag Placeholder */
.sortable-ghost {
  opacity: 0.3 !important;
  background: rgba(59, 130, 246, 0.15) !important;
  border: 2px dashed var(--primary) !important;
}

/* CV Last Modified Footer Stamp */
.cv-footer {
  margin-top: auto !important; /* Push dynamically to the very bottom of the right column */
  padding-top: 10px;
  text-align: right;
  font-size: 8.5px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  border-top: 1px solid #f1f5f9;
  width: 100%;
}

/* Hide footer completely in the high-fidelity exported A4 PDF */
.resume.exporting .cv-footer {
  display: none !important;
}

/* Кнопка добавления новой работы над таймлайном */
.editor-add-job-container {
  display: flex;
  justify-content: center;
  margin-top: 10px;
  margin-bottom: 20px;
  width: 100%;
}

.btn-add-job-experience {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12) 0%, rgba(59, 130, 246, 0.12) 100%);
  border: 1px dashed rgba(59, 130, 246, 0.35);
  border-radius: 12px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 10px 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.03);
}

.btn-add-job-experience:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.22) 0%, rgba(59, 130, 246, 0.22) 100%);
  border-color: var(--primary);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 15px rgba(59, 130, 246, 0.12);
  color: var(--primary-light);
}

.btn-add-job-experience i {
  font-size: 13px;
}