/* ========================================
   FREELANCER LIST FILTER STYLING
   Modern dropdown design with clean UI
   ======================================== */

/* CSS Custom Properties for consistent theming */
:root {
    --primary-text-color: #000000;
    --secondary-text-color: #777777;
    --border-color: #d3d6da;
    --border-divider-color: #d9d9d9;
    --background-white: #ffffff;
    --accent-red: #ff4c4b;
    --border-radius-sm: 4px;
    --border-radius-md: 10px;
    --font-family-primary: "DM Sans", sans-serif;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.08);
    --transition-smooth: all 0.3s ease;
}

/* ========================================
   MAIN FILTER CONTAINER
   ======================================== */
/* Fix horizontal scroll issues */
.content {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.freelancer-filter-container {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    gap: 36px;
    width: 100%;
    max-width: 1496px;
    height: auto;
    background: var(--background-white);
    border-top: 1px solid var(--border-divider-color);
    margin: 0 auto;
    z-index: 10;
}

/* ========================================
   SECTION TITLE
   ======================================== */
.freelancer-section-title {
    margin: 0;
    height: 42px;
    font-family: var(--font-family-primary);
    font-style: normal;
    font-weight: 700;
    font-size: 32px;
    line-height: 130%;
    text-align: left;
    color: var(--primary-text-color);
    flex: none;
    order: 0;
    flex-grow: 0;
    flex-shrink: 0;
}

.freelancer-section-title-results {
    font-size: 24px;
    font-weight: 400;
    color: var(--secondary-text-color);
}

/* ========================================
   FREELANCE CARD LAYOUT
   ======================================== */
.freelance-location-rating {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
}

.freelance-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--secondary-text-color);
}

.freelance-location i {
    color: var(--accent-red);
    font-size: 12px;
}

.freelance-rating-text {
    font-size: 12px;
    color: var(--secondary-text-color);
    font-weight: 500;
}

.freelance-rating-text span {
    font-weight: 700;
    color: #fbbf24;
}

/* ========================================
   INDUSTRY DISPLAY STYLING
   ======================================== */
.freelance-industry {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 14px;
    color: var(--secondary-text-color);
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.freelance-industry:hover {
    background: #f1f3f4;
    border-color: var(--accent-red);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 76, 75, 0.1);
}

.freelance-industry i {
    color: var(--accent-red);
    font-size: 14px;
}

/* ========================================
   FILTER CONTROLS WRAPPER
   ======================================== */
.freelancer-filter-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0px;
    gap: 8px;
    width: auto;
    height: auto;
    flex: none;
    order: 1;
    flex-grow: 0;
}

/* ========================================
   DROPDOWN COMPONENTS
   ======================================== */
.freelancer-dropdown {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
    gap: 10px;
    width: 222px;
    height: 42px;
    flex: none;
    flex-grow: 0;
    position: relative;
}

.freelancer-dropdown.country-filter {
    order: 0;
}

.freelancer-dropdown.industry-filter {
    order: 1;
}

/* ========================================
   DROPDOWN INPUT FIELD
   ======================================== */
.dropdown-input-field {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 10px 14px;
    width: auto;
    gap: 12px;
    min-width: 220px;
    height: 42px;
    background: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
    flex: none;
    order: 0;
    align-self: stretch;
    flex-grow: 0;
}

.dropdown-input-field:hover {
    border-color: var(--accent-red);
    box-shadow: var(--shadow-light);
}

.dropdown-input-field.active {
    border-color: var(--accent-red);
    box-shadow: var(--shadow-light);
}

/* ========================================
   DROPDOWN CONTENT LAYOUT
   ======================================== */
.dropdown-content-frame {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0px;
    gap: 1px;
    width: 194px;
    height: 18px;
    flex: none;
    order: 0;
    flex-grow: 1;
}

.dropdown-label-text {
    max-width: 164px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: max-content;
    margin: 0;
    font-family: var(--font-family-primary);
    font-style: normal;
    font-weight: 500;
    font-size: 14px;
    line-height: 130%;
    display: flex;
    width: auto;
    align-items: center;
    color: var(--primary-text-color);
    flex: none;
    order: 0;
    flex-grow: 0;
}

.dropdown-chevron-icon {
    width: 15px;
    height: 15px;
    flex: none;
    order: 1;
    flex-grow: 0;
    transform: rotate(0deg);
    transition: var(--transition-smooth);
    background-image: url("data:image/svg+xml,%3Csvg width='15' height='15' viewBox='0 0 15 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.75 5.625L7.5 9.375L11.25 5.625' stroke='%23223147' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.dropdown-input-field.active .dropdown-chevron-icon {
    transform: rotate(180deg);
}

/* ========================================
   DROPDOWN MENU
   ======================================== */
.dropdown-menu-container {
    box-sizing: border-box;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    gap: 14px;
    width: 222px;
    background: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    position: absolute;
    top: 52px;
    left: 0;
    z-index: 900;
    box-shadow: var(--shadow-light);
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
}

.dropdown-menu-container.show {
    display: flex;
}

/* ========================================
   CHECKBOX OPTIONS
   ======================================== */
.dropdown-checkbox-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0px;
    gap: 8px;
    width: 100%;
    border-radius: 0px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.custom-checkbox-input {
    box-sizing: border-box;
    width: 16px;
    height: 16px;
    background: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    flex: none;
    order: 0;
    flex-grow: 0;
    cursor: pointer;
    position: relative;
    appearance: none;
    transition: var(--transition-smooth);
}

.custom-checkbox-input:checked {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

.custom-checkbox-input:checked::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid var(--background-white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ========================================
   RADIO BUTTON OPTIONS
   ======================================== */
.custom-radio-input {
    box-sizing: border-box;
    width: 16px;
    height: 16px;
    background: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    flex: none;
    order: 0;
    flex-grow: 0;
    cursor: pointer;
    position: relative;
    appearance: none;
    transition: var(--transition-smooth);
}

.custom-radio-input:checked {
    background: var(--background-white);
    border-color: var(--accent-red);
    border-width: 2px;
}

.custom-radio-input:checked::after {
    content: "";
    position: absolute;
    left: 2px;
    top: 2px;
    width: 8px;
    height: 8px;
    background: var(--accent-red);
    border-radius: 50%;
}

.checkbox-option-label {
    font-family: var(--font-family-primary);
    font-style: normal;
    font-weight: 500;
    font-size: 12px;
    line-height: 130%;
    display: flex;
    align-items: center;
    color: var(--primary-text-color);
    flex: none;
    width: 100%;
    order: 1;
    flex-grow: 0;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.dropdown-checkbox-option:hover .checkbox-option-label {
    color: var(--accent-red);
}

/* ========================================
   SEARCH INPUT FIELD
   ======================================== */
.freelancer-search-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    padding: 0px;
    gap: 6px;
    width: 371px;
    height: 42px;
    flex: none;
    order: 2;
    flex-grow: 0;
    flex-shrink: 1;
    min-width: 200px;
}

.search-field-wrapper {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    padding: 12px 16px;
    width: 100%;
    height: 56px;
    background: var(--background-white);
    border-bottom: 1px solid var(--border-divider-color);
    flex: none;
    order: 0;
    align-self: stretch;
    flex-grow: 0;
    transition: var(--transition-smooth);
}

.search-field-wrapper:focus-within {
    border-bottom-color: var(--accent-red);
}

.search-content-frame {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0px;
    gap: 12px;
    width: 100%;
    height: 32px;
    flex: none;
    order: 0;
    align-self: stretch;
    flex-grow: 0;
}
.search-filter-btn {
    width: 100%;
    height: 42px;
    background: var(--accent-red);
    border: none;
    color: var(--background-white);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 16px;
    cursor: pointer;
}
.search-icon {
    width: 24px;
    height: 24px;
    flex: none;
    order: 0;
    flex-grow: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21 21L16.514 16.506L21 21ZM19 10.5C19 15.194 15.194 19 10.5 19C5.806 19 2 15.194 2 10.5C2 5.806 5.806 2 10.5 2C15.194 2 19 5.806 19 10.5Z' stroke='%23000000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.search-input-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0px;
    height: 32px;
    flex: none;
    order: 1;
    flex-grow: 1;
}

.search-input-field {
    width: 100%;
    height: 32px;
    border: none;
    outline: none;
    font-family: var(--font-family-primary);
    font-style: normal;
    font-weight: 500;
    font-size: 16px;
    line-height: 32px;
    color: var(--primary-text-color);
    background: transparent;
}

.search-input-field::placeholder {
    color: var(--secondary-text-color);
    font-feature-settings: "ss01" on;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1464px) {
    .freelancer-filter-container {
        max-width: 100%;
        padding: 20px;
        gap: 24px;
    }

    .freelancer-filter-controls {
        width: auto;
        flex-wrap: wrap;
    }
}

@media (max-width: 992px) {
    .freelancer-filter-container {
        flex-direction: column;
        height: auto;
        gap: 20px;
        padding: 20px;
    }
    #modern-filter-form {
        width: 100% !important;
    }

    .freelancer-section-title {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }

    .freelancer-filter-controls {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 16px;
    }

    .freelancer-search-container {
        width: 100%;
        flex-direction: column;
        gap: 16px;
    }

    .search-field-wrapper {
        width: 100%;
    }

    .search-filter-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .freelancer-dropdown {
        width: 100% !important;
        min-width: 200px;
    }

    .modern-filter-form {
        width: 100% !important;
    }

    .dropdown-input-field {
        width: 100%;
    }

    .dropdown-menu-container {
        width: 100%;
    }

    .freelancer-filter-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .freelancer-section-title {
        font-size: 28px;
        text-align: left;
    }
}

@media (max-width: 576px) {
    .freelancer-filter-container {
        padding: 15px;
        overflow-x: hidden;
        height: auto;
    }
    .modern-filter-form {
        width: 100% !important;
    }
    .freelancer-section-title {
        font-size: 24px;
        width: 100%;
    }

    .freelancer-search-container {
        width: 100%;
        flex-direction: column;
        gap: 12px;
    }

    .search-field-wrapper {
        padding: 10px 12px;
        height: 48px;
    }

    .search-filter-btn {
        width: 100%;
        height: 48px;
        font-size: 16px;
    }

    .dropdown-input-field {
        padding: 8px 12px;
        height: 40px;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.dropdown-hidden {
    display: none !important;
}

.dropdown-visible {
    display: flex !important;
}

.no-scroll {
    overflow: hidden;
}

/* ========================================
   ANIMATION CLASSES
   ======================================== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu-container.show {
    animation: fadeInDown 0.3s ease-out;
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */
.custom-checkbox-input:focus {
    outline: 2px solid var(--accent-red);
    outline-offset: 2px;
}

.dropdown-input-field:focus {
    outline: 2px solid var(--accent-red);
    outline-offset: 2px;
}

.search-input-field:focus {
    outline: none;
}

.search-field-wrapper:focus-within {
    outline: 2px solid var(--accent-red);
    outline-offset: 2px;
    border-radius: var(--border-radius-sm);
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */
.dropdown-menu-container::-webkit-scrollbar {
    width: 6px;
}

.dropdown-menu-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.dropdown-menu-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.dropdown-menu-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red);
}

/* ========================================
   PRICE RANGE SLIDER STYLES
   ======================================== */
.freelancer-dropdown.price-filter {
    order: 3;
    position: relative;
    z-index: 10;
}

.dropdown-menu-container.price-range-dropdown {
    width: 262px;
    padding: 0;
    border: 1px solid var(--border-color);
    background: var(--background-white);
    box-shadow: var(--shadow-light);
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    z-index: 9999;
    border-radius: 10px;
    overflow: visible;
}

.dropdown-menu-container.price-range-dropdown.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 9999 !important;
}

.price-range-frame {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 16px;
    gap: 14px;
    width: 262px;
    height: 113px;
    background: #ffffff;
    border: 1px solid #d3d6da;
    border-radius: 10px;
    flex: none;
    order: 1;
    flex-grow: 0;
}

.range-slider-wrapper {
    width: 230px;
    height: 81px;
    flex: none;
    order: 0;
    flex-grow: 0;
    position: relative;
}

.range-slider-track {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
    gap: 20px;
    isolation: isolate;
    position: absolute;
    width: 217px;
    height: 7px;
    left: 6px;
    top: 11px;
    background: rgba(255, 76, 75, 0.23);
    border-radius: 10px;
}

.range-slider-fill {
    width: 184px;
    height: 7px;
    background: #ff4c4b;
    border-radius: 10px;
    flex: none;
    order: 0;
    flex-grow: 0;
    z-index: 0;
    transition: width 0.3s ease, left 0.3s ease;
    position: absolute;
    left: 0;
    top: 0;
}

.range-slider-handle {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 0px;
    position: absolute;
    width: 29px;
    height: 29px;
    top: -11px;
    filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25));
    border-radius: 24px;
    flex: none;
    flex-grow: 0;
    cursor: pointer;
    user-select: none;
    transition: left 0.3s ease;
}

.range-slider-handle.min-handle {
    left: 0px;
    order: 1;
    z-index: 1;
}

.range-slider-handle.max-handle {
    left: 188px; /* Will be overridden by JavaScript */
    order: 3;
    z-index: 3;
}

.slider-handle-circle {
    box-sizing: border-box;
    width: 29px;
    height: 29px;
    background: #ff4c4b;
    border: 8px solid #ffffff;
    border-radius: 50%;
    flex: none;
    order: 0;
    flex-grow: 0;
}
#modern-filter-form {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: -webkit-fill-available;
    align-items: center;
}
.range-input-fields {
    justify-content: space-between;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0px;
    gap: 11px;
    position: absolute;
    width: 210px;
    height: 32px;
    left: 8px;
    top: 45px;
    flex: none;
    order: 2;
    flex-grow: 0;
    z-index: 2;
}

.range-input-field {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 8px 16px;
    width: 86px;
    height: 32px;
    border: 2px solid #292929;
    border-radius: 40px;
    flex: none;
    flex-grow: 0;
}

.range-input-field.min-field {
    order: 0;
}

.range-input-field.max-field {
    order: 2;
}

.range-input-field span {
    font-family: "Inter", sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 13px;
    line-height: 16px;
    color: #8b8b8b;
    flex: none;
    order: 0;
    flex-grow: 0;
    white-space: nowrap;
}

.range-separator {
    width: 16px;
    height: 2px;
    background: #292929;
    border-radius: 2px;
    flex: none;
    order: 1;
    flex-grow: 0;
}

/* Handle hover states */
.range-slider-handle:hover .slider-handle-circle {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.range-slider-handle:active .slider-handle-circle {
    transform: scale(1.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .freelancer-filter-container {
        overflow: visible;
        z-index: 10;
    }

    .freelancer-dropdown {
        overflow: visible;
    }

    .freelancer-dropdown.price-filter {
        position: relative;
        z-index: 10;
        overflow: visible;
    }

    .dropdown-menu-container.price-range-dropdown {
        width: calc(100vw - 40px);
        left: 20px;
        right: 20px;
        position: absolute;
        top: 52px;
        z-index: 9999 !important;
        max-width: 320px;
        margin: 0 auto;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    }

    .dropdown-menu-container.price-range-dropdown.show {
        z-index: 9999 !important;
        display: flex !important;
    }

    #modern-filter-form {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .price-range-frame {
        width: 100%;
    }

    .range-slider-wrapper {
        width: calc(100% - 32px);
    }

    .range-slider-track {
        width: calc(100% - 20px);
    }

    .range-input-fields {
        width: calc(100% - 12px);
    }

    .range-input-field {
        width: 70px;
        padding: 6px 12px;
    }

    .range-input-field span {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .freelancer-dropdown.price-filter {
        width: 100% !important;
        position: relative;
        z-index: 10;
    }

    .dropdown-menu-container.price-range-dropdown {
        width: calc(100vw - 30px) !important;
        left: 15px !important;
        right: 15px !important;
        max-width: none !important;
        position: absolute !important;
        top: 52px !important;
        z-index: 9999 !important;
        transform: none !important;
    }

    .dropdown-menu-container.price-range-dropdown.show {
        position: absolute !important;
        z-index: 9999 !important;
    }

    .range-slider-wrapper {
        width: calc(100% - 16px);
    }

    .range-slider-track {
        width: calc(100% - 12px);
    }

    .range-input-fields {
        width: calc(100% - 8px);
        gap: 8px;
    }

    .range-input-field {
        width: 60px;
        padding: 4px 8px;
    }

    .range-input-field span {
        font-size: 11px;
    }

    .range-separator {
        width: 12px;
    }
}
