/* 
 * Professional Layer Switcher Styles
 * Modern Glassmorphism Design
 */

/* Main Container - Professional Styling */
.layer-switcher {
    top: 10px !important;
    right: 10px !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

.layer-switcher .panel {
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
    padding: 8px !important;
    min-width: 240px !important;
    max-width: 320px !important;
}

/* Toggle Button - Modern Icon */
.layer-switcher button {
    width: 40px !important;
    height: 40px !important;
    border-radius: 10px !important;
    background-color: white !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.3s ease !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.layer-switcher button:hover {
    background-color: #f8f8f8 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2) !important;
}

/* Close Button when panel is open */
.layer-switcher.shown.layer-switcher-activation-mode-click>button {
    background-color: white !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    width: 28px !important;
    height: 28px !important;
    font-size: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #666 !important;
    transition: all 0.2s !important;
}

.layer-switcher.shown.layer-switcher-activation-mode-click>button:hover {
    background-color: #f0f0f0 !important;
    color: #333 !important;
}

.layer-switcher.shown.layer-switcher-activation-mode-click>button::before {
    content: "✕" !important;
    font-size: 16px !important;
    font-weight: 300 !important;
}

/* Lists - Modern Spacing */
.layer-switcher ul {
    margin: 8px 0 !important;
    padding-left: 0 !important;
}

.layer-switcher ul ul {
    padding-left: 20px !important;
    margin: 4px 0 !important;
}

.layer-switcher li {
    margin-top: 6px !important;
    transition: all 0.2s ease !important;
}

.layer-switcher li.group {
    margin-top: 12px !important;
    padding: 6px 0 !important;
}

.layer-switcher li.group+li.group {
    margin-top: 16px !important;
    border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
    padding-top: 12px !important;
}

/* Labels - Better Typography */
.layer-switcher li>label {
    padding-left: 28px !important;
    font-size: 13px !important;
    color: #333 !important;
    cursor: pointer !important;
    user-select: none !important;
    transition: color 0.2s !important;
    line-height: 1.4 !important;
}

.layer-switcher li>label:hover {
    color: #3b82f6 !important;
}

.layer-switcher li.group>label {
    font-weight: 600 !important;
    font-size: 13px !important;
    color: #1f2937 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

/* Checkboxes - Modern Style */
.layer-switcher li input[type="checkbox"],
.layer-switcher li input[type="radio"] {
    left: 4px !important;
    width: 16px !important;
    height: 16px !important;
    cursor: pointer !important;
    accent-color: #3b82f6 !important;
}

/* Group Expand/Collapse Button - Moved to the right */
.layer-switcher .group button {
    left: auto !important;
    right: 8px !important;
    width: 20px !important;
    height: 20px !important;
    background-color: transparent !important;
    background-size: 14px !important;
    background-position: center !important;
    border-radius: 4px !important;
    opacity: 0.5 !important;
    transition: opacity 0.2s, background-color 0.2s !important;
    position: absolute !important;
    top: 2px !important;
}

.layer-switcher .group button:hover {
    opacity: 0.8 !important;
    background-color: rgba(59, 130, 246, 0.08) !important;
}

.layer-switcher .group {
    position: relative !important;
}

/* Group labels - adjust padding to make room for button on right */
.layer-switcher li.group>label {
    padding-right: 32px !important;
    display: block !important;
}

/* Scrollbar - Custom Styling */
.layer-switcher .panel::-webkit-scrollbar {
    width: 6px !important;
}

.layer-switcher .panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03) !important;
    border-radius: 10px !important;
}

.layer-switcher .panel::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 10px !important;
    transition: background 0.2s !important;
}

.layer-switcher .panel::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3) !important;
}

/* Disabled layers */
.layer-switcher label.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* Base Group Styling */
li.layer-switcher-base-group {
    background: rgba(59, 130, 246, 0.03) !important;
    border-radius: 8px !important;
    padding: 8px 4px !important;
    margin-top: 12px !important;
}

li.layer-switcher-base-group>label {
    font-weight: 600 !important;
    color: #3b82f6 !important;
}

/* Animation for opening/closing groups - Removed to prevent jumps */
/* Groups now open/close instantly for smoother experience */

/* Panel Shadow on Scroll */
.layer-switcher .panel {
    position: relative !important;
}

.layer-switcher .panel::before {
    content: '' !important;
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 12px !important;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.95), transparent) !important;
    pointer-events: none !important;
    z-index: 10 !important;
}

.layer-switcher .panel::after {
    content: '' !important;
    position: sticky !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 12px !important;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.95), transparent) !important;
    pointer-events: none !important;
    z-index: 10 !important;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .layer-switcher .panel {
        max-width: calc(100vw - 40px) !important;
    }
}

/* Hover effects for better UX - Simplified to avoid jumps */
.layer-switcher li:hover {
    background-color: rgba(59, 130, 246, 0.04) !important;
    border-radius: 6px !important;
}