/**
 * LWN Customizations - Lawyer Directory Styles
 * Filters sidebar + single-column results + pagination
 */

/* ==========================================================================
   DIRECTORY LAYOUT (Sidebar + Results)
   ========================================================================== */

.lwn-lawyer-directory {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    padding: 20px 0;
}

/* ==========================================================================
   FILTER SIDEBAR
   ========================================================================== */

.lwn-filters {
    flex: 0 0 280px;
    max-width: 280px;
}

.lwn-filter-form {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
}

.lwn-filter-group {
    margin-bottom: 24px;
}

.lwn-filter-group:last-of-type {
    margin-bottom: 24px;
}

.lwn-filter-group > label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

/* City Search Input */
.lwn-city-search-wrapper {
    position: relative;
}

.lwn-city-input,
.lwn-filter-form input[type="text"].lwn-city-input {
    width: 100%;
    padding: 10px 14px !important;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.lwn-city-input:focus {
    outline: none;
    border-color: #0f4a6e;
    box-shadow: 0 0 0 3px rgba(15, 74, 110, 0.1);
}

.lwn-city-input::placeholder {
    color: #9ca3af;
}

/* City Autocomplete Results */
.lwn-city-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
}

.lwn-city-result {
    padding: 10px 12px;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s;
}

.lwn-city-result:last-child {
    border-bottom: none;
}

.lwn-city-result:hover,
.lwn-city-result.highlighted {
    background-color: #f0f7ff;
}

.lwn-city-result strong {
    color: #0f4a6e;
}

.lwn-city-loading,
.lwn-city-no-results {
    padding: 12px;
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    font-style: italic;
}

/* Province Dropdown */
.lwn-filter-group select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.lwn-filter-group select:focus {
    outline: none;
    border-color: #0f4a6e;
    box-shadow: 0 0 0 3px rgba(15, 74, 110, 0.1);
}

/* Checkbox Lists - No scroll, all options visible */
.lwn-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lwn-checkbox-item {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

.lwn-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 7px 10px 0 0 !important;
    padding: 0 !important;
    flex-shrink: 0;
    accent-color: #0f4a6e;
    cursor: pointer;
}

.lwn-checkbox-item:hover {
    color: #0f4a6e;
}

/* Filter Buttons */
.lwn-filter-buttons {
    display: flex;
    gap: 12px;
}

.lwn-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.lwn-btn-primary {
    background-color: #0f4a6e;
    color: #fff;
}

.lwn-btn-primary:hover {
    background-color: #0d3d5a;
}

.lwn-btn-secondary {
    background-color: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.lwn-btn-secondary:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

/* ==========================================================================
   RESULTS AREA
   ========================================================================== */

.lwn-results {
    flex: 1;
    min-width: 0;
}

.lwn-results-count {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.lwn-no-results {
    text-align: center;
    padding: 60px 40px;
    background: #f9fafb;
    border-radius: 8px;
}

.lwn-no-results p {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 20px;
}

/* ==========================================================================
   SEARCH FILTER RESULTS - LAWYER CARDS (Single Column List)
   ========================================================================== */

.search-filter-results {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.search-filter-results .lawyer-listing {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.search-filter-results .lawyer-listing:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.search-filter-results .lawyer-media {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 24px;
    gap: 24px;
}

/* Photo - Fixed size on left */
.search-filter-results .lawyer-photo {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    overflow: hidden;
    border-radius: 6px;
    background-color: #f3f4f6;
}

.search-filter-results .lawyer-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Body - Takes remaining space */
.search-filter-results .lawyer-body {
    flex: 1;
    min-width: 0;
}

.search-filter-results .lawyer-name {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
}

.search-filter-results .meta-line {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #4b5563;
}

.search-filter-results .meta-line strong {
    color: #374151;
}

/* Fields row - Practice Areas and Languages side by side */
.search-filter-results .fields-row {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    margin-bottom: 20px;
}

.search-filter-results .field-list {
    flex: 1;
    min-width: 200px;
    max-width: 350px;
}

.search-filter-results .field-list p {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
}

.search-filter-results .field-list p strong {
    color: #1f2937;
}

.search-filter-results .field-list ul {
    margin: 0;
    padding: 0 0 0 20px;
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
}

.search-filter-results .field-list ul li {
    margin-bottom: 2px;
}

/* Actions / View More button */
.search-filter-results .actions {
    margin-top: 16px;
}

.search-filter-results .btn-view-more {
    display: inline-block;
    padding: 10px 28px;
    background-color: #0f4a6e;
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.search-filter-results .btn-view-more:hover {
    background-color: #0d3d5a;
    color: #ffffff !important;
}

/* ==========================================================================
   PAGINATION STYLES
   ========================================================================== */

.sf-pagination {
    margin: 40px 0 20px;
    padding: 20px 0;
    border-top: 1px solid #e5e5e5;
}

.sf-pagination .page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.sf-pagination .page-numbers li {
    margin: 0;
    padding: 0;
}

.sf-pagination .page-numbers a,
.sf-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 8px 16px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

/* Regular page links */
.sf-pagination .page-numbers a {
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #d1d5db;
}

.sf-pagination .page-numbers a:hover {
    background-color: #0f4a6e;
    color: #ffffff;
    border-color: #0f4a6e;
}

/* Current page */
.sf-pagination .page-numbers .current,
.sf-pagination .page-numbers span.current {
    background-color: #0f4a6e;
    color: #ffffff;
    border: 1px solid #0f4a6e;
    cursor: default;
}

/* Previous/Next arrows */
.sf-pagination .page-numbers a.prev,
.sf-pagination .page-numbers a.next {
    padding: 8px 16px;
}

.sf-pagination .page-numbers a.prev:hover,
.sf-pagination .page-numbers a.next:hover {
    background-color: #0f4a6e;
    color: #ffffff;
}

/* Dots/ellipsis */
.sf-pagination .page-numbers .dots {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: default;
    min-width: auto;
    padding: 8px 4px;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 900px) {
    .lwn-lawyer-directory {
        flex-direction: column;
    }

    .lwn-filters {
        flex: none;
        max-width: 100%;
        width: 100%;
    }

    .lwn-filter-form {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .lwn-filter-group {
        margin-bottom: 0;
    }

    .lwn-filter-buttons {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .lwn-filter-form {
        grid-template-columns: 1fr;
    }

    .lwn-filter-buttons {
        grid-column: span 1;
        flex-direction: column;
    }

    .search-filter-results .lawyer-media {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px;
    }

    .search-filter-results .lawyer-photo {
        width: 150px;
        height: 150px;
    }

    .search-filter-results .lawyer-body {
        width: 100%;
    }

    .search-filter-results .fields-row {
        flex-direction: column;
        gap: 16px;
    }

    .search-filter-results .field-list {
        max-width: 100%;
        text-align: left;
    }

    .search-filter-results .actions {
        text-align: center;
    }

    .sf-pagination .page-numbers {
        gap: 4px;
    }

    .sf-pagination .page-numbers a,
    .sf-pagination .page-numbers span {
        min-width: 40px;
        height: 40px;
        padding: 6px 12px;
        font-size: 14px;
    }

    .sf-pagination .page-numbers a.prev,
    .sf-pagination .page-numbers a.next {
        padding: 6px 10px;
    }
}

/* ==========================================================================
   HOMEPAGE SEARCH BOX (Pill Style - matches S&F Pro)
   ========================================================================== */

.lwn-search-box {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.lwn-search-box-form {
    width: 100%;
}

.lwn-search-box-wrapper {
    display: flex;
    gap: 0;
    align-items: stretch;
    width: 100%;
}

.lwn-search-box-input-wrapper {
    flex: 1 1 auto;
    position: relative;
    width: 100%;
    max-width: 100%;
}

/* Input field - pill style left side */
.lwn-search-box input[type="text"].lwn-search-box-input,
.lwn-search-box input.lwn-search-box-input {
    width: 100% !important;
    height: 65px !important;
    padding: 0 24px 0 38px !important;
    font-size: 16px !important;
    border: 1px solid #bbb !important;
    border-right: none !important;
    border-radius: 999px 0 0 999px !important;
    background: #fff !important;
    color: #4e4e4e !important;
    transition: border-color 0.2s;
    box-sizing: border-box !important;
    outline: none !important;
}

.lwn-search-box input[type="text"].lwn-search-box-input:focus,
.lwn-search-box input.lwn-search-box-input:focus {
    border-color: #0f4a6e !important;
}

.lwn-search-box input.lwn-search-box-input::placeholder {
    color: #9ca3af !important;
}

/* Button - pill style right side */
.lwn-search-box-button {
    height: 65px;
    padding: 0 32px;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 0 999px 999px 0;
    border: none;
    background-color: #0f4a6e;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.lwn-search-box-button:hover {
    background-color: #0d3d5a;
}

/* Homepage city autocomplete dropdown - aligned with input text */
.lwn-home-city-results {
    display: none;
    position: absolute;
    top: calc(100% - 1px);
    left: 28px;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
}

/* Dropdown results padding to match input text alignment */
.lwn-home-city-results .lwn-city-result {
    padding-left: 10px;
}

/* Responsive - Stack on mobile */
@media (max-width: 500px) {
    .lwn-search-box-wrapper {
        flex-direction: column;
        gap: 12px;
    }

    .lwn-search-box input[type="text"].lwn-search-box-input,
    .lwn-search-box input.lwn-search-box-input {
        border-right: 1px solid #bbb !important;
        border-radius: 999px !important;
        height: 55px !important;
        padding: 0 20px !important;
    }

    .lwn-search-box-button {
        border-radius: 999px;
        height: 55px;
        width: 100%;
    }

    .lwn-home-city-results {
        left: 0;
        border-radius: 0 0 20px 20px;
    }
}
