/* 按鈕容器 */
.freelix-profile-button-wrapper {
    position: relative;
    display: inline-block;
}

/* 基本按鈕樣式 */
.freelix-profile-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* 登入/註冊按鈕 */
.freelix-profile-button.login-register .login-button {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 6px;
    background-color: #0066cc;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.freelix-profile-button.login-register .login-button:hover {
    background-color: #0052a3;
}

/* 已登入狀態的按鈕 */
.freelix-profile-button.logged-in {
    position: relative;
    display: flex;
    align-items: center;
}

.profile-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
}

.profile-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-image img.loaded {
    opacity: 1;
}

/* Skeleton 加載效果 */
.profile-image-skeleton {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 下拉選單 */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.freelix-profile-button.logged-in.active .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 下拉選單頭部 */
.dropdown-header {
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.user-role {
    font-size: 12px;
    color: #666;
}

/* 下拉選單內容 */
.dropdown-content {
    padding: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    color: var(--neutral-800);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--neutral-100);
}

.dropdown-item i {
    margin-right: 10px;
    font-size: 16px;
    color: var(--neutral-600);
}

/* 聊天圖標樣式 */
.chat-icon-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 10px;
    color: var(--neutral-700);
    text-decoration: none;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.chat-icon-link:hover {
    background-color: var(--neutral-100);
    color: var(--primary-color);
}

.chat-icon-link i {
    font-size: 20px;
}

/* 未讀消息紅點 */
.unread-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background-color: var(--error-color, #f44336);
    border-radius: 50%;
    border: 2px solid #fff;
}

/* 下拉菜單中的未讀消息徽章 */
.dropdown-item .unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 8px;
    background-color: var(--error-color, #f44336);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .profile-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 12px 12px 0 0;
        transform: translateY(100%);
    }

    .freelix-profile-button.logged-in.active .profile-dropdown {
        transform: translateY(0);
    }

    .chat-icon-link {
        width: 36px;
        height: 36px;
        margin-right: 8px;
    }
    
    .chat-icon-link i {
        font-size: 18px;
    }
    
    .unread-dot {
        top: 6px;
        right: 6px;
        width: 7px;
        height: 7px;
    }
} 