/**
 * Kitchen Prep Lists - Custom Dropdown Allergy Filter CSS
 * Modern dropdown with chips design
 */

/* Main container */
.mkpl-allergy-filter-container {
    margin: 20px 0;
    font-family: 'Poppins', sans-serif;
    clear: both;
    position: relative;
    //min-width: 420px;
}

.mkpl-custom-dropdown-wrapper {
    min-width: 420px;
}

/* Mobile - smaller minimum width */
@media (max-width: 768px) {
    .mkpl-custom-dropdown-wrapper {
        min-width: 330px;
    }
}

/* Filter Controls */
.mkpl-allergy-filter-container .mkpl-filter-controls {
    background: #ffffff;
    padding: 20px;
    margin-bottom: 30px;
}

.mkpl-allergy-filter-container .mkpl-filter-controls h4 {
    margin: 0 0 15px 0 !important;
    color: #613C21;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
}

/* Custom Dropdown Wrapper */
.mkpl-custom-dropdown-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
}

/* Dropdown Trigger */
.mkpl-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 8px 16px;
    background: #ffffff;
    border: 1px solid #613c21;
    border-radius: 0px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.mkpl-dropdown-trigger:hover {
    border-color: #613c21;
    box-shadow: 0 2px 8px #e6d5c7;
}

.mkpl-dropdown-trigger:focus,
.mkpl-dropdown-trigger.active {
    outline: none;
    border-color: #613c21;
    box-shadow: 0 0 0 3px f4f7ed;
}

/* Dropdown Content Area */
.mkpl-dropdown-content {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    min-height: 24px;
}

/* Placeholder Text */
.mkpl-placeholder {
    color: #613c21;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

.mkpl-dropdown-trigger.has-selections .mkpl-placeholder {
    display: none;
}

/* Selected Chips */
.mkpl-selected-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.mkpl-chip {
    display: inline-flex;
    align-items: center;
    background: #e8f0d6;
    color: #4a5a1d;
    padding: 4px 12px;
    border-radius: 16px;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid #b5c878;
    animation: chipAppear 0.2s ease-out;
}

@keyframes chipAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Dropdown Arrow */
.mkpl-dropdown-arrow {
    color: #613c21;
    font-size: 12px;
    transition: transform 0.2s ease;
    margin-left: 8px;
    flex-shrink: 0;
}

.mkpl-dropdown-trigger.active .mkpl-dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Panel */
.mkpl-dropdown-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #613c21;
    border-top: none;
    border-radius: 0 0 0px 0px;
    box-shadow: 0 4px 12px #e6d5c7;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    max-height: 300px;
    overflow-y: auto;
}

.mkpl-dropdown-trigger.active + .mkpl-dropdown-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Options */
.mkpl-dropdown-options {
    padding: 16px;
    max-height: 200px;
    overflow-y: auto;
}

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

.mkpl-option-item:hover {
    background: #f8f9fa;
}

.mkpl-option-item input[type="checkbox"] {
    margin: 0 12px 0 0;
    transform: scale(1.1);
    accent-color: #613c21;
}

.mkpl-option-label {
    font-size: 14px;
    color: #613c21;
    line-height: 1.4;
    user-select: none;
}

.mkpl-option-item input[type="checkbox"]:checked + .mkpl-option-label {
    font-weight: 500;
    color: #613c21;
}

/* Dropdown Actions */
.mkpl-dropdown-actions {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid #e1e5e9;
    background: #f8f9fa;
}

.mkpl-apply-filters,
.mkpl-clear-filters {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mkpl-apply-filters {
    background: #007cba;
    color: white;
}

.mkpl-apply-filters:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.mkpl-apply-filters:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.mkpl-clear-filters {
    background: #6c757d;
    color: white;
}

.mkpl-clear-filters:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Filter Results - counter removed
.mkpl-filter-results {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e1e5e9;
}

.mkpl-results-count {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}*/

/* Loading and Error States */
.mkpl-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #6c757d;
    font-size: 1.1em;
}

.mkpl-no-results-inline {
    text-align: center;
    padding: 20px;
    color: #666;
    background: #f9f9f9;
    border-radius: 4px;
    margin: 20px 0;
    border: 1px solid #ddd;
}

.mkpl-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mkpl-custom-dropdown-wrapper {
        max-width: 100%;
    }
    
    .mkpl-dropdown-trigger {
        min-height: 44px;
        padding: 8px 12px;
    }
    
    .mkpl-dropdown-options {
        padding: 12px;
        max-height: 180px;
    }
    
    .mkpl-dropdown-actions {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }
    
    .mkpl-chip {
        font-size: 11px;
        padding: 3px 6px;
    }
}

@media (max-width: 480px) {
    .mkpl-allergy-filter-container .mkpl-filter-controls {
        padding: 15px;
    }
    
    .mkpl-dropdown-trigger {
        min-height: 40px;
        font-size: 14px;
    }
    
    .mkpl-dropdown-panel {
        max-height: 250px;
    }
    
    .mkpl-dropdown-options {
        max-height: 150px;
    }
}

/* Accessibility Improvements */
.mkpl-dropdown-trigger:focus-visible {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.mkpl-option-item:focus-within {
    background: #e8f0d6;
    outline: 1px solid #b5c878;
}

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

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

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

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