/**
 * SmartDropdown - Default Styles
 * Optional CSS for dropdown styling and animations
 */

/* Base dropdown menu styles */
.smart-dropdown-menu {
    position: fixed;
    display: none;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    max-width: 400px;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 9999;
    padding: 8px 0;
}

/* Open state */
.smart-dropdown-menu.dropdown-open {
    display: block;
}

/* Animation */
.smart-dropdown-menu.dropdown-animate {
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dropdown items */
.smart-dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    color: #333333;
    font-size: 14px;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.smart-dropdown-item:hover {
    background-color: #f5f5f5;
}

.smart-dropdown-item:active {
    background-color: #e8e8e8;
}

.smart-dropdown-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Dropdown divider */
.smart-dropdown-divider {
    height: 1px;
    background-color: #e0e0e0;
    margin: 8px 0;
}

/* Dropdown header */
.smart-dropdown-header {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #666666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Dropdown trigger active state */
.dropdown-trigger.dropdown-active {
    background-color: #e8e8e8;
}

/* Scrollbar styling for dropdown */
.smart-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.smart-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.smart-dropdown-menu::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 3px;
}

.smart-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #999999;
}

/* ==================== THEMES ==================== */

/* Dark theme */
.smart-dropdown-menu.theme-dark {
    background: #2a2a2a;
    border-color: #404040;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.theme-dark .smart-dropdown-item {
    color: #e0e0e0;
}

.theme-dark .smart-dropdown-item:hover {
    background-color: #353535;
}

.theme-dark .smart-dropdown-item:active {
    background-color: #404040;
}

.theme-dark .smart-dropdown-divider {
    background-color: #404040;
}

.theme-dark .smart-dropdown-header {
    color: #999999;
}

/* Primary theme (blue) */
.smart-dropdown-menu.theme-primary {
    border-color: #2196f3;
}

.theme-primary .smart-dropdown-item:hover {
    background-color: #e3f2fd;
    color: #1976d2;
}

/* Success theme (green) */
.smart-dropdown-menu.theme-success {
    border-color: #4caf50;
}

.theme-success .smart-dropdown-item:hover {
    background-color: #e8f5e9;
    color: #388e3c;
}

/* Minimal theme */
.smart-dropdown-menu.theme-minimal {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
}

/* ==================== SIZES ==================== */

/* Small dropdown */
.smart-dropdown-menu.size-sm {
    min-width: 120px;
    padding: 4px 0;
}

.smart-dropdown-menu.size-sm .smart-dropdown-item {
    padding: 6px 12px;
    font-size: 13px;
}

/* Large dropdown */
.smart-dropdown-menu.size-lg {
    min-width: 240px;
    padding: 12px 0;
}

.smart-dropdown-menu.size-lg .smart-dropdown-item {
    padding: 12px 20px;
    font-size: 15px;
}

/* ==================== ICONS ==================== */

/* Icon support */
.smart-dropdown-item-icon {
    display: inline-block;
    width: 20px;
    margin-right: 8px;
    text-align: center;
}

.smart-dropdown-item-with-icon {
    display: flex;
    align-items: center;
}

/* ==================== GROUPS ==================== */

/* Dropdown groups */
.smart-dropdown-group {
    padding: 4px 0;
}

.smart-dropdown-group + .smart-dropdown-group {
    border-top: 1px solid #e0e0e0;
}

/* ==================== LOADING STATE ==================== */

.smart-dropdown-menu.loading {
    pointer-events: none;
    opacity: 0.6;
}

.smart-dropdown-loading {
    padding: 20px;
    text-align: center;
    color: #999999;
}

/* ==================== EMPTY STATE ==================== */

.smart-dropdown-empty {
    padding: 20px;
    text-align: center;
    color: #999999;
    font-size: 14px;
}

/* ==================== SEARCH INPUT ==================== */

.smart-dropdown-search {
    padding: 8px 12px;
    margin: 8px;
    width: calc(100% - 16px);
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.smart-dropdown-search:focus {
    border-color: #2196f3;
}

/* ==================== BADGES ==================== */

.smart-dropdown-item-badge {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    background-color: #e0e0e0;
    color: #666666;
}

.smart-dropdown-item-badge.badge-primary {
    background-color: #2196f3;
    color: #ffffff;
}

.smart-dropdown-item-badge.badge-success {
    background-color: #4caf50;
    color: #ffffff;
}

.smart-dropdown-item-badge.badge-danger {
    background-color: #f44336;
    color: #ffffff;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .smart-dropdown-menu {
        max-width: calc(100vw - 20px);
        max-height: 50vh;
    }
}

/* ==================== ACCESSIBILITY ==================== */

.smart-dropdown-item:focus {
    outline: 2px solid #2196f3;
    outline-offset: -2px;
    background-color: #f5f5f5;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .smart-dropdown-menu {
        border-width: 2px;
    }
    
    .smart-dropdown-item:hover {
        outline: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .smart-dropdown-menu.dropdown-animate {
        animation: none;
    }
    
    .smart-dropdown-item {
        transition: none;
    }
}
