/* ========================================
   OPERATORS DIRECTORY PAGE
   Extends find-equipment.css patterns
   ======================================== */

/* --- Operator Card Grid (replaces map+sidebar layout) --- */
.sf-op-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

/* --- Search form submit + clear buttons --- */
.sf-op-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    height: 44px;
    background-color: #3A7D44;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    border: none;
    border-radius: 5px !important;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.sf-op-search-btn:hover {
    background-color: #2d6435;
}

.sf-op-clear-btn {
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    height: 44px;
    background-color: transparent;
    color: #636E72;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.sf-op-clear-btn:hover {
    border-color: #9CA3AF;
    color: #2D3436;
}

/* --- Inline search: input + submit button side by side --- */
.sf-op-page .sf-fe-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sf-op-page .sf-fe-search-input-wrap {
    flex: 1;
    min-width: 200px;
}

/* Promo block — reuses .sf-leads-promo / .sf-leads-promo-* from leads.css.
   Both stylesheets are enqueued on this page via functions.php.
   No duplicate rules needed here. */

/* --- Card overrides for operator layout --- */
.sf-op-card.sf-fe-card .sf-fe-card-header {
    flex-flow: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 20px 20px 0;
    gap: 12px;
}

.sf-op-card .sf-fe-card-info {
    gap: 8px;
    width: 100%;
}

.sf-op-card .sf-fe-badge {
    margin-bottom: 0;
}

.sf-op-card .sf-fe-card-location {
    margin-top: 2px;
}

.sf-op-card .sf-fe-card-body {
    padding: 16px 20px 20px;
}

.sf-op-card .sf-fe-card-specs {
    gap: 6px;
    margin-bottom: 0;
}

.sf-op-card .sf-fe-card-btn {
    margin-top: 20px;
}

/* --- Card identity row: avatar + name --- */
.sf-op-card-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- Avatar --- */
.sf-op-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #E0EDE3;
    color: #2D5016;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 15px;
    flex-shrink: 0;
    overflow: hidden;
}

.sf-op-avatar--img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Company Type label --- */
.sf-op-type {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 13px;
    line-height: 18px;
    color: #636E72;
    letter-spacing: -0.15px;
}

/* --- Operator detail: Contact card overrides --- */

/* Company name — bigger, shown first */
.sf-op-contact-company-name {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 1.25;
    color: #2D3436;
    margin: 8px 0 1px;
    text-align: center;
}

/* City, Zip below company name */
.sf-op-contact-location {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 15px;
    color: #636E72;
    margin: 0;
    text-align: center;
}

/* Contact person — smaller, pushed down with 10px top spacing */
.sf-op-contact-person {
    margin-top: 10px !important;
    font-weight: 400;
    font-size: 13px;
    color: #636E72;
    text-align: center;
}

/* --- Tabbed listings card container --- */
/* Tabbed card: zero padding, capped at column width, clips overflow */
.sf-op-tabs-card {
    padding: 0 !important;
    overflow: hidden !important;
    max-width: 100%;
}

/* Operator page: never wider than viewport */
.sf-eq-page {
    overflow-x: hidden;
}

/* Left column: must shrink to grid track, not expand to content */
.sf-eq-main {
    min-width: 0;
}

/* --- Tab bar (Figma: active = white bold, inactive = sage bg) --- */
.sf-op-tabs {
    display: flex;
    border-bottom: 1px solid #E5E7EB;
    background: #EFF5EF;
    border-radius: 10px 10px 0 0;
}

.sf-op-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 15px;
    color: #636E72;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 10px 10px 0 0;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.sf-op-tab--active {
    background: #fff;
    color: #2D3436;
    font-weight: 600;
    border-bottom: 2px solid #fff;
    margin-bottom: -1px;
}

.sf-op-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #E0EDE3;
    color: #2D5016;
    font-size: 12px;
    font-weight: 600;
    border-radius: 10px;
}

.sf-op-tab--active .sf-op-tab-count {
    background: #3A7D44;
    color: #fff;
}

/* --- Tab panels --- */
.sf-op-tab-panel {
    padding: 24px;
}

.sf-op-tab-panel--hidden {
    display: none;
}

/* Leads panel: zero padding so table fills the card exactly */
.sf-op-leads-panel {
    padding: 0;
}

/* Login gate inside leads panel still needs its own padding */
.sf-op-leads-panel>div[style*="text-align:center"] {
    padding: 32px 24px;
}

.sf-op-leads-panel>.sf-eq-desc {
    padding: 24px;
}

/* Standalone table — no dependency on leads.css, no min-width */
.sf-op-leads-tbl {
    border-collapse: collapse;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 20px;
    width: 100%;
}

.sf-op-leads-tbl thead {
    background: #fff;
    border-bottom: 1px solid #E5E7EB;
}

.sf-op-leads-tbl thead th {
    background: #fff;
    font-weight: 500;
    font-size: 13px;
    color: #6B7280;
    text-align: left;
    padding: 12px 16px;
    white-space: nowrap;
    border-bottom: 1px solid #E5E7EB;
}

.sf-op-leads-tbl tbody tr {
    border-bottom: 1px solid #E5E7EB;
}

.sf-op-leads-tbl tbody tr:last-child {
    border-bottom: none;
}

.sf-op-leads-tbl tbody tr:hover {
    background: #F9FAFB;
}

.sf-op-leads-tbl tbody td {
    padding: 12px 16px;
    text-align: left;
    white-space: nowrap;
    color: #374151;
    vertical-align: middle;
}

.sf-op-leads-tbl .sf-leads-td-title strong {
    display: block;
    font-weight: 600;
    color: #111827;
}

.sf-op-leads-tbl .sf-leads-td-id {
    display: block;
    font-size: 12px;
    color: #9CA3AF;
    font-weight: 400;
}

.sf-op-leads-tbl .sf-leads-td-location {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #6B7280;
    font-size: 13px;
}

.sf-op-leads-tbl .sf-leads-view-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #2D5016;
    font-weight: 500;
    font-size: 13px;
    text-decoration: none;
}

.sf-op-leads-tbl .sf-leads-view-link:hover {
    text-decoration: underline;
}

/* Card must not grow wider than its container */
/* Card must not grow wider than its container */
/* (handled above in .sf-op-tabs-card) */


/* Equipment cards grid (2-col, Figma-matching) */
.sf-op-eq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Individual equipment card — matches Figma: white, bordered, rounded */
.sf-op-eq-mini-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

/* Spec rows: label (medium) + value */
.sf-op-eq-mini-specs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.sf-op-eq-mini-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 20px;
    color: #2D3436;
}

.sf-op-eq-mini-label {
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: -0.15px;
}

.sf-op-eq-mini-val {
    font-weight: 400;
    color: #2D3436;
    letter-spacing: -0.15px;
}

/* Availability badge (sage, small) */
.sf-op-eq-mini-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 16px;
    width: fit-content;
}

.sf-op-badge--available {
    background: #E0EDE3;
    color: #2D3436;
}

.sf-op-badge--booked {
    background: #FDECEA;
    color: #B91C1C;
}

/* Full-width dark green View Details button */
.sf-op-eq-mini-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    padding: 7px 12px;
    background: #2D5016;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.15px;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.15s ease;
}

.sf-op-eq-mini-btn:hover {
    background: #3A7D44;
    color: #fff;
}

/* Force leads table header to white — parent theme overrides leads.css */
.sf-op-tab-panel .sf-leads-table thead,
.sf-op-tab-panel .sf-leads-table thead tr,
.sf-op-tab-panel .sf-leads-table thead th {
    background: #fff !important;
    background-color: #fff !important;
}

/* --- Lead rows inside tab panel --- */
.sf-op-leads-list {
    display: flex;
    flex-direction: column;
}

.sf-op-lead-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid #E5E7EB;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease;
}

.sf-op-lead-row:first-child {
    border-top: 1px solid #E5E7EB;
}

.sf-op-lead-row:hover {
    background-color: #F9FAFB;
    padding-left: 8px;
    padding-right: 8px;
    margin-left: -8px;
    margin-right: -8px;
    border-radius: 6px;
}

.sf-op-lead-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.sf-op-lead-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* --- Responsive: tab grid to 1-col on mobile --- */
@media screen and (max-width: 640px) {
    .sf-op-eq-grid {
        grid-template-columns: 1fr;
    }

    .sf-op-tab {
        padding: 14px 16px;
        font-size: 14px;
    }

    .sf-op-tab-panel {
        padding: 16px;
    }

    /* Hide leads location col on mobile — removed: table scrolls instead */

    .sf-op-tab-panel .sf-leads-table-wrap {
        margin: 0 -16px;
    }
}

/* --- Equipment Listing Rows (operator detail page, legacy) --- */
.sf-op-equipment-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sf-op-eq-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #E5E7EB;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease;
}

.sf-op-eq-row:first-child {
    border-top: 1px solid #E5E7EB;
}

.sf-op-eq-row:hover {
    background-color: #F9FAFB;
    padding-left: 8px;
    padding-right: 8px;
    margin-left: -8px;
    margin-right: -8px;
    border-radius: 6px;
}

.sf-op-eq-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.sf-op-eq-title {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: #2D3436;
}

.sf-op-eq-type {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 13px;
    line-height: 18px;
    color: #636E72;
}

.sf-op-eq-location {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 13px;
    line-height: 18px;
    color: #636E72;
    flex-shrink: 0;
}

/* --- Empty state --- */
.sf-fe-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 20px;
    color: #636E72;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
}

/* ========================================
   CLAIM PROFILE FORM
   ======================================== */

/* Cancel state for toggle button */
.sf-eq-btn--cancel {
    border-color: #B2BEC3 !important;
    color: #636E72 !important;
}

.sf-eq-btn--cancel:hover {
    background-color: #f5f5f5 !important;
}

/* Form wrapper */
.sf-claim-form-wrap {
    margin-top: 16px;
    padding: 20px;
    background-color: #F8F9FA;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    animation: sfClaimSlideDown 0.2s ease-out;
}

@keyframes sfClaimSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

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

.sf-claim-form-desc {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: #636E72;
    margin: 0 0 16px;
}

/* Form fields */
.sf-claim-field {
    margin-bottom: 14px;
}

.sf-claim-field label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: #2D3436;
    margin-bottom: 6px;
}

.sf-required {
    color: #e74c3c;
}

.sf-claim-field input[type="text"],
.sf-claim-field input[type="email"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #DFE6E9;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #2D3436;
    background-color: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.sf-claim-field input:focus {
    outline: none;
    border-color: #2D5016;
    box-shadow: 0 0 0 3px rgba(45, 80, 22, 0.1);
}

.sf-claim-field input::placeholder {
    color: #B2BEC3;
}

/* Submit button */
.sf-claim-submit {
    width: 100%;
    margin-top: 4px;
}

.sf-claim-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Messages */
.sf-claim-message {
    padding: 14px 16px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

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

.sf-claim-message--success {
    background-color: #E8F5E9;
    color: #2D5016;
    border: 1px solid #C8E6C9;
}

.sf-claim-message--error {
    background-color: #FDEDED;
    color: #9A1B1B;
    border: 1px solid #F5C6CB;
}

/* ========================================
   RESPONSIVE — Tablet (≤1024px)
   ======================================== */
@media screen and (max-width: 1024px) {
    .sf-op-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 16px;
    }
}

/* ========================================
   RESPONSIVE — Mobile (≤768px)
   ======================================== */
@media screen and (max-width: 768px) {
    .sf-op-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .sf-op-search-btn {
        width: 100%;
        flex-shrink: 1;
    }

    .sf-op-page .sf-fe-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .sf-op-page .sf-fe-search-input-wrap {
        width: 100%;
    }
}