.s-module-selector {
    background: linear-gradient(135deg, #00233F 0%, #004080 100%);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: visible !important;
}

.s-module-dropdown {
    position: relative;
    overflow: visible !important;
}

.s-module-selector::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    pointer-events: none;
}

.s-module-dropdown {
    position: relative;
    z-index: 2;
}

.s-module-dropdown-toggle {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    color: #333;
}

.s-module-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-0.5px);
}

.s-module-dropdown-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 35, 63, 0.3), 0 2px 8px rgba(0, 0, 0, 0.15);
}

.s-module-icon {
    width: 16px;
    text-align: center;
    color: #00233F;
    font-size: 14px;
    transition: color 0.2s ease;
}

.s-module-name {
    flex: 1;
    text-align: left;
    font-weight: 500;
    color: #333;
    font-size: 13px;
    transition: color 0.2s ease;
}

.s-module-arrow {
    color: #888;
    font-size: 10px;
    transition: transform 0.2s ease, color 0.2s ease;
}

.s-module-dropdown-toggle[aria-expanded="true"] .s-module-arrow {
    transform: rotate(180deg);
}

.s-module-dropdown-menu {
    min-width: 100% !important;
    margin-top: 4px !important;
    border: none !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px);
    padding: 4px !important;
    max-height: 200px;
    overflow-y: auto;
    z-index: 9999 !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    transform: translateY(-8px) !important;
    opacity: 0 !important;
    transition: all 0.2s ease !important;
    pointer-events: none !important;
    display: block !important;
}

.s-module-dropdown-menu.show {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: all !important;
}

.s-module-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    position: relative;
}

.s-module-item:hover {
    background: linear-gradient(135deg, rgba(0, 35, 63, 0.08) 0%, rgba(0, 64, 128, 0.08) 100%);
    transform: translateX(2px);
}

.s-module-item.active {
    background: linear-gradient(135deg, #00233F 0%, #004080 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 35, 63, 0.3);
}

.s-module-item.active .s-module-item-icon,
.s-module-item.active .s-module-item-name {
    color: white;
}

.s-module-item.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.s-module-item.disabled:hover {
    background: none;
    transform: none;
}

.s-module-item-icon {
    width: 16px;
    text-align: center;
    color: #667eea;
    font-size: 13px;
    transition: color 0.2s ease;
}

.s-module-item-name {
    flex: 1;
    font-weight: 500;
    color: #333;
    font-size: 12px;
    transition: color 0.2s ease;
}

.s-module-item-lock {
    color: #ff6b6b;
    font-size: 14px;
    margin-left: auto;
}

.s-module-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #888;
}

.s-module-loading .fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Dark theme support */
[data-bs-theme="dark"] .s-module-dropdown-toggle,
html.theme-cosmos-dark .s-module-dropdown-toggle {
    background: rgba(30, 41, 59, 0.95);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .s-module-dropdown-toggle:hover,
html.theme-cosmos-dark .s-module-dropdown-toggle:hover {
    background: rgba(30, 41, 59, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .s-module-icon,
html.theme-cosmos-dark .s-module-icon {
    color: #60a5fa;
}

[data-bs-theme="dark"] .s-module-name,
html.theme-cosmos-dark .s-module-name {
    color: #f8fafc;
}

[data-bs-theme="dark"] .s-module-arrow,
html.theme-cosmos-dark .s-module-arrow {
    color: #cbd5e1;
}

[data-bs-theme="dark"] .s-module-dropdown-menu,
html.theme-cosmos-dark .s-module-dropdown-menu {
    background: rgba(15, 23, 42, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

[data-bs-theme="dark"] .s-module-item-name,
html.theme-cosmos-dark .s-module-item-name {
    color: #cbd5e1;
}

[data-bs-theme="dark"] .s-module-item-icon,
html.theme-cosmos-dark .s-module-item-icon {
    color: #818cf8;
}

[data-bs-theme="dark"] .s-module-item:hover,
html.theme-cosmos-dark .s-module-item:hover {
    background: rgba(51, 65, 85, 0.5);
}

[data-bs-theme="dark"] .s-module-selector::before,
html.theme-cosmos-dark .s-module-selector::before {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
}

/* Glassy theme support - use same as light theme */
html.theme-glassy-light .s-module-dropdown-toggle {
    background: rgba(255, 255, 255, 0.95);
    border: none;
}

html.theme-glassy-light .s-module-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 1);
}

html.theme-glassy-light .s-module-dropdown-menu {
    background: rgba(255, 255, 255, 0.98) !important;
    border: none !important;
}

html.theme-glassy-light .s-module-selector {
    background: linear-gradient(135deg, #00233F 0%, #004080 100%);
}

html.theme-glassy-light .s-module-selector::before {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
}
