/**
 * ===================================
 * PROFILE DROPDOWN - SMOOTH FADE FIX
 * REPLACE the profile dropdown section in nav-dropdown.css
 * Changes: Smooth fade instead of translateY jump
 * ===================================
 */

/* Profile Dropdown Container */
.nav-profile-dropdown {
    position: relative;
}

/* Profile Button (hoverable area) */
.nav-profile-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
    background: transparent;
    border: none;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: var(--text);
}

.nav-profile-btn:hover {
    background: #f5f5f5;
}

.nav-profile-btn .nav-profile-photo {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.nav-profile-btn .profile-name {
    font-weight: 500;
}

.nav-profile-btn .dropdown-arrow {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

/* Arrow rotates on hover */
.nav-profile-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu - SMOOTH FADE (NO JUMP) */
.profile-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    /* REMOVED: transform: translateY(-10px); */
    /* CHANGED: Only fade, no movement */
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
    overflow: hidden;
    margin-top: -7px;
}

/* Show dropdown on hover - SMOOTH FADE */
.nav-profile-dropdown:hover .profile-dropdown-menu {
    opacity: 1;
    visibility: visible;
    /* REMOVED: transform: translateY(0); */
}

/* Keep dropdown visible when hovering over it */
.profile-dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
}

/* Dropdown Items */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.2rem;
    color: var(--text);
    text-decoration: none;
    transition: 0.3s;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background: #f8f9fa;
}

.dropdown-item .material-icons-sharp {
    font-size: 1.3rem;
    color: var(--primary);
}

.dropdown-item span:not(.material-icons-sharp) {
    font-weight: 500;
}

/* Logout Item (special styling) */
.dropdown-item.logout {
    border-top: 1px solid #f0f0f0;
    color: #f44336;
}

.dropdown-item.logout:hover {
    background: rgba(244, 67, 54, 0.05);
}

.dropdown-item.logout .material-icons-sharp {
    color: #f44336;
}

/* Active state for current page */
.dropdown-item.active {
    background: rgba(102, 126, 234, 0.08);
    color: var(--primary);
    font-weight: 600;
}

/* Dark theme profile dropdown */
.dark-theme .nav-profile-btn {
    color: #e8e8f0;
}

.dark-theme .nav-profile-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dark-theme .profile-dropdown-menu {
    background: #1e1e30;
    border: 1px solid #2d2d44;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.dark-theme .dropdown-item {
    color: #e8e8f0;
}

.dark-theme .dropdown-item:hover {
    background: #252538;
}

.dark-theme .dropdown-item.logout {
    border-top: 1px solid #2d2d44;
}

/* Floating Help Button */
.floating-help-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    z-index: 999;
    transition: all 0.3s ease;
}

.floating-help-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.5);
}

.floating-help-btn .material-icons-sharp {
    font-size: 1.8rem;
}

/* Pulse animation for help button */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
    }
}

.floating-help-btn {
    animation: pulse 2s infinite;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* On mobile, keep click behavior for better UX */
    .nav-profile-dropdown:hover .profile-dropdown-menu {
        /* Don't auto-show on mobile */
        opacity: 0;
        visibility: hidden;
    }
    
    /* Use .show class for mobile (controlled by JS) */
    .profile-dropdown-menu.show {
        opacity: 1 !important;
        visibility: visible !important;
        position: fixed;
        top: 60px;
        right: 10px;
        left: auto;
        width: 250px;
    }
    
    .floating-help-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .floating-help-btn .material-icons-sharp {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .nav-profile-btn .profile-name {
        display: none;
    }
    
    .profile-dropdown-menu.show {
        right: 5px;
        width: calc(100vw - 20px);
        max-width: 280px;
    }
}

/* ── Fix nav profile photo fit ── */
.nav-profile-photo {
    overflow: hidden;
}

.nav-profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}