/* User Panel Styles */

.user-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    /* Click-through or transparent to detect outside clicks */
    z-index: 900;
    /* Below modal overlay (1000) but above everything else */
    display: none;
}

.user-panel-overlay.active {
    display: block;
}

.user-panel {
    position: fixed;
    top: 70px;
    /* Below header */
    right: 24px;
    width: 320px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 901;
    overflow: hidden;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.user-panel.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Header Section (User Info) */
.user-panel-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
    padding: 24px;
    text-align: center;
    border-bottom: 1px solid var(--border-subtle);
}

.user-avatar-large {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--score-gold), #d97706);
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    color: var(--text-inverse);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}

.user-name-display {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.user-org-display {
    font-size: 13px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
}

/* XP Bar in Panel */
.panel-xp-container {
    margin-top: 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-xp-val {
    color: var(--score-gold);
    font-weight: 700;
}

/* Menu List */
.user-panel-menu {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.panel-item {
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-main);
    font-size: 14px;
}

.panel-item:hover {
    background: rgba(255, 255, 255, 0.05);
    /* or create a variable for hover states */
    color: var(--text-main);
}

.panel-item i {
    width: 20px;
    text-align: center;
    color: var(--text-muted);
    transition: color 0.2s;
}

.panel-item:hover i {
    color: var(--score-gold);
}

.panel-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.panel-item.danger:hover i {
    color: var(--danger);
}

/* Settings Section */
.panel-section-title {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    padding: 16px 16px 8px;
    font-weight: 600;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    gap: 16px;
}

.settings-label {
    font-size: 13px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-muted);
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--score-gold);
}

input:checked+.slider:before {
    transform: translateX(16px);
    background-color: var(--text-inverse);
}

/* Language Select */
.lang-select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.lang-select:focus {
    border-color: var(--score-gold);
}