/* Enhanced Filter Styles - Continent-based Country Grouping */

/* Country Dropdown - Based on Dropdown_option-2-final.html */
.continent-tabs {
    margin-bottom: 16px;
}

.dropdown {
    position: relative;
    flex-grow: 1;
}

.main-button {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 180px;
    background-color: #fff;
    color: #1c1e21;
    padding: 8px 12px;
    font-size: 1rem;
    border: 1px solid #ccd0d5;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s, border-color 0.2s;
}

.main-button:hover {
    border-color: #8a8d91;
}

.main-button .arrow {
    margin-left: auto;
    color: #606770;
}

.selected-text { 
    display: none; 
}

.has-selection .main-button {
    background-color: #e7f3ff;
    border-color: #1877f2;
}

.has-selection .default-text { 
    display: none; 
}

.has-selection .selected-text { 
    display: inline-flex; 
    align-items: center; 
    flex-grow: 1;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    width: 100%;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 5px;
    margin-top: 5px;
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
}

.show {
    display: block;
}

ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

li {
    padding: 5px 0;
    display: flex;
    align-items: center;
}

ul.countries {
    padding-left: 25px;
}

label {
    cursor: pointer;
    margin-left: 8px;
}

input[type="checkbox"] {
    cursor: pointer;
    transform: scale(1.1);
}

.continent-label {
    font-weight: bold;
}

.country-label {
    font-weight: normal;
}

.mountain-count {
    font-size: 11px;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 8px;
}

/* Clear All button inside dropdown */
.clear-all-item {
    padding: 4px 0;
    border-bottom: 1px solid #e5e7eb;
}

.clear-all-button {
    width: 100%;
    background: none;
    border: none;
    padding: 6px 12px;
    text-align: left;
    cursor: pointer;
    font-size: 12px;
    color: #6b7280;
    transition: background-color 0.2s;
}

.clear-all-button:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.separator {
    padding: 0;
    margin: 0;
}

.separator hr {
    margin: 0;
    border: none;
    border-top: 1px solid #e5e7eb;
}

/* Country List */
.country-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    background: white;
    margin-bottom: 16px;
}

.country-item {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
}

.country-item:last-child {
    border-bottom: none;
}

.country-item input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
}

.country-item label {
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.country-item label:hover {
    color: #1f2937;
}

.country-item .mountain-count {
    font-size: 12px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

/* Filter Section Styling */
.filter-section {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-section h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-section h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: #3b82f6;
    border-radius: 2px;
}

/* Country Filter Specific Styles */
.country-filter-section {
    position: relative;
}

.country-filter-section .filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.country-filter-section .selected-count {
    font-size: 12px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
}

.country-filter-section .clear-countries {
    font-size: 12px;
    color: #ef4444;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.country-filter-section .clear-countries:hover {
    background: #fef2f2;
}

/* Mountain Range Filter */
.mountain-range-filter {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #374151;
}

.mountain-range-filter:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .continent-tabs {
        flex-direction: column;
        gap: 4px;
    }
    
    .continent-tab {
        text-align: center;
        padding: 10px 16px;
    }
    
    .country-list {
        max-height: 200px;
    }
    
    .filter-section {
        padding: 16px;
        margin-bottom: 16px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .continent-tab {
        background: #374151;
        border-color: #4b5563;
        color: #d1d5db;
    }
    
    .continent-tab:hover {
        background: #4b5563;
        color: #f3f4f6;
    }
    
    .continent-tab.active {
        background: #3b82f6;
        color: white;
    }
    
    .country-list {
        background: #1f2937;
        border-color: #374151;
    }
    
    .country-item {
        border-bottom-color: #374151;
    }
    
    .country-item label {
        color: #d1d5db;
    }
    
    .country-item label:hover {
        color: #f3f4f6;
    }
    
    .country-item .mountain-count {
        background: #374151;
        color: #9ca3af;
    }
    
    .filter-section {
        background: #1f2937;
        border-color: #374151;
    }
    
    .filter-section h3 {
        color: #f3f4f6;
    }
    
    .mountain-range-filter {
        background: #374151;
        border-color: #4b5563;
        color: #d1d5db;
    }
    
    .mountain-range-filter:focus {
        border-color: #3b82f6;
    }
}

/* No data state */
.no-data {
    padding: 20px;
    text-align: center;
    color: #6b7280;
    font-style: italic;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
}

/* Animation for smooth transitions */
.continent-tab,
.country-item,
.filter-section {
    transition: all 0.2s ease;
}

/* Loading state */
.filter-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #6b7280;
    font-size: 14px;
}

.filter-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

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