/* Compact Filter Bar System - Additional CSS */
/* This file adds new styles without modifying existing ones */

.compact-filter-bar {
    background: white;
    padding: 5px 0;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.compact-filter-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.compact-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

.compact-filter-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 85px;
    justify-content: center;
}

.compact-filter-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.compact-filter-btn.active {
    background: var(--aptia-green);
    border-color: var(--aptia-green);
    color: white;
    animation: pulse 2s infinite;
}

.compact-filter-btn.active .filter-count {
    background: rgba(255,255,255,0.3);
    color: white;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 208, 132, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 208, 132, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 208, 132, 0); }
}

.filter-count {
    background: var(--aptia-green);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 5px;
}

.filter-popup {
    position: absolute !important;
    top: 0;
    left: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    z-index: 999999999 !important;
    min-width: 500px;
    max-width: 700px;
    max-height: 600px;
    display: none;
    margin-top: 5px;
}

.filter-popup.show {
    display: block;
}

.filter-popup-header {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.filter-popup-title {
    font-weight: 600;
    color: #495057;
    margin: 0;
    font-size: 14px;
}

.filter-popup-content {
    padding: 15px;
}

.filter-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 10px;
}

.filter-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 15px;
    max-height: none;
    overflow-y: visible;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    transition: background 0.2s ease;
}

.filter-option:hover {
    background: #f8f9fa;
}

.filter-option input[type="checkbox"] {
    margin-right: 8px;
}

.filter-option-label {
    flex: 1;
    font-size: 14px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #dee2e6;
}

.filter-popup-actions {
    padding: 10px 15px;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
    display: flex;
    gap: 10px;
    border-radius: 0 0 8px 8px;
}

.filter-action-btn {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    color: #495057;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-action-btn:hover {
    background: #e9ecef;
}

.filter-action-btn.primary {
    background: var(--aptia-green);
    border-color: var(--aptia-green);
    color: white;
}

.filter-action-btn.primary:hover {
    background: #00b574;
}

/* Responsive Design */
@media (max-width: 768px) {
    .compact-filter-row {
        justify-content: flex-start;
    }
    
    .compact-filter-btn {
        min-width: 80px;
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .filter-popup {
        min-width: 200px;
        max-width: 300px;
    }
}

/* Range Input Styles */
.range-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.range-input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 12px;
}

.range-separator {
    color: #6c757d;
    font-size: 12px;
}


/* Enhanced Hover-Based Filter System Styles */

.compact-filter-btn {
    position: relative; /* Enable positioning for popups */
}

.compact-filter-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px); /* Subtle lift effect */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.filter-popup {
    /* Allow JavaScript positioning to work */
    position: fixed !important;
    z-index: 999999999 !important;
    min-width: 500px;
    max-width: 700px;
    max-height: 600px;
    
    /* Enhanced appearance */
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    background: white;
    
    /* Animation */
    opacity: 0;
    transition: all 0.2s ease;
    pointer-events: none;
}

.filter-popup.show {
    display: block !important;
    opacity: 1;
    pointer-events: auto;
}

/* Improved popup content styling */
.filter-popup-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    padding: 12px 15px;
    border-radius: 8px 8px 0 0;
}

.filter-popup-title {
    font-weight: 600;
    color: #495057;
    margin: 0;
    font-size: 14px;
    text-align: center;
}

.filter-popup-content {
    padding: 15px;
    max-height: none;
    overflow-y: visible;
}

/* Enhanced filter options */
.filter-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 15px;
    max-height: none;
    overflow-y: visible;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin: 0 -5px;
    padding-left: 5px;
    padding-right: 5px;
}

.filter-option:hover {
    background: #f8f9fa;
    transform: translateX(2px);
}

.filter-option input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.1);
    accent-color: var(--aptia-green);
}

.filter-option-label {
    flex: 1;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    user-select: none;
}

/* Enhanced action buttons */
.filter-popup-actions {
    padding: 12px 15px;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
    display: flex;
    gap: 8px;
    border-radius: 0 0 8px 8px;
}

.filter-action-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    color: #495057;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-action-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.filter-action-btn.primary {
    background: var(--aptia-green);
    border-color: var(--aptia-green);
    color: white;
}

.filter-action-btn.primary:hover {
    background: #00b574;
    border-color: #00b574;
}

/* Responsive hover behavior */
@media (max-width: 768px) {
    .filter-popup {
        min-width: 280px;
        max-width: 90vw;
        left: 10px !important;
        transform: none !important;
    }
    
    .filter-popup.show {
        transform: none !important;
    }
}

/* Search input enhancement */
.filter-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 10px;
    transition: border-color 0.2s ease;
}

.filter-search-input:focus {
    outline: none;
    border-color: var(--aptia-green);
    box-shadow: 0 0 0 2px rgba(0, 208, 132, 0.1);
}

/* Range inputs enhancement */
.range-input {
    padding: 8px 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 13px;
    transition: border-color 0.2s ease;
}

.range-input:focus {
    outline: none;
    border-color: var(--aptia-green);
    box-shadow: 0 0 0 2px rgba(0, 208, 132, 0.1);
}

/* Smooth scrollbar for filter options */
.filter-options::-webkit-scrollbar {
    width: 6px;
}

.filter-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.filter-options::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.filter-options::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Glow effect for non-default filter selections */
.compact-filter-btn.filtered {
    background: linear-gradient(135deg, var(--aptia-green) 0%, var(--aptia-teal) 100%);
    border-color: var(--aptia-green);
    color: white;
    box-shadow: 0 0 15px rgba(0, 208, 132, 0.6);
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(0, 208, 132, 0.6);
    }
    50% {
        box-shadow: 0 0 25px rgba(0, 208, 132, 0.9);
    }
}

.compact-filter-btn.filtered .filter-count {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    font-weight: bold;
}

/* Make filter count always visible when filtered */
.compact-filter-btn.filtered .filter-count {
    display: inline-block !important;
}
