/**
 * Стили для Call кнопки на странице деталей вакансии
 * Работает совместно с мобильным стиком Apply кнопки из плагина
 */

/* ============================================
   СТРУКТУРА:
   div.jobsearch_apply_job_wrap
     └─ [Apply кнопка от плагина]
     └─ [Call кнопка наша]
   
   За счёт display: contents на родителе, обе кнопки становятся соседями
   ============================================ */

/* Родитель Apply и Call - делаем его "прозрачным" для flex */
.jobsearch_apply_job_wrap {
    display: flex !important;
    gap: 10px !important;
    align-items: center !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
}

/* Убедиться что Apply кнопка не займёт всю ширину */
.jobsearch_apply_job_wrap > *:not(.careerfy-call-button):not(.careerfy-call-popup) {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

/* Call кнопка - круглая */
.careerfy-call-button {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    flex-shrink: 0 !important;
    border-radius: 50% !important;
    background: #1a1a1a;
    border: none !important;
    color: white;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    vertical-align: middle !important;
    line-height: 1 !important;
    position: relative !important;
}

.careerfy-call-button:hover {
    background: #2d2d2d;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    filter: brightness(1.1);
}

.careerfy-call-button:active {
    background: #0a0a0a;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    filter: brightness(0.9);
}

.careerfy-call-button svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/**
 * POPUP OVERLAY & BACKGROUND
 * ================================================
 */

.careerfy-call-popup {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 99999 !important;
    display: none !important;
    align-items: flex-end !important;
    justify-content: center !important;
    background: transparent !important;
    outline: 0 !important;
    overflow: hidden !important;
}

.careerfy-call-popup.open {
    display: flex !important;
}

/* Полупрозрачный фон (overlay) */
.careerfy-call-popup-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.55) !important;
    backdrop-filter: blur(2px) !important;
    -webkit-backdrop-filter: blur(2px) !important;
    cursor: pointer !important;
    animation: fadeIn 0.3s ease-out !important;
    z-index: 1 !important;
}

/* Контент попапа с белым фоном */
.careerfy-call-popup-content {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%) !important;
    border-radius: 20px 20px 0 0 !important;
    z-index: 100000 !important;
    animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12) !important;
    pointer-events: auto !important;
}

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

.careerfy-call-popup-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 20px 20px 16px 20px !important;
    border-bottom: 1px solid #e5e7eb !important;
    position: sticky !important;
    top: 0 !important;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%) !important;
    border-radius: 20px 20px 0 0 !important;
}

.careerfy-call-popup-header h3 {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    letter-spacing: -0.3px !important;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/**
 * CLOSE BUTTON (X)
 * ================================================
 */

.careerfy-call-popup-close {
    background: transparent !important;
    border: none !important;
    font-size: 28px !important;
    color: #b0b0b0 !important;
    cursor: pointer !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    border-radius: 6px !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
    margin-left: 12px !important;
}

.careerfy-call-popup-close:hover {
    color: #666 !important;
    background: rgba(0, 0, 0, 0.04) !important;
}

.careerfy-call-popup-close:active {
    background: rgba(0, 0, 0, 0.08) !important;
    transform: scale(0.95) !important;
}

/**
 * POPUP BODY
 * ================================================
 */

.careerfy-call-popup-body {
    padding: 16px 20px 24px 20px !important;
    scroll-behavior: smooth !important;
}

/**
 * PHONE LIST
 * ================================================
 */

.careerfy-call-phones-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.careerfy-call-phones-list li {
    margin: 0 !important;
}

.careerfy-call-phones-list li:last-child {
    margin-bottom: 0 !important;
}

/**
 * PHONE LINK ITEM
 * ================================================
 */

.careerfy-phone-link {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 14px 16px !important;
    background: #f8f9fb !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    color: #333 !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 1.5px solid #e5e7eb !important;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

.careerfy-phone-link:hover {
    background: #e3f2fd !important;
    border-color: #0a65fc !important;
    color: #0a65fc !important;
    box-shadow: 0 4px 12px rgba(10, 101, 252, 0.15) !important;
    transform: translateX(2px) !important;
}

.careerfy-phone-link:active {
    transform: translateX(0) !important;
    box-shadow: 0 2px 6px rgba(10, 101, 252, 0.1) !important;
}

.careerfy-phone-link:focus-visible {
    outline: 2px solid #0a65fc !important;
    outline-offset: 2px !important;
}

/**
 * PHONE ICON
 * ================================================
 */

.careerfy-phone-icon {
    flex-shrink: 0 !important;
    width: 22px !important;
    height: 22px !important;
    color: currentColor !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(10, 101, 252, 0.1) !important;
    border-radius: 50% !important;
    padding: 2px !important;
    transition: all 0.25s ease !important;
}

.careerfy-phone-link:hover .careerfy-phone-icon {
    background: rgba(10, 101, 252, 0.2) !important;
    transform: scale(1.1) !important;
}

.careerfy-phone-icon svg {
    width: 16px !important;
    height: 16px !important;
    display: block !important;
}

/**
 * PHONE NUMBER
 * ================================================
 */

.careerfy-phone-number {
    font-size: 15px !important;
    font-weight: 600 !important;
    flex: 1 !important;
    letter-spacing: -0.2px !important;
}

/**
 * PHONE COMMENT
 * ================================================
 */

.careerfy-phone-comment {
    font-size: 12px !important;
    color: #999 !important;
    margin-left: auto !important;
    flex-shrink: 0 !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    margin-left: 12px !important;
}

.careerfy-phone-link:hover .careerfy-phone-comment {
    color: #0a65fc !important;
}

/**
 * ANIMATIONS
 * ================================================
 */

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/**
 * MOBILE OPTIMIZATION
 * ================================================
 */

@media (max-width: 768px) {
    .jobsearch_apply_job_wrap {
        gap: 6px !important;
        align-items: center !important;
    }
    
    .careerfy-call-button {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        vertical-align: middle !important;
    }
    
    .insta-apply-stickycon .jobsearch_apply_job_wrap {
        gap: 6px !important;
        align-items: center !important;
        overflow: visible !important;
    }
    
    .insta-apply-stickycon .careerfy-call-button {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .careerfy-call-popup-content {
        border-radius: 24px 24px 0 0;
        max-height: 85vh;
    }
    
    .careerfy-call-popup-header {
        padding: 18px 16px 14px 16px;
        border-radius: 24px 24px 0 0;
    }
    
    .careerfy-call-popup-header h3 {
        font-size: 16px;
        font-weight: 700;
    }
    
    .careerfy-call-popup-body {
        padding: 14px 16px 20px 16px;
    }
    
    .careerfy-phone-link {
        padding: 12px 14px;
        gap: 12px;
        border-radius: 8px;
    }
    
    .careerfy-phone-icon {
        width: 20px;
        height: 20px;
        padding: 1px;
    }
    
    .careerfy-phone-icon svg {
        width: 14px;
        height: 14px;
    }
    
    .careerfy-phone-number {
        font-size: 14px;
  *
 * TABLET OPTIMIZATION
 * ================================================
 */

@media (min-width: 769px) and (max-width: 1024px) {
    .jobsearch_apply_job_wrap {
        gap: 8px;
    }
    
    .careerfy-call-button {
        width: 46px;
        height: 46px;
        min-width: 46px;
    }
    
    .careerfy-call-popup-content {
        max-width: 480px;
        border-radius: 16px;
        margin-bottom: 32px;
    }
    
    .careerfy-call-popup-header {
        border-radius: 16px 16px 0 0;
    }
    
    .careerfy-phone-link {
        padding: 13px 15px;
    }
}

/**
 * DESKTOP - Keep popup at bottom
 * ================================================
 */

@media (min-width: 1025px) {
    .careerfy-call-popup-content {
        border-radius: 20px 20px 0 0;
    }
}

/**
 * ACCESSIBILITY & FOCUS STATES
 * ================================================
 */

.careerfy-call-popup-close:focus-visible {
    outline: 2px solid #0a65fc;
    outline-offset: 2px;ap: 10px !important;
    align-items: center !important;
    width: 100% !important;
    height: auto !important;
    flex-wrap: nowrap !important;
    overflow: visible !important;
}

.insta-apply-stickycon .jobsearch_apply_job_wrap > *:not(.careerfy-call-button):not(.careerfy-call-popup) {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

/* Call кнопка в sticky - явное отображение */
.insta-apply-stickycon .careerfy-call-button {
    flex-shrink: 0 !important;
    min-width: 48px !important;
    max-width: 48px !important;
    width: 48px !important;
    height: 48px !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: auto !important;
    position: relative !important;
}

/* Также добавляем правило для инста-сипи конторейнера */
.insta-sypapply-stickycon .careerfy-call-button,
.insta-apply-stickycon .careerfy-call-button {
    display: flex !important;
    visibility: visible !important;
}

/* Планшет */
@media (min-width: 769px) and (max-width: 1024px) {
    .jobsearch_apply_job_wrap {
        gap: 8px;
    }
    
    .careerfy-call-button {
        width: 46px;
        height: 46px;
        min-width: 46px;
    }
}
