/**
 * admin-claims.css
 * Styles for the Admin Claims dashboard page and the Claim Profile modal on author pages.
 */

/* ── Claim Profile Modal (author page) ─────────────────────── */
.sf-claim-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.sf-claim-modal {
    background: #fff;
    border-radius: 12px;
    padding: 36px 32px 32px;
    max-width: 420px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    animation: sfClaimModalIn 0.2s ease;
}

@keyframes sfClaimModalIn {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.sf-claim-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #9CA3AF;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.sf-claim-modal-close:hover {
    color: #374151;
    background: #F3F4F6;
}

.sf-claim-modal-icon {
    text-align: center;
    margin-bottom: 16px;
}

.sf-claim-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    text-align: center;
    margin: 0 0 10px;
}

.sf-claim-modal-desc {
    font-size: 14px;
    color: #6B7280;
    text-align: center;
    line-height: 1.6;
    margin: 0 0 24px;
}

.sf-claim-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sf-claim-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sf-claim-field label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.sf-required {
    color: #EF4444;
}

.sf-claim-field input[type="email"] {
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: #111827;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.sf-claim-field input[type="email"]:focus {
    border-color: #3A7D44;
    box-shadow: 0 0 0 3px rgba(58, 125, 68, 0.12);
}

.sf-claim-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    margin-top: 8px;
}

.sf-claim-message--success {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.sf-claim-message--error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.sf-claim-message svg {
    flex-shrink: 0;
    margin-top: 1px;
}

/* Disabled "Contact Operator" button style */
.sf-eq-btn--disabled {
    opacity: 0.45;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* ── Admin Layout: Sidebar + Main ──────────────────────────── */
.sf-admin-page-wrap {
    min-height: 100vh;
    background: #F9FAFB;
    font-family: 'Inter', sans-serif;
}

.sf-admin-layout {
    display: flex;
    align-items: flex-start;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
    min-height: calc(100vh - 120px);
}

/* Sidebar */
.sf-admin-sidebar {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 24px;
    padding: 24px 0;
}

.sf-admin-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px 20px;
    border-bottom: 1px solid #E5E7EB;
    margin-bottom: 12px;
}

.sf-admin-sidebar-logo span {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.01em;
}

.sf-admin-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sf-admin-sidebar-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sf-admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6B7280;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.sf-admin-sidebar-link svg {
    flex-shrink: 0;
    color: currentColor;
}

.sf-admin-sidebar-link:hover {
    background: #F3F4F6;
    color: #111827;
}

.sf-admin-sidebar-link.is-active {
    background: #F0FDF4;
    color: #3A7D44;
    font-weight: 600;
}

.sf-admin-sidebar-subnav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 0 4px;
    padding-left: 42px;
}

.sf-admin-sidebar-sublink {
    position: relative;
    display: block;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #6B7280;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.sf-admin-sidebar-sublink::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #D1D5DB;
    transform: translateY(-50%);
}

.sf-admin-sidebar-sublink:hover {
    background: #F3F4F6;
    color: #111827;
}

.sf-admin-sidebar-item.is-active .sf-admin-sidebar-sublink {
    color: #4B5563;
}

.sf-admin-sidebar-item.is-active .sf-admin-sidebar-sublink:hover {
    color: #111827;
}

.sf-admin-sidebar-footer {
    margin-top: auto;
    padding: 16px 16px 0;
}

.sf-admin-sidebar-wp-link {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 500;
    color: #9CA3AF;
    text-decoration: none;
    transition: color 0.15s;
}

.sf-admin-sidebar-wp-link:hover {
    color: #374151;
}

.sf-admin-sidebar-logout {
    margin-top: 10px;
}

.sf-admin-sidebar-logout:hover {
    color: #DC2626;
}

/* Main content */
.sf-admin-main {
    flex: 1;
    min-width: 0;
    padding: 32px 0 80px 32px;
}

/* ── Admin Claims Page ──────────────────────────────────────── */
.sf-admin-claims-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    font-family: 'Inter', sans-serif;
}

.sf-admin-claims-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 12px;
}

#sf-lead-agent-approval-requests {
    scroll-margin-top: 32px;
}

.sf-admin-claims-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.sf-admin-claims-header p {
    font-size: 14px;
    color: #6B7280;
    margin: 4px 0 0;
}

/* Filter tabs */
.sf-admin-claims-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    border-bottom: 2px solid #E5E7EB;
    padding-bottom: 0;
}

.sf-admin-claims-tab {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #6B7280;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    border-radius: 0;
    transition: color 0.15s, border-color 0.15s;
}

.sf-admin-claims-tab:hover {
    color: #374151;
}

.sf-admin-claims-tab.is-active {
    color: #3A7D44;
    border-bottom-color: #3A7D44;
}

/* Table */
.sf-admin-claims-table-wrap {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.sf-admin-claims-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.sf-admin-claims-table thead {
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
}

.sf-admin-claims-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #fff !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.sf-admin-claims-table thead th {
    color: #fff !important;
}

.sf-admin-claims-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #F3F4F6;
    color: #374151;
    vertical-align: middle;
}

.sf-admin-claims-table tbody tr:last-child td {
    border-bottom: none;
}

.sf-admin-claims-table tbody tr:hover {
    background: #FAFAFA;
}

/* Operator link in table */
.sf-admin-claims-table .sf-claims-op-link {
    font-weight: 600;
    color: #3A7D44;
    text-decoration: none;
    pointer-events: none;
    cursor: default;
}

/* Status badges */
.sf-claims-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.sf-claims-badge--pending {
    background: #FFFBEB;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.sf-claims-badge--approved {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.sf-claims-badge--denied {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.sf-claims-badge--auto-approved {
    background: #F0FDFA;
    color: #0F766E;
    border: 1px solid #99F6E4;
}

/* Action buttons */
.sf-claims-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.sf-claims-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all 0.15s;
    white-space: nowrap;
}

.sf-claims-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sf-claims-btn--approve {
    background: #F0FDF4;
    color: #166534;
    border-color: #BBF7D0;
}

.sf-claims-btn--approve:hover:not(:disabled) {
    background: #DCFCE7;
    border-color: #86EFAC;
}

.sf-claims-btn--deny {
    background: #FEF2F2;
    color: #991B1B;
    border-color: #FECACA;
}

.sf-claims-btn--deny:hover:not(:disabled) {
    background: #FEE2E2;
    border-color: #FCA5A5;
}

.sf-claims-btn--archive {
    background: #F3F4F6;
    color: #6B7280;
    border-color: #D1D5DB;
}

.sf-claims-btn--archive:hover:not(:disabled) {
    background: #E5E7EB;
    border-color: #9CA3AF;
    color: #374151;
}

/* Empty state */
.sf-admin-claims-empty {
    padding: 60px 24px;
    text-align: center;
    color: #9CA3AF;
    font-size: 15px;
}

.sf-admin-claims-empty svg {
    margin-bottom: 12px;
    opacity: 0.4;
}

.sf-admin-claims-empty p {
    margin: 0;
}

/* Toast notification */
.sf-claims-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: #111827;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
}

.sf-claims-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.sf-claims-toast.is-success {
    background: #166534;
}

.sf-claims-toast.is-error {
    background: #991B1B;
}

/* ── Mobile Layout ──────────────────────────────────────────── */

/* Switch the sidebar+main flex layout to column stacking on mobile */
@media (max-width: 768px) {

    /* Page wrap: remove min-height constraint that causes blank space */
    .sf-admin-page-wrap {
        min-height: unset;
    }

    /* Stack sidebar above main on small screens */
    .sf-admin-layout {
        flex-direction: column;
        padding: 0 12px;
        min-height: unset;
        gap: 0;
    }

    /* Sidebar becomes a compact horizontal top-bar */
    .sf-admin-sidebar {
        width: 100%;
        position: static;
        padding: 12px 0 0;
        border-bottom: 1px solid #E5E7EB;
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    /* Logo row: smaller on mobile */
    .sf-admin-sidebar-logo {
        padding: 0 4px 10px;
        margin-bottom: 0;
    }

    .sf-admin-sidebar-logo span {
        font-size: 13px;
    }

    /* Nav links: display horizontally as pills */
    .sf-admin-sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .sf-admin-sidebar-link {
        padding: 7px 12px;
        font-size: 13px;
        border-radius: 6px;
        flex-shrink: 0;
    }

    /* Hide WP Admin footer link on mobile to save space */
    .sf-admin-sidebar-footer {
        display: none;
    }

    /* Main content: full width, reduce padding */
    .sf-admin-main {
        padding: 20px 0 60px;
        width: 100%;
    }

    /* Claims table: horizontal scroll + tighter padding */
    .sf-admin-claims-table-wrap {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }

    .sf-admin-claims-table {
        min-width: 520px;
    }

    .sf-admin-claims-table th,
    .sf-admin-claims-table td {
        padding: 10px 12px;
    }

    /* Hide the ID column on mobile */
    .sf-admin-claims-table th:nth-child(1),
    .sf-admin-claims-table td:nth-child(1) {
        display: none;
    }

    .sf-admin-claims-page {
        padding: 20px 0 60px;
    }

    /* Notices: slightly tighter */
    .sf-admin-op-notice {
        font-size: 13px;
        padding: 10px 14px;
    }

    /* Filter tabs: reduce padding + font-size so labels don't squish */
    .sf-admin-claims-tab {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Header row: stack title and button vertically */
    .sf-admin-ops-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 16px;
    }

    .sf-admin-ops-create-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
    }
}