/**
 * CRM Profile Modals & UI
 * Styles for modal-based profile editing
 *
 * @package SennaCareers
 * @since 8.0.0
 */

/* ============================================
   Modal Overlay & Container
   ============================================ */
.sffc-profile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.sffc-profile-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    display: flex !important;
    flex-direction: column;
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1000000;
}

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

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

/* ============================================
   Modal Header
   ============================================ */
.sffc-profile-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sffc-profile-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #0D353E;
}

.sffc-profile-modal-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.sffc-profile-modal-close:hover {
    background: #f3f4f6;
    color: #0D353E;
}

.sffc-profile-modal-close svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   Modal Body
   ============================================ */
.sffc-profile-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.sffc-profile-modal-field {
    margin-bottom: 0;
}

.sffc-profile-modal-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.sffc-profile-modal-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    color: #0D353E;
    transition: all 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.sffc-profile-modal-input:focus {
    outline: none;
    border-color: #0a66c2;
    box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.1);
}

.sffc-profile-modal-input::placeholder {
    color: #9ca3af;
}

/* ============================================
   Modal Options (Checkboxes)
   ============================================ */
.sffc-profile-modal-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sffc-profile-modal-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.sffc-profile-modal-option:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.sffc-profile-modal-option input[type="checkbox"] {
    margin: 0;
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0a66c2;
}

.sffc-profile-modal-option span {
    font-size: 15px;
    color: #0D353E;
    font-weight: 500;
}

.sffc-profile-modal-option:has(input:checked) {
    background: #eff6ff;
    border-color: #0a66c2;
}

/* ============================================
   Modal Footer
   ============================================ */
.sffc-profile-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* ============================================
   Profile Header Card (LinkedIn Style)
   ============================================ */
.sffc-crm-profile-header-card {
    background: #fff;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.sffc-crm-profile-banner {
    height: 200px;
    background: linear-gradient(135deg, #0D353E 0%, #1a5766 50%, #2a6d7f 100%);
    position: relative;
}

.sffc-crm-profile-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));
}

.sffc-crm-profile-header-content {
    padding: 0 32px 32px;
    position: relative;
    margin-top: -80px;
}

.sffc-crm-profile-header-content .sffc-crm-linkedin-avatar {
    border: 6px solid #fff;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sffc-crm-profile-header-info {
    text-align: left;
    max-width: 100%;
}

.sffc-crm-profile-header-info h2 {
    margin: 0 0 12px 0;
    font-size: 32px;
    font-weight: 700;
    color: #0D353E;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.sffc-crm-profile-headline {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #5a6d65;
    line-height: 1.6;
    font-weight: 400;
    max-width: 100%;
    word-wrap: break-word;
}

.sffc-crm-profile-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.sffc-crm-profile-meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}

.sffc-crm-profile-meta-icon {
    width: 20px;
    height: 20px;
    color: #6b7280;
    flex-shrink: 0;
}

.sffc-crm-profile-meta-text {
    font-size: 16px;
    color: #0D353E;
    font-weight: 500;
    line-height: 1.4;
}

.sffc-crm-profile-meta-edit {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    margin-left: auto;
}

.sffc-crm-profile-meta-edit:hover {
    background: #f3f4f6;
    color: #0D353E;
}

.sffc-crm-profile-meta-edit svg {
    width: 16px;
    height: 16px;
}

.sffc-crm-profile-meta-add {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: none;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 15px;
    color: #6b7280;
    font-weight: 500;
    width: fit-content;
}

.sffc-crm-profile-meta-add:hover {
    background: #f9fafb;
    border-color: #0D353E;
    color: #0D353E;
}

.sffc-crm-profile-meta-add svg {
    width: 20px;
    height: 20px;
}

.sffc-crm-profile-open-to {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.sffc-crm-profile-open-to-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    flex: 1;
    min-width: 300px;
}

.sffc-crm-profile-open-to-display strong {
    font-size: 15px;
    font-weight: 700;
    color: #0D353E;
    white-space: nowrap;
}

.sffc-crm-profile-open-to-text {
    flex: 1;
    font-size: 15px;
    color: #1A3028;
    font-weight: 500;
}

.sffc-open-to-edit {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.sffc-open-to-edit:hover {
    background: #e2e8f0;
    color: #0D353E;
}

.sffc-open-to-edit svg {
    width: 18px;
    height: 18px;
}

.sffc-open-to-btn,
.sffc-expert-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.2s;
    cursor: pointer;
    border: 2px solid transparent;
}

.sffc-open-to-btn {
    background: #0D353E;
    color: #fff;
    border-color: #0D353E;
}

.sffc-open-to-btn:hover {
    background: #1a4a57;
    border-color: #1a4a57;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 53, 62, 0.3);
}

.sffc-expert-btn {
    background: #fff;
    color: #0D353E;
    border-color: #d1d5db;
}

.sffc-expert-btn:hover {
    background: #f9fafb;
    border-color: #0D353E;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sffc-open-to-btn svg,
.sffc-expert-btn svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   Profile Section Enhancements
   ============================================ */
.sffc-crm-profile-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
}

.sffc-crm-profile-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.sffc-crm-profile-section-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #0D353E;
}

.sffc-crm-tags-editable {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Override default tag styles with high specificity */
.sffc-crm-profile-section .sffc-crm-tag,
.sffc-crm-tags-editable .sffc-crm-tag {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 12px !important;
    background: #0D353E !important;
    color: #FFFFFF !important;
    border-radius: 20px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border: 1px solid #0D353E !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
}

.sffc-crm-profile-section .sffc-crm-tag:hover,
.sffc-crm-tags-editable .sffc-crm-tag:hover {
    background: #1a4a57 !important;
    border-color: #1a4a57 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.sffc-crm-profile-section .sffc-crm-tag-remove,
.sffc-crm-tags-editable .sffc-crm-tag-remove {
    background: none !important;
    border: none !important;
    color: #FFFFFF !important;
    font-size: 18px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0.7 !important;
    transition: opacity 0.2s !important;
    width: 18px !important;
    height: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.sffc-crm-profile-section .sffc-crm-tag-remove:hover,
.sffc-crm-tags-editable .sffc-crm-tag-remove:hover {
    opacity: 1 !important;
}

.sffc-crm-tag-add {
    background: none;
    border: 1px dashed #d1d5db;
    color: #6b7280;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.sffc-crm-tag-add:hover {
    background: #f9fafb;
    border-color: #0a66c2;
    color: #0a66c2;
}

/* ============================================
   Inline Field Editing
   ============================================ */
.sffc-crm-field-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 15px;
    color: #0D353E;
    min-height: 48px;
}

.sffc-crm-field-editable {
    cursor: pointer;
    transition: all 0.2s;
}

.sffc-crm-field-editable:hover {
    background: #f3f4f6;
}

.sffc-crm-field-edit-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0;
}

.sffc-crm-field-value:hover .sffc-crm-field-edit-btn {
    opacity: 1;
}

.sffc-crm-field-edit-btn:hover {
    background: #e5e7eb;
    color: #0D353E;
}

.sffc-crm-field-edit-btn svg {
    width: 16px;
    height: 16px;
}

.sffc-crm-field-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    color: #0D353E;
    transition: all 0.2s;
}

.sffc-crm-field-input:focus {
    outline: none;
    border-color: #0a66c2;
    box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.1);
}

/* ============================================
   Salary Editor
   ============================================ */
.sffc-crm-salary-editor {
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
}

.sffc-crm-salary-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.sffc-crm-salary-inputs input,
.sffc-crm-salary-inputs select {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #0D353E;
}

.sffc-crm-salary-inputs input {
    flex: 1;
}

.sffc-crm-salary-inputs select {
    min-width: 120px;
}

.sffc-crm-salary-inputs span {
    color: #6b7280;
    font-weight: 500;
}

.sffc-crm-salary-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ============================================
   Profile Grid
   ============================================ */
.sffc-crm-profile-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .sffc-crm-profile-grid-2col {
        grid-template-columns: 1fr;
    }

    .sffc-profile-modal {
        max-width: 100%;
        margin: 0;
        border-radius: 12px 12px 0 0;
        align-self: flex-end;
    }
}

/* ============================================
   Profile Field
   ============================================ */
.sffc-crm-profile-field {
    margin-bottom: 0;
}

.sffc-crm-profile-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   Toast Notifications
   ============================================ */
.sffc-crm-toast {
    animation: slideInRight 0.3s ease-out !important;
}
