/* ========================================
   GLASSMORPHISM ENHANCEMENT
   Better opacity and blur for panels
   NO blocking overlay - just better panel styling
   ======================================== */

/* Enhanced Glassmorphism for Profile Dropdown */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-width: 90vw;
    max-height: 75vh;
    overflow-y: auto;
    overflow-x: hidden;
    
    /* LIGHT MODE: More opaque background with strong blur */
    background: rgba(255, 255, 255, 0.92);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.3) inset,
        0 24px 48px rgba(0, 0, 0, 0.2),
        0 8px 16px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
    
    z-index: 9999;
    animation: dropdownSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow-anchor: auto;
}

/* Dark mode glassmorphism - MORE OPAQUE */
.dark-mode .profile-dropdown {
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.12) inset,
        0 32px 64px rgba(0, 0, 0, 0.95),
        0 12px 24px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(50px) saturate(180%);
    -webkit-backdrop-filter: blur(50px) saturate(180%);
}

/* Enhanced Glassmorphism for Top Bar Dropdown (New chat, New task, etc.) */
.top-bar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    display: flex;
    flex-direction: column;
    min-width: 160px;
    padding: 0.5rem 0;
    border-radius: 12px;
    
    /* LIGHT MODE: More opaque background */
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.3) inset,
        0 16px 32px rgba(0, 0, 0, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
    
    z-index: 9999;
    animation: dropdownSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark mode for top bar dropdown - MORE OPAQUE */
.dark-mode .top-bar-dropdown {
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.12) inset,
        0 24px 48px rgba(0, 0, 0, 0.95),
        0 8px 16px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(50px) saturate(180%);
    -webkit-backdrop-filter: blur(50px) saturate(180%);
}

/* Animation for dropdown appearance */
@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.profile-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.profile-dropdown::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.dark-mode .profile-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

.profile-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.dark-mode .profile-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Enhanced content visibility within glass panels */
.profile-dropdown .profile-settings-panel,
.top-bar-dropdown .dropdown-item {
    position: relative;
    z-index: 1;
}

/* Ensure text is crisp and readable on glass background */
.profile-dropdown,
.top-bar-dropdown {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Subtle inner glow for glass effect */
.profile-dropdown::before,
.top-bar-dropdown::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.15) 0%,
        transparent 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    pointer-events: none;
    opacity: 0.6;
}

.dark-mode .profile-dropdown::before,
.dark-mode .top-bar-dropdown::before {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.08) 0%,
        transparent 50%,
        rgba(255, 255, 255, 0.03) 100%
    );
}

/* Performance optimization for mobile */
@media (max-width: 768px) {
    .profile-dropdown,
    .top-bar-dropdown {
        /* Slightly reduce blur on mobile for performance */
        backdrop-filter: blur(35px) saturate(140%);
        -webkit-backdrop-filter: blur(35px) saturate(140%);
    }
}

/* Accessibility: Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .backdrop-blur-overlay {
        transition: opacity 0.1s linear, visibility 0.1s linear;
    }
    
    .profile-dropdown,
    .top-bar-dropdown {
        animation: none;
    }
    
    @keyframes dropdownSlideIn {
        from, to {
            opacity: 1;
            transform: none;
        }
    }
}
