/**
 * Folks Integration — Modal & Offcanvas
 */

/* Modal */
.folks-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.folks-modal-active {
    opacity: 1;
    visibility: visible;
}

.folks-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.folks-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.folks-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
}

.folks-modal-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #009D77;
    border-radius: 50%;
    animation: folks-spin 0.8s linear infinite;
}

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

body.folks-modal-open {
    overflow: hidden;
}

/* Offcanvas for Job Detail */
.folks-offcanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.folks-offcanvas-active {
    opacity: 1;
    visibility: visible;
}

.folks-offcanvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    cursor: pointer;
}

.folks-offcanvas-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 90%;
    max-width: 800px;
    height: 100%;
    background: white;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Prevent content overflow in offcanvas */
.folks-offcanvas-content * {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.folks-offcanvas-content img {
    height: auto;
}

.folks-offcanvas-content pre,
.folks-offcanvas-content code {
    white-space: pre-wrap;
    word-break: break-all;
}

.folks-offcanvas-active .folks-offcanvas-content {
    transform: translateX(0);
}

button.folks-close-offcanvas {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 16px;
    border-radius: 999rem;
    transition: all 0.2s;
    z-index: 10;
}

.folks-close-offcanvas:hover {
    color: #1f2937;
    background: #f3f4f6;
}

body.folks-offcanvas-open {
    overflow: hidden;
}

/* Update job detail actions in offcanvas */
.folks-offcanvas .folks-job-detail-actions {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 20px 0;
    padding-left: 40px;
    padding-right: 40px;
    border-top: 2px solid #e5e7eb;
}

/* Hide back to list button in offcanvas */
.folks-offcanvas .folks-btn-secondary {
    display: none;
}

/* Tabs Navigation */
.folks-tabs {
    display: flex;
    gap: 0;
}

button.folks-tab-btn {
    flex: 1;
    padding: 16px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid #e5e7eb;
    border-radius: 0;
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.folks-tab-btn:hover {
    color: #1f2937;
    background: #f9fafb;
}

.folks-tab-btn.active {
    color: #009D77;
    border-bottom-color: #009D77;
}

/* Tab Content */
.folks-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.folks-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Adjust job detail actions in tabs */
.folks-tab-content .folks-job-detail-actions {
    margin-top: 30px;
}

/* Skeleton Loading Animation */
.folks-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: folks-skeleton-wave 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes folks-skeleton-wave {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.folks-skeleton-loading .folks-skeleton-title {
    height: 40px;
    width: 70%;
    margin-bottom: 12px;
}

.folks-skeleton-loading .folks-skeleton-company {
    height: 24px;
    width: 40%;
    margin-bottom: 20px;
}

.folks-skeleton-loading .folks-skeleton-text {
    height: 18px;
    width: 100%;
}

.folks-skeleton-loading .folks-skeleton-heading {
    height: 28px;
    width: 50%;
    margin-bottom: 16px;
}

.folks-skeleton-loading .folks-skeleton-line {
    height: 16px;
    width: 100%;
    margin-bottom: 12px;
}

.folks-skeleton-loading .folks-skeleton-line-short {
    width: 60%;
}

.folks-skeleton-loading .folks-job-detail-meta {
    margin-top: 20px;
}

.folks-skeleton-loading .folks-job-detail-meta .folks-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.folks-skeleton-loading .folks-job-description,
.folks-skeleton-loading .folks-job-skills {
    margin-bottom: 30px;
}
