/* =============================================
   HR VACANCIES PANEL — все вакансии пользователя
   ============================================= */

.hr-vacancies-panel {
    position: fixed;
    top: 0;
    left: 300px;
    right: 60px; /* место для правых кнопок */
    height: 100vh;
    background: #FFFFFF;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
}

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

aside#sidebar.collapsed ~ .chat-wrapper .hr-vacancies-panel,
.hr-vacancies-panel.sidebar-collapsed {
    left: 60px;
}

/* ─── Header ─── */

.hr-vacancies-panel-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 40px;
    flex-shrink: 0;
    background: #FFFFFF;
}

.hr-vacancies-panel-back {
    width: 45px;
    height: 27px;
    border: 2.5px solid #ECEEFF;
    background: #fff;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    flex-shrink: 0;
    color: #3F3FE6;
}

.hr-vacancies-panel-back:hover {
    border-color: #B7BEFF;
    background: #F8F9FC;
}

.hr-vacancies-panel-title {
    font-family: 'CenturyGothicBold', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #000;
    margin: 0;
}

/* ─── Body ─── */

.hr-vacancies-panel-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 40px 32px;
    mask-image: linear-gradient(to bottom, transparent 0px, #000 24px);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0px, #000 24px);
}

.hrv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* ─── Карточка вакансии ─── */

.hrv-card {
    background: #fff;
    border-radius: 20px;
    border: none;
    padding: 20px 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
    min-width: 0;
    box-shadow: 0 0 6px rgba(69, 22, 200, 0.2);
    transition: box-shadow 0.2s;
}

.hrv-card:hover {
    box-shadow: 0 2px 12px rgba(69, 22, 200, 0.3);
}

/* Название — максимум 2 строки */
.hrv-card-title {
    font-family: 'CenturyGothicBold', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #000;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Ряд тегов + сердечко — строго одна строка */
.hrv-card-tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    overflow: hidden;
    min-height: 28px;
}

.hrv-tag {
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.7em;
    border: none;
    background: rgba(183, 190, 255, 0.15);
    color: #888;
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Сердце с числом — всегда в конце ряда тегов */
.hrv-card-favorites {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: auto;
}

.hrv-card-favorites img {
    width: 18px;
    height: 18px;
}

.hrv-card-favorites-count {
    font-size: 0.85em;
    font-weight: 600;
    color: #E74C3C;
}

.hrv-card-favorites--zero .hrv-card-favorites-count {
    color: #bbb;
}

/* Зарплата — 1 строка */
.hrv-card-salary {
    font-size: 0.95em;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 1.3em;
}

/* Компания + город — фиксированные 2 строки */
.hrv-card-company {
    font-size: 0.82em;
    color: #999;
    line-height: 1.5;
    min-height: 2.46em; /* 2 строки × 0.82em × 1.5 line-height */
}

.hrv-card-company-name {
    font-weight: 500;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Кнопки */
.hrv-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: auto;
    padding-top: 6px;
    flex-wrap: nowrap;
}

.hrv-btn-candidates,
.hrv-btn-details {
    flex-shrink: 0;
}

.hrv-btn-candidates {
    padding: 4px 15px;
    border: none;
    border-radius: 10px;
    background: #3F3FE6;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Manrope', sans-serif;
    transition: background 0.15s;
    height: 25px;
}

.hrv-btn-candidates:hover {
    background: #3535C7;
}

.hrv-btn-details {
    padding: 4px 15px;
    border: none;
    border-radius: 10px;
    background: rgba(63, 63, 230, 0.3);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Manrope', sans-serif;
    transition: background 0.15s;
    height: 25px;
}

.hrv-btn-details:hover {
    background: rgba(63, 63, 230, 0.4);
}

.hrv-btn-delete {
    margin-left: auto;
    background: #F4F6FF;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.hrv-btn-delete img {
    width: 16px;
    height: 18px;
    opacity: 0.5;
}

.hrv-btn-delete:hover {
    background: #ECEEFF;
}

.hrv-btn-delete:hover img {
    opacity: 0.8;
}

/* Пустые значения — тот же стиль, но приглушённая непрозрачность */
.hrv-card-empty {
    opacity: 0.35;
}

/* =============================================
   МОДАЛЬНОЕ ОКНО — подробности вакансии
   ============================================= */

.hrv-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

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

.hrv-modal {
    background: #fff;
    border-radius: 20px;
    width: 560px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    padding: 36px 40px 32px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
    font-family: 'Manrope', sans-serif;
    transform: translateY(12px);
    transition: transform 0.2s ease;
}

.hrv-modal-overlay.open .hrv-modal {
    transform: translateY(0);
}

/* Заголовок модалки */
.hrv-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.hrv-modal-title {
    font-size: 1.35em;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
    flex: 1;
    padding-right: 16px;
}

.hrv-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #F2F4FF;
    border-radius: 50%;
    font-size: 1.1em;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
    line-height: 1;
    font-family: inherit;
}

.hrv-modal-close:hover {
    background: #E0E0F0;
}

/* Теги в модалке */
.hrv-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.hrv-modal-tag {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.82em;
    background: rgba(183, 190, 255, 0.15);
    color: #666;
}

/* Блоки информации */
.hrv-modal-section {
    margin-bottom: 18px;
}

.hrv-modal-section-title {
    font-size: 0.78em;
    font-weight: 600;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.hrv-modal-section-value {
    font-size: 0.95em;
    color: #333;
    line-height: 1.5;
}

/* Сетка: 2 столбца для коротких полей */
.hrv-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

/* Разделитель */
.hrv-modal-divider {
    height: 1px;
    background: #F0F0F0;
    margin: 20px 0;
}

/* Профессиональные данные (вопрос-ответ) */
.hrv-modal-qa {
    margin-bottom: 12px;
}

.hrv-modal-qa-question {
    font-size: 0.85em;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.hrv-modal-qa-answer {
    font-size: 0.9em;
    color: #333;
    line-height: 1.5;
}

/* Пустое состояние */
.hrv-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    color: #bbb;
    font-size: 1em;
}

/* Mobile */
@media (max-width: 768px) {
    .hr-vacancies-panel {
        left: 0;
        right: 0;
    }
    .hrv-grid {
        grid-template-columns: 1fr;
    }
    .hrv-card-actions {
        flex-wrap: wrap;
    }
    .hrv-card-actions button {
        min-height: 44px;
    }
}

/* ─── hh.ru: красный — смысловой акцент «внешний источник».
   Определяется один раз, используется во всех HH-элементах панели. ─── */
.hr-vacancies-panel {
    --hh-accent: #D6001C;
    --hh-accent-soft: rgba(214, 0, 28, 0.08);
}

/* Кнопка импорта с hh.ru в шапке панели */
.hrv-btn-hh-import {
    margin-left: auto;
    padding: 8px 16px;
    border: 1px solid var(--hh-accent);
    border-radius: 8px;
    background: #fff;
    color: var(--hh-accent);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.hrv-btn-hh-import:hover {
    background: var(--hh-accent);
    color: #fff;
}

/* HH-чип «hh.ru N» в верхнем ряду карточки — компактный маркер откликов.
   Прижат вправо к «сердцу», высоту карточки не меняет. */
.hrv-card-hh-chip {
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 1px solid var(--hh-accent);
    border-radius: 20px;
    background: #fff;
    color: var(--hh-accent);
    font-family: 'Manrope', sans-serif;
    font-size: 0.7em;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.15s;
}

.hrv-card-hh-chip:hover {
    background: var(--hh-accent-soft);
}

.hrv-card-hh-chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 10px;
    background: var(--hh-accent);
    color: #fff;
    font-size: 0.92em;
}

/* Кнопка синхронизации в модалке откликов */
.hrv-hh-sync {
    margin-bottom: 12px;
}

/* Список откликов в модалке */
.hrv-hh-list {
    max-height: 60vh;
    overflow-y: auto;
}

.hrv-hh-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #F1F2FF;
}

.hrv-hh-row:last-child {
    border-bottom: none;
}

.hrv-hh-row--clickable {
    cursor: pointer;
}

.hrv-hh-name {
    font-weight: 600;
}

.hrv-hh-meta {
    font-size: 13px;
    color: #888;
}

/* Статусные бейджи откликов — мягкие тинты в палитре панели */
.hrv-tag--invited {
    background: rgba(255, 176, 32, 0.15);
    color: #9A6700;
}

.hrv-tag--success {
    background: rgba(45, 190, 120, 0.15);
    color: #1B7A4B;
}

/* Ссылка на оригинал резюме на hh.ru */
.hrv-hh-link {
    display: inline-block;
    margin-top: 12px;
    color: var(--hh-accent);
    font-weight: 600;
}

/* Кнопка на всю ширину в модалке (приглашение) */
.hrv-btn-block {
    display: block;
    width: 100%;
    margin-top: 16px;
}

/* Модалка приглашения кандидата */
.hrv-hh-hint {
    font-size: 13px;
    color: #888;
    margin: 0 0 8px;
}

.hrv-hh-textarea {
    width: 100%;
    min-height: 140px;
    padding: 10px;
    border: 1px solid var(--border-input, rgba(183, 190, 255, 0.4));
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
}

.hrv-hh-status {
    font-size: 13px;
    margin-top: 8px;
    min-height: 18px;
}

.hrv-hh-status--ok {
    color: #1B7A4B;
}

.hrv-hh-status--err {
    color: #C62828;
}

.hrv-hh-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
