/*
 * ELEGANT FILTER ROW STYLES
 * Compact single-row filter matching website's elegant form design
 * Uses bottom borders and minimal styling like elegant-form.css
 */

/* =============================================================================
   FILTER ROW CONTAINER
   ============================================================================= */

.filter-row-container {
    margin: 0.75rem 0;
    padding: 0;
    position: relative;
    z-index: 10;
}

.filter-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    align-items: end;
    background: transparent;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filter-row::-webkit-scrollbar {
    display: none;
}

/* Elegant "Nipange:" label styling */
.filter-label-column {
    display: flex;
    align-items: end;
    padding-bottom: 0.5rem;
    flex-shrink: 0;
}

.filter-label {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.filter-label-text {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
    position: relative;
    padding-right: 0.5rem;
    background: linear-gradient(135deg, rgba(253, 86, 49, 0.8), rgba(255, 140, 0, 0.6));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 1px 2px rgba(253, 86, 49, 0.3));
}

/* Add a subtle glow effect */
.filter-label-text::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(253, 86, 49, 0.1), rgba(255, 140, 0, 0.05));
    border-radius: 4px;
    z-index: -1;
    filter: blur(8px);
}

/* =============================================================================
   FILTER COLUMNS
   ============================================================================= */

.filter-column {
    min-width: 90px;
    flex: 0 0 auto;
    position: relative;
    white-space: nowrap;
}

.filter-column.filter-actions {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    align-items: end;
    gap: 0.25rem;
    min-width: 80px;
}

/* Add extra gap before the action buttons */
.filter-last-dropdown {
    margin-right: 1.25rem; /* 25% more than the default 0.75rem gap */
}

/* Vertical divider between filter buttons */
.filter-button-divider {
    width: 1px;
    height: 24px;
    background: linear-gradient(to bottom,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 20%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0.3) 80%,
        transparent 100%);
    margin: 0 0.25rem;
    align-self: center;
    position: relative;
}

/* Add subtle glow to the divider */
.filter-button-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 16px;
    background: rgba(253, 86, 49, 0.3);
    filter: blur(1px);
    z-index: -1;
}

/* Form group styling for filter columns */
.filter-row .form-group {
    position: relative;
    overflow: visible;
    margin-bottom: 0;
    padding-top: 0.5rem;
}

/* Elegant dropdown arrow styling */
.filter-row .form-group::after {
    content: '\f0d7'; /* FontAwesome down arrow */
    font-family: 'Font Awesome 5 Free', 'bootstrap-icons';
    font-weight: 900;
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(253, 86, 49, 0.7);
    font-size: 0.75rem;
    pointer-events: none;
    transition: color 0.3s ease;
    z-index: 1;
}

.filter-row .form-group:hover::after {
    color: #fd5631;
}

/* =============================================================================
   FILTER SELECT ELEMENTS - ELEGANT FORM INTEGRATION
   ============================================================================= */

.filter-row .filter-select {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0;
    color: rgba(255, 255, 255, 0.9);
    padding: 0.25rem 1.5rem 0.21rem 0.25rem;
    font-size: 0.85rem;
    font-weight: 400;
    transition: all 0.3s ease;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    text-align: left;
    min-width: 90px;
    height: auto;
    letter-spacing: 0.3px;
    box-shadow: none;
}

/* Elegant dropdown menu styling - like UPmyListings sort dropdown */
.filter-row .filter-select:focus {
    outline: none;
    border-bottom-color: #fd5631;
}

/* Elegant dropdown styling with shadow and transparency */
.filter-row .filter-select {
    position: relative;
}

.filter-row .filter-select:focus {
    outline: none;
    border-bottom-color: #fd5631;
}

/* Backdrop blur effect when dropdown is open */
.filter-row .filter-select:focus::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(2px);
    z-index: -1;
    pointer-events: none;
}

/* Custom dropdown menu styling - elegant with shadow and blur */
.filter-row .filter-select option {
    background: rgba(26, 30, 35, 0.85) !important;
    backdrop-filter: blur(10px) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 10px 16px !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    transition: all 0.3s ease !important;
    text-align: left !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.filter-row .filter-select option:hover,
.filter-row .filter-select option:checked {
    background: rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(15px) !important;
    color: rgba(255, 255, 255, 0.95) !important;
}

/* Enhanced dropdown container styling */
.filter-row .filter-select:focus option {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

/* Custom scrollbar for elegant dropdown */
.filter-row .filter-select::-webkit-scrollbar {
    width: 6px;
}

.filter-row .filter-select::-webkit-scrollbar-track {
    background: rgba(26, 30, 35, 0.6);
    border-radius: 3px;
}

.filter-row .filter-select::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    transition: background 0.3s ease;
}

.filter-row .filter-select::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.filter-row .filter-select:hover {
    border-bottom-color: rgba(255, 255, 255, 0.4);
}

.filter-row .filter-select:disabled {
    border-bottom-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

.filter-row .filter-select:disabled:hover {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}



/* =============================================================================
   FILTER ACTION BUTTONS - COMPACT ELEGANT STYLE
   ============================================================================= */

.filter-clear-btn,
.filter-apply-btn {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0;
    color: rgba(255, 255, 255, 0.8);
    padding: 0.25rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    position: relative;
}

.filter-clear-btn:hover {
    border-bottom-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.filter-apply-btn {
    border-bottom-color: #fd5631;
    color: #fd5631;
}

.filter-apply-btn:hover {
    border-bottom-color: #ff6b4a;
    color: #ff6b4a;
    box-shadow: 0 1px 0 0 #ff6b4a;
}

.filter-clear-btn:focus,
.filter-apply-btn:focus {
    outline: none;
    box-shadow: 0 1px 0 0 currentColor;
}

/* Button icons */
.filter-clear-btn i,
.filter-apply-btn i {
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.filter-clear-btn:hover i {
    transform: rotate(180deg);
}

.filter-apply-btn:hover i {
    transform: scale(1.05);
}

/* =============================================================================
   ACTIVE FILTER INDICATORS - ELEGANT FORM INTEGRATION
   ============================================================================= */

.filter-row .filter-select.has-value {
    border-bottom-color: #fd5631;
    color: #fd5631;
}

.filter-row .filter-select.has-value:hover {
    border-bottom-color: #ff6b4a;
}

/* Integrate with elegant form label system */
.filter-row .form-select.has-value ~ .form-label,
.filter-row .form-select:valid ~ .form-label,
.filter-row .form-select[value]:not([value=""]) ~ .form-label {
    top: -0.285rem;
    left: 0;
    font-size: 0.7rem;
    color: #fd5631;
    background-color: rgba(42, 40, 55, 0.95);
    padding: 0 0.25rem;
    z-index: 1;
    border-radius: 2px;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* =============================================================================
   LOADING STATE
   ============================================================================= */

.filter-row.loading {
    pointer-events: none;
    opacity: 0.7;
}

.filter-row.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(253, 86, 49, 0.3);
    border-top: 2px solid #fd5631;
    border-radius: 50%;
    animation: filterSpinner 1s linear infinite;
}

@keyframes filterSpinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =============================================================================
   RESPONSIVE DESIGN - MAINTAIN SINGLE ROW
   ============================================================================= */

/* Large screens and below */
@media (max-width: 1200px) {
    .filter-row {
        gap: 0.3rem;
    }

    .filter-column {
        min-width: 85px;
    }

    .filter-row .filter-select {
        font-size: 0.8rem;
        min-width: 85px;
    }

    .filter-label-text {
        font-size: 0.9rem;
        padding-right: 0.3rem;
    }

    .filter-last-dropdown {
        margin-right: 1rem; /* Slightly reduced gap on large screens */
    }

    .filter-button-divider {
        height: 22px;
        margin: 0 0.2rem;
    }
}

/* Medium screens and below */
@media (max-width: 992px) {
    .filter-row {
        gap: 0.4rem;
    }

    .filter-column {
        min-width: 75px;
    }

    .filter-row .filter-select {
        font-size: 0.75rem;
        min-width: 75px;
        padding: 0.2rem 1rem 0.18rem 0.2rem;
    }

    .filter-row .form-label {
        font-size: 0.7rem;
    }

    .filter-row .form-select.has-value ~ .form-label,
    .filter-row .form-select:valid ~ .form-label,
    .filter-row .form-select[value]:not([value=""]) ~ .form-label {
        font-size: 0.65rem;
    }

    .filter-clear-btn,
    .filter-apply-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .filter-label-text {
        font-size: 0.85rem;
        padding-right: 0.25rem;
    }

    .filter-last-dropdown {
        margin-right: 0.8rem; /* Reduced gap on medium screens */
    }

    .filter-button-divider {
        height: 20px;
        margin: 0 0.15rem;
    }
}

/* Small screens - still maintain single row with horizontal scroll */
@media (max-width: 768px) {
    .filter-row-container {
        margin: 0.5rem 0;
        position: relative;
    }

    .filter-row {
        gap: 0.3rem;
        padding: 0.25rem 0;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .filter-column {
        min-width: 70px;
        flex-shrink: 0;
    }

    .filter-row .filter-select {
        font-size: 0.7rem;
        min-width: 70px;
        padding: 0.15rem 0.8rem 0.13rem 0.15rem;
    }

    .filter-row .form-label {
        font-size: 0.65rem;
    }

    .filter-row .form-select.has-value ~ .form-label,
    .filter-row .form-select:valid ~ .form-label,
    .filter-row .form-select[value]:not([value=""]) ~ .form-label {
        font-size: 0.6rem;
    }

    .filter-clear-btn,
    .filter-apply-btn {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    .filter-label-text {
        font-size: 0.8rem;
        padding-right: 0.2rem;
    }

    .filter-last-dropdown {
        margin-right: 0.6rem; /* Compact gap on small screens */
    }

    .filter-button-divider {
        height: 18px;
        margin: 0 0.1rem;
    }
}

/* Extra small screens - compact single row */
@media (max-width: 576px) {
    .filter-column {
        min-width: 65px;
    }

    .filter-select {
        font-size: 0.65rem;
        min-width: 65px;
        padding: 0.1rem 0.7rem 0.1rem 0.1rem;
    }

    .filter-label {
        font-size: 0.6rem;
        margin-bottom: 0.1rem;
    }

    .filter-clear-btn,
    .filter-apply-btn {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .filter-clear-btn i,
    .filter-apply-btn i {
        font-size: 0.7rem;
    }

    .filter-label-text {
        font-size: 0.75rem;
        padding-right: 0.15rem;
    }

    .filter-last-dropdown {
        margin-right: 0.5rem; /* Minimal gap on extra small screens */
    }

    .filter-button-divider {
        height: 16px;
        margin: 0 0.08rem;
        width: 0.8px; /* Thinner divider on very small screens */
    }
}

/* =============================================================================
   ACCESSIBILITY
   ============================================================================= */

/* Focus visible for keyboard navigation */
.filter-select:focus-visible,
.filter-clear-btn:focus-visible,
.filter-apply-btn:focus-visible {
    outline: 2px solid #fd5631;
    outline-offset: 2px;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .filter-row,
    .filter-select,
    .filter-clear-btn,
    .filter-apply-btn,
    .filter-label {
        transition: none;
    }
    
    .filter-clear-btn:hover i {
        transform: none;
    }
    
    .filter-apply-btn:hover i {
        transform: none;
    }
    
    @keyframes filterSpinner {
        0%, 100% { transform: rotate(0deg); }
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .filter-row {
        border-width: 2px;
    }

    .filter-select {
        border-width: 2px;
    }

    .filter-clear-btn,
    .filter-apply-btn {
        border-width: 2px;
    }
}

/* =============================================================================
   NO RESULTS MESSAGE
   ============================================================================= */

.no-results-message {
    display: none;
    text-align: center;
    padding: 2rem 1rem;
    margin: 1rem 0;
    background: transparent;
    border: none;
    border-radius: 0;
    color: rgba(255, 255, 255, 0.8);
}

.no-results-content i {
    font-size: 3rem;
    color: rgba(253, 86, 49, 0.6);
    margin-bottom: 1rem;
    display: block;
}

.no-results-content h3 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.no-results-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.no-results-content .btn {
    background: transparent;
    border: 1px solid rgba(253, 86, 49, 0.5);
    color: #fd5631;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.no-results-content .btn:hover {
    background: rgba(253, 86, 49, 0.1);
    border-color: #fd5631;
    color: #ff6b4a;
    transform: translateY(-2px);
}

/* Responsive no results message */
@media (max-width: 768px) {
    .no-results-message {
        padding: 2rem 1rem;
        margin: 1rem 0;
    }

    .no-results-content i {
        font-size: 2.5rem;
    }

    .no-results-content h3 {
        font-size: 1.25rem;
    }

    .no-results-content p {
        font-size: 0.9rem;
    }
}
