/* 新用戶註冊表單容器 */
#new-user-form-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    margin: 60px auto 0;
    padding: 20px;
    box-sizing: border-box;
    animation: form-fade-in 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes form-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 表單內的群組 */
.form-group {
    width: 100%;
    margin-bottom: 25px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    padding-left: 5px;
}

/* 用戶名稱輸入框 */
#newUserNameInput {
    width: 100%;
    height: 48px;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 16px;
    outline: none;
    text-align: center;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

#newUserNameInput::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#newUserNameInput:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 性別選擇器 */
.gender-selector {
    display: flex;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    overflow: hidden;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.gender-option {
    flex: 1;
    padding: 12px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    position: relative;
}

.gender-option.active {
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-weight: 600;
}

/* 暫時隱藏「不設定」性別的選項 */
.gender-option[data-gender="N/A"] {
    display: none;
}

/* 創建和返回按鈕 */
.form-actions {
    display: flex;
    width: 100%;
    gap: 15px;
    margin-top: 10px;
}

.form-button {
    flex: 1;
    height: 48px;
    border: none;
    border-radius: 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#createUserBtn {
    background-color: #4caf50; /* 綠色 */
    color: white;
}

#createUserBtn:hover {
    background-color: #45a049;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

#backToAvatarsBtn {
    background-color: #8e8e93; /* 中性灰色 */
    color: white;
}

#backToAvatarsBtn:hover {
    background-color: #787880;
}

/* 首次登入提示框 (Tooltip) 樣式 */
.first-login-tooltip {
    position: absolute;
    z-index: 100;
    padding: 12px 16px;
    background: #ffffff;
    color: #1c1c1e;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.5;
    max-width: 220px;
    text-align: center;
    /* 預設隱藏，由 JS 控制顯示 */
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none; /* 讓下方的元素可以被點擊 */
}

.first-login-tooltip.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Tooltip 的小箭頭 */
.first-login-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%; /* 指向下方 */
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: #ffffff transparent transparent transparent;
}

/* 新用戶頭像的「心跳」高亮效果 */
@keyframes heartbeat-effect {
    0% {
        transform: scale(1);
    }
    10% {
        transform: scale(1.15); /* 第一次，快速、強烈地跳動 */
    }
    20% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.1); /* 第二次，較緩和地跳動 */
    }
    50% {
        transform: scale(1);
    }
    100% {
        transform: scale(1); /* 較長的停頓時間，模擬心跳間隔 */
    }
}

.new-user-highlight .avatar {
    /* 將動畫時長從 2s 縮短為 1.3s，頻率加快約 50% */
    animation: heartbeat-effect 1.3s infinite ease-in-out;
}