/* --- User Dropdown Menu Styles --- */
.user-menu-container {
    position: relative;
    display: inline-block;
}

.profile-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg-color);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--glass-shadow);
    padding: 0;
}

.profile-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.profile-btn i {
    font-size: 1rem;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 280px;
    background: var(--card-bg-color);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-menu.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.menu-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.user-email {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-word;
}

.menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0;
}

.menu-section {
    padding: 12px;
}

.menu-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px;
}

.menu-label {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.plan-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.plan-badge.premium {
    background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.3);
}

.menu-link {
    display: block;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.menu-link:hover {
    color: var(--accent-color-hover);
    text-decoration: underline;
}

.menu-link.danger-text {
    color: #ff3b30;
}

.menu-link.danger-text:hover {
    color: #ff453a;
}

.menu-hint {
    margin: 4px 0 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.small-text {
    font-size: 0.8rem;
}

.menu-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    width: 100%;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}

.menu-item-row:hover {
    background: rgba(255, 255, 255, 0.08);
}

.menu-item-row i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.menu-item-row.text-red {
    color: #ff3b30;
}

.menu-item-row.text-red:hover {
    background: rgba(255, 59, 48, 0.1);
    color: #ff453a;
}

/* Apple-style Toggle Switch */
.apple-switch {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
}

.apple-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.apple-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(120, 120, 128, 0.16);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 31px;
}

.apple-switch .slider:before {
    position: absolute;
    content: "";
    height: 27px;
    width: 27px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16);
}

.apple-switch input:checked+.slider {
    background-color: #34c759;
}

.apple-switch input:checked+.slider:before {
    transform: translateX(20px);
}

.apple-switch input:focus+.slider {
    box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.2);
}

@media (prefers-color-scheme: dark) {
    .profile-btn {
        background-color: rgba(30, 30, 30, 0.5);
    }

    .profile-btn:hover {
        background-color: rgba(50, 50, 50, 0.6);
    }

    .dropdown-menu {
        background-color: rgba(30, 30, 30, 0.95);
    }

    .apple-switch .slider {
        background-color: rgba(120, 120, 128, 0.32);
    }

    .apple-switch input:checked+.slider {
        background-color: #32d74b;
    }
}

/* Manual dark mode class support - higher specificity */
body.dark-mode .profile-btn {
    background-color: rgba(30, 30, 30, 0.5);
}

body.dark-mode .profile-btn:hover {
    background-color: rgba(50, 50, 50, 0.6);
}

body.dark-mode .dropdown-menu {
    background-color: rgba(30, 30, 30, 0.95);
}

body.dark-mode .apple-switch .slider {
    background-color: rgba(120, 120, 128, 0.32);
}

body.dark-mode .apple-switch input:checked+.slider {
    background-color: #32d74b;
}

/* Manual light mode class support - higher specificity */
body.light-mode .profile-btn {
    background-color: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .profile-btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
    border-color: var(--accent-color);
}

body.light-mode .dropdown-menu {
    background-color: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

body.light-mode .apple-switch .slider {
    background-color: rgba(120, 120, 128, 0.16);
}

body.light-mode .apple-switch input:checked+.slider {
    background-color: #34c759;
}