/* Custom Directorist Search Widget - Flash UI Styles */
/* Widget Body - Positioning Context for Modal */
.dcsw-compact-search-body {
    position: relative;
    /* Create positioning context for modal */
}

/* Version 1.9.4 */

:root {
    --dcsw-bg-color: #212124;
    --dcsw-panel-bg: #2c2c2f;
    --dcsw-border-color: #4a4a4f;
    --dcsw-text-primary: #e0e0e0;
    --dcsw-text-secondary: #8d8d93;
    --dcsw-text-headings: #ffffff;
    --dcsw-accent-red: #c62828;
    --dcsw-accent-red-hover: #e53935;
    --dcsw-input-bg: #38383c;
    --dcsw-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Base Widget Container */
.widget_dcsw_custom_search_widget,
.dcsw-widget,
.directorist-widget,
.dcsw-compact-search-body,
.dcsw-search-container {
    font-family: var(--dcsw-font-sans);
    color: var(--dcsw-text-primary);
    position: relative;
    overflow: visible !important;
    z-index: 1000;
}

/* Compact Form Container */
.dcsw-compact-form {
    display: block;
    position: relative;
    width: 100%;
    overflow: visible !important;
}

.dcsw-inputs-wrapper {
    display: flex;
    flex-direction: column !important;
    gap: 8px;
    margin-bottom: 8px;
    margin-top: 0 !important;
    padding-top: 0 !important;
    width: 100%;
}

/* Remove extra spacing above the search area */
.widget_dcsw_custom_search_widget .widget-title+*,
.dcsw-compact-form,
.dcsw-compact-search-body {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.dcsw-buttons-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.dcsw-field-element {
    flex: 1;
    min-width: 150px;
    margin-bottom: 0 !important;
    position: relative;
}

/* Hide Directorist's floating labels */
.dcsw-compact-form .directorist-form-label,
.dcsw-compact-form .directorist-search-field__label,
.dcsw-compact-form label.directorist-btn-label,
.dcsw-compact-form .directorist-floating-label {
    display: none !important;
}

/* Directory type dropdown - HIDDEN BY USER REQUEST */
.dcsw-directory-type-field,
.dcsw-directory-dropdown-wrapper {
    display: none !important;
}

.dcsw-directory-dropdown {
    width: 100%;
    height: 40px !important;
    padding: 0 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(0, 0, 0, 0.2);
    color: #fff !important;
    cursor: pointer;
    display: none !important;
}

/* Search Button */
.dcsw-search-btn {
    flex: 1;
    height: 48px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto !important;
}

/* Filter wrapper - contains button and modal */
.dcsw-filter-wrapper {
    position: relative;
    /* Changed from static to allow modal positioning */
    flex-shrink: 0;
}

/* Filter button */
.dcsw-filter-btn {
    height: 48px;
    width: 48px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

.dcsw-filter-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.dcsw-filter-btn.active {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Filter modal - positioned absolute relative to wrapper */
.dcsw-filter-modal {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 15px;
    background-color: #1a1a1a;
    border-radius: 8px;
    padding: 0;
    width: 100%;
    /* Match widget width */
    max-width: 650px;
    /* Maximum width for two-column layout */
    max-height: 70vh;
    /* Global max height for the modal */
    z-index: 9999999;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
    color: #fff;
    display: flex;
    /* Changed to flex to handle header/body scrolling */
    flex-direction: column;
}

.dcsw-filter-modal.active {
    display: flex !important;
    /* Ensure flex when active */
}

/* Search input styling */
.dcsw-search-input {
    width: 100%;
    height: 44px !important;
    padding: 0 12px !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 4px !important;
    color: #fff !important;
    font-size: 14px;
}

.dcsw-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Force ALL text and symbols white in the widget */
.dcsw-compact-search-body,
.dcsw-compact-search-body *,
.dcsw-compact-form,
.dcsw-compact-form *,
.dcsw-filter-modal,
.dcsw-filter-modal * {
    color: #fff !important;
}

/* Caret Arrow */
.dcsw-filter-modal-caret {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #8b0000;
}

/* Modal Header */
.dcsw-filters-header {
    background-color: #8b0000;
    color: #fff;
    padding: 12px 15px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 8px 8px 0 0;
    text-align: center;
    flex-shrink: 0;
}

/* Modal Body Container - Scrollable */
.dcsw-filters-panel {
    display: flex;
    flex-direction: column;
    max-height: 100%;
    /* Fill modal */
    overflow: hidden;
    border-radius: 8px;
}

.dcsw-filters-body {
    padding: 15px;
    overflow-y: auto;
    /* Allow the whole body to scroll if needed, or individual sections */
    flex: 1;
    max-height: calc(70vh - 50px);
    /* Subtract header height approx */
}

/* Scrollbar for the main body */
.dcsw-filters-body::-webkit-scrollbar {
    width: 6px;
}

.dcsw-filters-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.dcsw-filters-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Two-Column Grid for Category/Tag */
.dcsw-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

/* Filter Sections */
.dcsw-filter-section {
    margin-bottom: 0;
    /* Reset margin when inside grid */
}

/* Full-width sections (like DATE/TIME) */
.dcsw-filter-section:not(.dcsw-filter-grid > .dcsw-filter-section) {
    margin-bottom: 15px;
}

.dcsw-filter-section:last-child {
    margin-bottom: 0;
}

.dcsw-filter-section h3 {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px 0;
    /* Compact spacing below section title */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Search Field inside Filter */
.dcsw-filter-search {
    position: relative;
    width: 100%;
    margin-bottom: 8px;
    /* Compact spacing below search box */
}

.dcsw-search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    pointer-events: none;
}

.dcsw-filter-search-input {
    width: 100%;
    height: 32px;
    padding: 0 8px 0 28px;
    background: rgba(255, 255, 255, 0.05);
    /* Slight bg for contrast */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff !important;
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s;
}

.dcsw-filter-search-input:focus {
    border-color: #8b0000;
    /* Red highlight on focus */
    background: rgba(255, 255, 255, 0.08);
}

.dcsw-filter-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* SCROLLABLE LIST - The Fix */
.dcsw-filter-options {
    display: block;
    width: 100%;
    position: relative;
    max-height: 140px !important;
    /* Compact height for scrolling */
    overflow-y: auto !important;
    /* Force scroll capability */
    padding-right: 6px;
    /* Space for scrollbar */
    margin-top: 4px;
    margin-bottom: 6px;
    scrollbar-width: thin;
    /* Firefox support */
    scrollbar-color: rgba(255, 255, 255, 0.4) rgba(0, 0, 0, 0.2);
    /* Firefox support */
}

/* Scrollbar Styling for the list (Webkit) */
.dcsw-filter-options::-webkit-scrollbar {
    width: 8px;
}

.dcsw-filter-options::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.dcsw-filter-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 4px;
}

.dcsw-filter-options::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* Checkbox Items */
.dcsw-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px;
    cursor: pointer;
    transition: background-color 0.15s;
    border-radius: 3px;
}

.dcsw-checkbox-wrapper:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Hide native checkbox */
.dcsw-checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Custom checkbox appearance */
.dcsw-checkbox-custom {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 3px;
    background-color: transparent;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

/* Checked state */
.dcsw-checkbox-wrapper input[type="checkbox"]:checked+.dcsw-checkbox-custom {
    background-color: #8b0000;
    border-color: #8b0000;
}

.dcsw-checkbox-wrapper input[type="checkbox"]:checked+.dcsw-checkbox-custom::after {
    content: '✓';
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}

/* Checkbox label */
.dcsw-checkbox-wrapper label {
    font-size: 12px;
    color: #fff;
    cursor: pointer;
    line-height: 1.3;
}

/* Date/Time Picker Styles */
.dcsw-datetime-picker {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Date Range Inputs */
.dcsw-date-range {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dcsw-date-range label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dcsw-filter-modal {
    position: absolute;
    top: 100%;
    left: 50%;
    /* Center horizontally */
    transform: translateX(-50%);
    /* Center offset */
    margin-top: 8px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    /* Match parent width */
    max-width: 650px;
    /* Maximum width for two-column layout */
    max-height: 600px;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.2);
}

.dcsw-date-input {
    width: 100%;
    height: 32px;
    padding: 0 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff !important;
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s;
}

.dcsw-date-input:focus {
    border-color: #8b0000;
    background: rgba(255, 255, 255, 0.08);
}

.dcsw-date-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Date inputs row - side by side */
.dcsw-date-inputs-row {
    display: flex;
    gap: 8px;
}

.dcsw-date-inputs-row .dcsw-date-input {
    flex: 1;
}

/* Datetime row - calendar and time side by side */
.dcsw-datetime-row {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

/* Calendar */
.dcsw-calendar {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    padding: 8px;
    max-width: 220px;
    /* Limit calendar width */
}

.dcsw-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dcsw-calendar-nav {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    transition: background 0.2s;
}

.dcsw-calendar-nav:hover {
    background: rgba(255, 255, 255, 0.15);
}

.dcsw-calendar-month {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.dcsw-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 2px;
}

.dcsw-calendar-weekdays>div {
    text-align: center;
    font-size: 9px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    padding: 1px 0;
}

.dcsw-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.dcsw-calendar-day {
    width: 26px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.dcsw-calendar-day.empty {
    background: transparent;
    cursor: default;
}

.dcsw-calendar-day:not(.empty):hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.dcsw-calendar-day.selected {
    background: #8b0000;
    border-color: #a00000;
    font-weight: 600;
}

.dcsw-calendar-day.selected:hover {
    background: #a00000;
}

/* Time Selector */
.dcsw-time-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dcsw-time-selector label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dcsw-time-inputs {
    display: flex;
    gap: 8px;
}

.dcsw-time-group {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 6px 10px;
}

.dcsw-time-group span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 600;
}

.dcsw-time-input {
    width: 36px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    outline: none;
}

.dcsw-time-input::-webkit-inner-spin-button,
.dcsw-time-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.dcsw-time-input[type=number] {
    -moz-appearance: textfield;
}

/* Location Autocomplete */
.dcsw-location-wrapper {
    position: relative;
    width: 100%;
}

.dcsw-location-input {
    width: 100%;
    height: 44px !important;
    padding: 0 12px !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 4px !important;
    color: #fff !important;
    font-size: 14px;
}

.dcsw-location-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .dcsw-compact-form {
        flex-direction: column;
    }

    .dcsw-buttons-wrapper {
        flex-wrap: wrap;
    }

    .dcsw-filter-modal {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 350px;
    }
}