/* User Dropdown Menu - Custom Styles */

.header-user {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    user-select: none;
}

.header-user:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header-user img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.header-user:hover img {
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

.header-user > span {
    font-weight: 500;
    color: #fff;
    font-size: 14px;
}

/* Dropdown Container */
.header-user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 240px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
}

.header-user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Links */
.header-user-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.header-user-dropdown a:hover {
    background: linear-gradient(90deg, rgba(71, 124, 219, 0.08) 0%, rgba(71, 124, 219, 0.03) 100%);
    border-left-color: #477cdb;
}

.header-user-dropdown a:active {
    transform: scale(0.98);
}

.header-user-dropdown a i.material-icons {
    font-size: 20px;
    color: #666;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.header-user-dropdown a:hover i.material-icons {
    transform: translateX(2px);
}

.header-user-dropdown a span {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* Logout Link Special Style */
.header-user-dropdown a:last-child span {
    color: #f44336;
}

.header-user-dropdown a:last-child:hover {
    background: linear-gradient(90deg, rgba(244, 67, 54, 0.08) 0%, rgba(244, 67, 54, 0.03) 100%);
    border-left-color: #f44336;
}

.header-user-dropdown a:last-child i.material-icons {
    color: #f44336 !important;
}

.header-user-dropdown a:last-child:hover i.material-icons {
    animation: shake 0.5s ease;
}

/* Horizontal Divider */
.header-user-dropdown hr {
    margin: 8px 0;
    border: none;
    border-top: 1px solid #e0e0e0;
}

/* Dropdown Arrow (Optional) */
.header-user-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: #ffffff;
    transform: rotate(45deg);
    box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.05);
}

/* Active Link Indicator */
.header-user-dropdown a.active {
    background: linear-gradient(90deg, rgba(71, 124, 219, 0.12) 0%, rgba(71, 124, 219, 0.05) 100%);
    border-left-color: #477cdb;
}

.header-user-dropdown a.active span {
    color: #477cdb;
}

.header-user-dropdown a.active i.material-icons {
    color: #477cdb;
}

/* Badge for Notifications (Optional) */
.header-user-dropdown a .badge {
    margin-left: auto;
    background: #f44336;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

/* Smooth fade-in for each link */
.header-user-dropdown.show a {
    animation: fadeInUp 0.3s ease forwards;
    opacity: 0;
}

.header-user-dropdown.show a:nth-child(1) { animation-delay: 0.05s; }
.header-user-dropdown.show a:nth-child(2) { animation-delay: 0.1s; }
.header-user-dropdown.show a:nth-child(3) { animation-delay: 0.15s; }
.header-user-dropdown.show a:nth-child(4) { animation-delay: 0.2s; }
.header-user-dropdown.show a:nth-child(5) { animation-delay: 0.25s; }
.header-user-dropdown.show a:nth-child(6) { animation-delay: 0.3s; }
.header-user-dropdown.show a:nth-child(7) { animation-delay: 0.35s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-user-dropdown {
        right: auto;
        left: 0;
        min-width: 220px;
    }
    
    .header-user-dropdown::before {
        right: auto;
        left: 20px;
    }
}

/* Theme Switcher */
.theme-switcher {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.theme-switcher-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.theme-switcher-label i {
    font-size: 18px;
}

.theme-toggle-buttons {
    display: flex;
    gap: 4px;
    background: #fff;
    border-radius: 6px;
    padding: 2px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.theme-btn {
    padding: 4px 8px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.theme-btn:hover {
    background: rgba(71, 124, 219, 0.1);
    color: #477cdb;
}

.theme-btn.active {
    background: #477cdb;
    color: white;
    box-shadow: 0 2px 4px rgba(71, 124, 219, 0.3);
}

/* Dark Mode Support */
body.dark-mode .header-user-dropdown {
    background: #2a2a2a;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode .header-user-dropdown a {
    color: #e0e0e0;
}

body.dark-mode .header-user-dropdown a span {
    color: #e0e0e0;
}

body.dark-mode .header-user-dropdown a:hover {
    background: linear-gradient(90deg, rgba(71, 124, 219, 0.15) 0%, rgba(71, 124, 219, 0.08) 100%);
}

body.dark-mode .header-user-dropdown a i.material-icons {
    color: #aaa;
}

body.dark-mode .header-user-dropdown hr {
    border-top-color: #444;
}

body.dark-mode .theme-switcher {
    background: #1a1a1a;
    border-top-color: #444;
}

body.dark-mode .theme-switcher-label {
    color: #aaa;
}

body.dark-mode .theme-toggle-buttons {
    background: #333;
}

body.dark-mode .theme-btn {
    color: #aaa;
}

@media (prefers-color-scheme: dark) {
    body.auto-mode .header-user-dropdown {
        background: #2a2a2a;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }
    
    body.auto-mode .header-user-dropdown a {
        color: #e0e0e0;
    }
    
    body.auto-mode .header-user-dropdown a span {
        color: #e0e0e0;
    }
    
    body.auto-mode .header-user-dropdown a i.material-icons {
        color: #aaa;
    }
    
    body.auto-mode .header-user-dropdown hr {
        border-top-color: #444;
    }
}
