/**
 * Folks Integration — Offcanvas & Tabs
 * Structural/positioning CSS stays here (not subject to Tailwind's content scan).
 * Visual styling (colors, shadows, spacing) is handled by Tailwind in the templates.
 */

/* ── Offcanvas container: covers the full viewport ── */
.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;
}

/* ── Overlay: full-viewport backdrop ── */
.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;
}

/* ── Content panel: slides in from the right ── */
.folks-offcanvas-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 90%;
    max-width: 800px;
    height: 100%;
    background: white;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.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);
}

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

/* ── Close button: absolute top-right ── */
button.folks-close-offcanvas {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    padding: 12px;
    background: transparent;
    border: none;
    border-radius: 9999px;
    font-size: 20px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

button.folks-close-offcanvas:hover {
    color: #374151;
    background: #f3f4f6;
}

/* ── Tabs: JS-toggled show/hide + active state ── */
.folks-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
}

button.folks-tab-btn {
    flex: 1;
    padding: 14px 24px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0 !important; /* override theme button rounding */
    box-shadow: none !important;
    font-size: 15px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

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

button.folks-tab-btn:focus,
button.folks-tab-btn:focus-visible {
    outline: none;
    box-shadow: none !important;
}

button.folks-tab-btn.active {
    color: #009D77;
    background: #f6f7f7; /* subtle fill, not a dark filled tab */
    border-bottom-color: #009D77;
}

.folks-tab-content {
    display: none;
}

.folks-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ── Sticky job detail actions bar ── */
.folks-offcanvas .folks-job-detail-actions {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 2px solid #f3f4f6;
    padding: 20px 40px;
}

/* ── 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; }
}

/* ── Mobile: full-width panel ── */
@media (max-width: 640px) {
    .folks-offcanvas-content {
        width: 100%;
        max-width: 100%;
    }
}
