/* =============================================
   RESUME PANEL STYLES - Точный дизайн
   ============================================= */

/* Панель резюме - занимает всё пространство от sidebar до правого края */
.resume-panel {
    position: fixed;
    top: 0;
    left: 305px; /* Ширина sidebar + 5px для тени sidebar */
    right: 60px; /* Оставляем место для правой панели кнопок */
    width: auto;
    height: 100vh;
    background: white;
    box-shadow: none;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    overflow: hidden;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

.resume-panel.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* Когда sidebar свёрнут */
aside#sidebar.collapsed ~ .chat-wrapper .resume-panel,
.resume-panel.sidebar-collapsed {
    left: 65px; /* 60px collapsed sidebar + 5px для тени */
}

/* Затемнение фона - не нужно, панель перекрывает чат полностью */
.resume-panel-overlay {
    display: none;
}

/* =============================================
   HEADER
   ============================================= */

.resume-panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 32px;
    border-bottom: none;
    flex-shrink: 0;
    background: white;
}

.resume-panel-back {
    width: 45px;
    height: 27px;
    border: 2.5px solid #ECEEFF;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3F3FE6;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.resume-panel-back svg {
    width: 16px;
    height: 12px;
}

.resume-panel-back:hover {
    background: #F2F4FF;
    border-color: #B7BEFF;
}

.resume-panel-title {
    font-family: 'Century Gothic', 'Manrope', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: black;
    margin: 0;
}

/* =============================================
   CONTENT AREA
   ============================================= */

/* Обёртка: занимает всё доступное место, но padding-right сдвигает
   scrollbar от правого края — как на Figma (scrollbar не прижат). */
.resume-panel-scroll-area {
    flex: 1;
    padding-right: 50px;
    overflow: hidden;
    min-height: 0;
    position: relative;
}

/* Забеление сверху — плавный переход от header к контенту при прокрутке */
.resume-panel-scroll-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 50px;
    height: 28px;
    background: linear-gradient(to bottom, white 0%, rgba(255,255,255,0) 100%);
    z-index: 2;
    pointer-events: none;
}

.resume-panel-content {
    height: 100%;
    overflow-y: auto;
    padding: 28px 70px 60px 40px;
    background: white;
}

.resume-panel-content::-webkit-scrollbar {
    width: 6px;
}

.resume-panel-content::-webkit-scrollbar-thumb {
    background: #B8B9F7;
    border-radius: 10px;
}

.resume-panel-content::-webkit-scrollbar-track {
    background: #ECEEFF;
    border-radius: 10px;
    /* Scrollbar не до самого края — отступ сверху и снизу как на Figma */
    margin-top: 32px;
    margin-bottom: 40px;
}

/* =============================================
   SECTION TITLES
   ============================================= */

.resume-section-title {
    font-family: 'Manrope', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: black;
    margin: 0 0 14px 0;
}

.resume-section {
    margin-bottom: 24px;
}

.resume-section:last-child {
    margin-bottom: 0;
}

.resume-section:first-child .resume-section-title {
    margin-bottom: 16px;
}

/* =============================================
   ОБЩАЯ ИНФОРМАЦИЯ - Header с аватаром
   ============================================= */

.resume-info-header {
    display: flex;
    gap: 24px;
    margin-bottom: 0;
}

.resume-avatar {
    width: 143px;
    height: 143px;
    min-width: 143px;
    border-radius: 200px;
    background: #3F3FE6;
    box-shadow: 0 0 4px 0 rgba(183, 190, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.resume-avatar svg {
    width: 74px;
    height: 74px;
    color: white;
}

.resume-avatar-icon {
    font-size: 36px;
    color: white;
    font-weight: bold;
}

.resume-info-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.resume-info-row {
    display: flex;
    gap: 10px;
}

/* =============================================
   FIELD CARDS - Поля в рамках
   ============================================= */

.resume-field {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 8px 13px;
    border: 2px solid #ECEEFF;
    border-radius: 15px;
    background: white;
    min-width: 0;
    min-height: 57px;
    box-sizing: border-box;
    overflow: hidden;
}

.resume-field.flex-1 {
    flex: 1;
}

.resume-field.flex-2 {
    flex: 2;
}

.resume-field.flex-3 {
    flex: 3;
}

.resume-field-label {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.5);
}

.resume-field-value {
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: black;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resume-field-value.highlighted {
    color: #3F3FE6;
    font-weight: 600;
}

/* =============================================
   GRID LAYOUTS
   ============================================= */

.resume-fields-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.resume-fields-row {
    display: flex;
    gap: 12px;
}

.resume-fields-row.three-cols > .resume-field {
    flex: 1;
}

.resume-fields-row.two-cols > .resume-field {
    flex: 1;
}

/* =============================================
   ТЕХНИЧЕСКИЕ НАВЫКИ
   ============================================= */

.resume-skills-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Группа навыков: название и теги в одном flex-wrap.
   Первые теги — рядом с названием; при переносе —
   от левого края на полную ширину (нет пустоты слева). */
.resume-skill-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 2px solid #ECEEFF;
}

.resume-skill-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.resume-skill-category {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: black;
    flex-shrink: 0;
    padding-top: 4px;
}

/* Кнопка «Удалить раздел» — видна только для пустых разделов */
.section-delete-btn {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border: 2px dashed #FECACA;
    border-radius: 30px;
    background: transparent;
    color: #DC2626;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.section-delete-btn:hover {
    background: #FEE2E2;
    border-color: #DC2626;
}

/* Кнопка × на теге для удаления навыка */
.skill-remove-btn {
    display: none;
    margin-left: 4px;
    background: none;
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.7;
    padding: 0 2px;
    line-height: 1;
}

.skill-remove-btn:hover {
    opacity: 1;
}

.resume-skill-tag:hover .skill-remove-btn,
.resume-skill-tag:hover .item-remove-btn {
    display: inline;
}

/* × на item-тегах (языки, достижения) — тот же стиль что у навыков */
.item-remove-btn {
    display: none;
    margin-left: 4px;
    background: none;
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.7;
    padding: 0 2px;
    line-height: 1;
}

.item-remove-btn:hover {
    opacity: 1;
}

/* + для добавления item (языки, достижения) — тот же стиль что у навыков */
.item-add-inline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 2px dashed #B7BEFF;
    border-radius: 50%;
    background: transparent;
    color: #3F3FE6;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.item-add-inline-btn:hover {
    background: #F2F4FF;
    border-color: #3F3FE6;
}

/* Кнопка + inline в группе навыков */
.skill-add-inline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 2px dashed #B7BEFF;
    border-radius: 50%;
    background: transparent;
    color: #3F3FE6;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.skill-add-inline-btn:hover {
    background: #F2F4FF;
    border-color: #3F3FE6;
}

/* Тег-плейсхолдер при загрузке (LLM проверяет) */
.resume-skill-tag.skill-loading {
    opacity: 0.7;
    pointer-events: none;
}

.skill-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: resume-spin 0.6s linear infinite;
    margin-left: 4px;
    vertical-align: middle;
}

/* Input добавления навыка (inline в группе) */
.resume-skill-add-input.inline {
    height: 28px;
    width: 140px;
    padding: 0 12px;
    border: 2px solid #3F3FE6;
    border-radius: 30px;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 700;
    outline: none;
    background: white;
}

.resume-skill-add-input.inline::placeholder {
    color: rgba(0, 0, 0, 0.3);
    font-weight: 400;
}

/* Кнопка + Добавить раздел */
.resume-add-section-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    padding: 6px 16px;
    border: 2px dashed #ECEEFF;
    border-radius: 15px;
    background: transparent;
    color: #3F3FE6;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.resume-add-section-btn:hover {
    background: #F2F4FF;
    border-color: #B7BEFF;
}

.resume-add-section-input-wrap {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 12px;
}

.resume-add-section-input {
    flex: 1;
    height: 34px;
    padding: 0 14px;
    border: 2px solid #3F3FE6;
    border-radius: 15px;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    background: white;
}

.resume-add-section-input::placeholder {
    color: rgba(0, 0, 0, 0.3);
    font-weight: 400;
}

/* display: contents — теги становятся прямыми flex-items
   родительского .resume-skill-row. Первые помещаются рядом
   с названием категории, остальные wrap'аются от левого края. */
.resume-skill-tags {
    display: contents;
}

/* Контейнер тегов для секции «Языки» (не внутри skill-row,
   поэтому нужен собственный flex + gap). */
.resume-languages-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.resume-skill-tag {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 16px;
    border-radius: 30px;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 700;
    background: #B7BEFF;
    color: white;
    transition: transform 0.15s ease;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
}

.resume-skill-tag:hover {
    transform: translateY(-1px);
}

/* Все теги одного цвета по Figma — оставляем классы для обратной
   совместимости, но цвет единый. */
.resume-skill-tag.blue,
.resume-skill-tag.green,
.resume-skill-tag.purple,
.resume-skill-tag.teal,
.resume-skill-tag.orange,
.resume-skill-tag.pink {
    background: #B7BEFF;
    color: white;
}

/* =============================================
   СПЕЦИАЛИЗАЦИЯ
   ============================================= */

.resume-specialization-grid {
    display: flex;
    gap: 12px;
}

.resume-specialization-grid .resume-field {
    flex: 1;
}

/* =============================================
   ПРОЕКТЫ
   ============================================= */

.resume-projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    gap: 12px;
}

.resume-project-card {
    border: 2px solid #ECEEFF;
    border-radius: 15px;
    padding: 6px 13px 10px;
    background: white;
    position: relative;
}

.resume-project-card .project-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    display: none;
    background: #FEE2E2;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    color: #DC2626;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.resume-project-card:hover .project-remove {
    display: flex;
}

.resume-project-card.editing-card {
    border-style: dashed;
    border-color: #3F3FE6;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 83px;
}

/* Название проекта — жирный, как resume-project-title */
.resume-project-card.editing-card .achievement-inline-input:first-child {
    font-size: 16px;
    font-weight: 600;
    color: black;
}

/* Описание — обычный, как resume-project-description */
.resume-project-card.editing-card .achievement-inline-input:nth-child(2) {
    font-size: 14px;
    font-weight: 400;
    color: black;
}

.resume-project-card.skill-loading {
    animation: card-pulse 1.2s ease-in-out infinite;
}

.resume-project-title {
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: black;
    margin: 0 0 4px 0;
}

.resume-project-description {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    color: black;
    margin: 0;
    line-height: 18px;
}

/* Для проектов с полной шириной */
.resume-project-card.full-width {
    grid-column: 1 / -1;
}

/* =============================================
   ДОСТИЖЕНИЯ
   ============================================= */

.resume-achievements-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;  /* все строки одинаковой высоты */
    gap: 12px;
}

.resume-achievement-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    border: 2px solid #ECEEFF;
    border-radius: 15px;
    padding: 8px 13px;
    background: white;
    min-height: 52px;
    box-sizing: border-box;
}

.resume-achievement-icon {
    width: 23px;
    height: 33px;
    min-width: 23px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.resume-achievement-icon svg {
    width: 23px;
    height: 33px;
    color: #3F3FE6;
}

.resume-achievement-text {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: black;
    line-height: 18px;
}

.resume-achievement-text strong {
    font-weight: 600;
}

/* × на карточке достижения */
.achievement-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    display: none;
    background: #FEE2E2;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    color: #DC2626;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.resume-achievement-card {
    position: relative;
}

.resume-achievement-card:hover .achievement-remove {
    display: flex;
}

/* Input/textarea внутри карточки достижения/проекта */
.achievement-inline-input {
    flex: 1;
    border: none;
    outline: none;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: black;
    background: transparent;
    line-height: 18px;
    resize: none;
    min-height: 18px;
    overflow: hidden;
    word-wrap: break-word;
}

.achievement-inline-input::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

.resume-achievement-card.editing-card {
    border-style: dashed;
    border-color: #3F3FE6;
}

.resume-achievement-card.skill-loading {
    animation: card-pulse 1.2s ease-in-out infinite;
}

@keyframes card-pulse {
    0%, 100% { border-color: #ECEEFF; opacity: 0.7; }
    50%      { border-color: #B7BEFF; opacity: 1; }
}

/* Кнопка «+ Добавить» для карточек */
.item-add-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    border: 2px dashed #ECEEFF;
    border-radius: 15px;
    background: transparent;
    color: #3F3FE6;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.item-add-card-btn:hover {
    background: #F2F4FF;
    border-color: #B7BEFF;
}

/* =============================================
   ССЫЛКИ
   ============================================= */

.resume-links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.resume-link-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 16px;
    border: 2px solid #ECEEFF;
    border-radius: 30px;
    background: white;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #3F3FE6;
    text-decoration: none;
    transition: all 0.2s ease;
}

.resume-link-tag:hover {
    background: #F2F4FF;
    border-color: #B7BEFF;
}

.resume-link-tag svg {
    flex-shrink: 0;
}

.link-remove-btn {
    display: none;
    margin-left: 2px;
    background: none;
    border: none;
    color: #DC2626;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.resume-link-tag:hover .link-remove-btn {
    display: inline;
}

.link-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 2px dashed #ECEEFF;
    border-radius: 50%;
    background: transparent;
    color: #3F3FE6;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.link-add-btn:hover {
    background: #F2F4FF;
    border-color: #B7BEFF;
}

.link-add-wrap {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* =============================================
   ДОПОЛНИТЕЛЬНО
   ============================================= */

.resume-other-block {
    border: 2px solid #ECEEFF;
    border-radius: 15px;
    padding: 12px 16px;
    background: white;
    position: relative;
    min-height: 52px;
}

.placeholder-text {
    color: rgba(0, 0, 0, 0.3) !important;
    font-style: italic;
}

.resume-other-text {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: black;
    line-height: 1.6;
    margin: 0;
    white-space: pre-line;
}

/* Textarea для inline-edit «Дополнительно» */
.resume-edit-textarea {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: black;
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    padding: 0;
    margin: 0;
    line-height: 1.6;
    resize: none;
    min-height: 100px;
}

.resume-edit-textarea::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

/* Обёртка textarea: textarea сверху, кнопки снизу справа */
.resume-other-block .resume-edit-wrap {
    flex-direction: column;
    align-items: stretch;
}

.resume-other-block .resume-edit-wrap .resume-edit-textarea {
    width: 100%;
}

/* Кнопки ✓/✕ внизу справа под textarea */
.resume-other-block .resume-edit-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.resume-other-block .resume-edit-btns {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

/* =============================================
   INLINE EDIT — Notion-style
   ============================================= */

/* Editable поле — position relative для кнопки карандаша */
[data-editable] {
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Кнопка карандаша — появляется при hover на поле */
.resume-edit-pencil {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 6px;
    background: #F2F4FF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
    padding: 0;
}

[data-editable]:hover .resume-edit-pencil {
    opacity: 1;
}

.resume-edit-pencil:hover {
    background: #ECEEFF;
}

.resume-edit-pencil svg {
    width: 12px;
    height: 12px;
    color: #3F3FE6;
}

/* Режим редактирования */
.resume-field.editing {
    border-color: #3F3FE6;
    box-shadow: 0 0 0 2px rgba(63, 63, 230, 0.15);
}

.resume-field.editing::after {
    display: none;
}

/* Input внутри поля при редактировании */
.resume-edit-input {
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: black;
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    padding: 0;
    margin: 0;
    line-height: 1.4;
}

.resume-edit-input::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

/* Select для dropdown полей */
.resume-edit-select {
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: black;
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    padding: 0;
    margin: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

/* Обёртка input + кнопки ✓/✕ */
.resume-edit-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.resume-edit-wrap .resume-edit-input,
.resume-edit-wrap .resume-edit-select {
    flex: 1;
    min-width: 0;
}

/* Кнопки ✓ и ✕ */
.resume-edit-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.resume-edit-btn.save {
    background: #DCFCE7;
    color: #16A34A;
}

.resume-edit-btn.save:hover {
    background: #BBF7D0;
}

.resume-edit-btn.cancel {
    background: #FEE2E2;
    color: #DC2626;
}

.resume-edit-btn.cancel:hover {
    background: #FECACA;
}

/* Спиннер при LLM-нормализации */
.resume-edit-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #ECEEFF;
    border-top-color: #3F3FE6;
    border-radius: 50%;
    animation: resume-spin 0.6s linear infinite;
}

/* Flash зелёный при сохранении */
.resume-field.save-success {
    border-color: #22C55E;
    transition: border-color 0.1s ease;
}

/* Flash красный при ошибке */
.resume-field.save-error {
    border-color: #EF4444;
    transition: border-color 0.1s ease;
}

/* =============================================
   LOADING & EMPTY STATES
   ============================================= */

.resume-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.resume-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #ECEEFF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: resume-spin 0.8s linear infinite;
}

@keyframes resume-spin {
    to {
        transform: rotate(360deg);
    }
}

.resume-loading-text {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    color: rgba(0,0,0,0.5);
    margin-top: 16px;
}

.resume-error {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    color: #B91C1C;
    padding: 16px 0;
}

.resume-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.resume-empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    color: #ECEEFF;
}

.resume-empty-text {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    color: rgba(0,0,0,0.3);
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 1100px) {
    .resume-avatar {
        width: 100px;
        height: 100px;
        min-width: 100px;
    }

    .resume-avatar svg {
        width: 50px;
        height: 50px;
    }

    .resume-field {
        height: auto;
        min-height: 48px;
    }

    .resume-skill-tag {
        font-size: 14px;
        padding: 0 14px;
    }

    .resume-skill-category {
        font-size: 14px;
        min-width: 140px;
    }
}

@media (max-width: 900px) {
    .resume-panel-content {
        padding: 24px 20px;
    }

    .resume-panel-title {
        font-size: 22px;
    }

    .resume-avatar {
        width: 80px;
        height: 80px;
        min-width: 80px;
    }

    .resume-avatar svg {
        width: 40px;
        height: 40px;
    }

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

    .resume-achievements-grid {
        flex-direction: column;
    }

    .resume-fields-row.three-cols {
        flex-wrap: wrap;
    }

    .resume-fields-row.three-cols > .resume-field {
        min-width: calc(50% - 6px);
    }
}

@media (max-width: 768px) {
    .resume-panel {
        left: 0;
        right: 0;
    }

    .resume-panel-content {
        padding: 16px;
    }

    .resume-panel-title {
        font-size: 20px;
    }

    .resume-info-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .resume-avatar {
        width: 90px;
        height: 90px;
        min-width: 90px;
    }

    .resume-info-fields {
        width: 100%;
    }

    .resume-fields-row {
        flex-direction: column;
    }

    .resume-field {
        height: auto;
        min-height: 44px;
    }

    .resume-field-label {
        font-size: 12px;
    }

    .resume-field-value {
        font-size: 14px;
    }

    .resume-skill-row {
        flex-direction: column;
        gap: 8px;
    }

    .resume-skill-category {
        min-width: auto;
        font-size: 14px;
    }

    .resume-skill-tag {
        font-size: 13px;
        height: 24px;
        padding: 0 12px;
    }

    .resume-specialization-grid {
        flex-direction: column;
    }

    .resume-section-title {
        font-size: 16px;
    }

    /* Панель — без горизонтального скролла */
    .resume-panel,
    .resume-panel-content {
        overflow-x: hidden !important;
    }

    /* Sidebar collapsed — тоже fullscreen */
    .resume-panel.sidebar-collapsed {
        left: 0 !important;
        right: 0 !important;
    }

    /* Поля информации — всё в столбик */
    .resume-fields-row,
    .resume-fields-row.three-cols,
    .resume-fields-row.two-cols {
        flex-direction: column !important;
    }

    /* Образование — 1 колонка */
    .resume-projects-grid {
        grid-template-columns: 1fr !important;
    }

    /* Достижения — 1 колонка */
    .resume-achievements-grid {
        grid-template-columns: 1fr !important;
    }

    /* Карточки — ограничиваем ширину */
    .resume-project-card,
    .resume-achievement-card {
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        word-break: break-word;
    }

    /* Текст достижений — не вылезает */
    .resume-achievement-text {
        overflow: hidden;
        word-break: break-word;
    }

    /* Специализация — в столбик */
    .resume-specialization-grid {
        flex-direction: column !important;
    }

    /* Общая информация — ряды в столбик */
    .resume-info-row {
        flex-direction: column !important;
    }

    /* Поля — центрированы, полная ширина */
    .resume-field {
        text-align: center !important;
        align-items: center !important;
        flex: none !important;
        width: 100% !important;
    }

    /* Поля — текст переносится вместо обрезки */
    .resume-field-value {
        white-space: normal !important;
        word-break: break-word;
    }

    /* Поля образования — полная ширина */
    .resume-field {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box;
    }
}

/* Скрытие секций без данных */
.resume-section.hidden {
    display: none;
}

/* =============================================
   READONLY MODE — для HR-просмотра чужого резюме
   ============================================= */

/* Блокировка кликов */
.resume-panel-readonly [data-editable] {
    pointer-events: none;
}

/* Скрытие всех интерактивных элементов */
.resume-panel-readonly .resume-edit-pencil,
.resume-panel-readonly .skill-remove-btn,
.resume-panel-readonly .skill-add-inline-btn,
.resume-panel-readonly .resume-skill-add-btn,
.resume-panel-readonly .resume-section-add-btn,
.resume-panel-readonly .resume-add-section-btn,
.resume-panel-readonly .resume-section-delete-btn,
.resume-panel-readonly .resume-add-card,
.resume-panel-readonly .item-remove-btn,
.resume-panel-readonly .item-add-card-btn,
.resume-panel-readonly .item-add-inline-btn,
.resume-panel-readonly .resume-link-remove-btn,
.resume-panel-readonly .link-add-btn {
    display: none !important;
}

