/* ============================================
   🎨 小雨論壇 - 個人中心樣式
   Profile Page Styles
   ============================================ */

/* ===========================
   個人資料橫幅
   =========================== */

.profile-banner {
    position: relative;
    width: 100%;
    min-height: 300px;
    margin-bottom: 2rem;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.banner-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #0066ff 0%, #9333ea 100%);
    z-index: 1;
}

.banner-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to bottom, transparent 0%, var(--bg-primary) 100%);
}

.profile-header-content {
    position: relative;
    z-index: 2;
    padding: 3rem 2rem 2rem;
    display: flex;
    align-items: flex-end;
    gap: 2rem;
}

/* 頭像 */
.profile-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 24px;
    border: 5px solid var(--bg-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    background: var(--bg-secondary);
}

.avatar-edit-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-blue);
    color: white;
    border: 3px solid var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.avatar-edit-btn:hover {
    background: #0052cc;
    transform: scale(1.1);
}

/* 個人資訊 */
.profile-info {
    flex: 1;
    color: var(--text-primary);
}

.profile-name {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.profile-id {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
}

.profile-level {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.profile-bio {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 1rem 0 0 0;
    max-width: 600px;
}

/* 操作按鈕 */
.profile-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.profile-actions .btn-primary,
.profile-actions .btn-secondary {
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.profile-actions .btn-primary {
    background: linear-gradient(135deg, #0066ff 0%, #9333ea 100%);
    color: white;
    border: none;
}

.profile-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 102, 255, 0.3);
}

.profile-actions .btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.profile-actions .btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-blue);
}

/* ===========================
   統計卡片
   =========================== */

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-blue);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0066ff 0%, #9333ea 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ===========================
   標籤頁
   =========================== */

.profile-content {
    background: var(--bg-secondary);
    border-radius: 24px;
    padding: 2rem;
    border: 2px solid var(--border-color);
}

.tabs-header {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.tab-btn.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

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

/* ===========================
   資產管理
   =========================== */

.assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.asset-card {
    background: var(--bg-tertiary);
    border-radius: 16px;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.asset-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-blue);
}

.asset-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.asset-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0066ff 0%, #9333ea 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.asset-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.asset-type {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.asset-balance {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.balance-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.balance-currency {
    font-size: 1rem;
    color: var(--text-secondary);
}

.asset-value {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.asset-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-small {
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    flex: 1;
    justify-content: center;
}

.btn-small.btn-primary {
    background: linear-gradient(135deg, #0066ff 0%, #9333ea 100%);
    color: white;
    border: none;
}

.btn-small.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.btn-small.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-small.btn-secondary:hover {
    background: var(--bg-primary);
    border-color: var(--primary-blue);
}

/* 最近交易 */
.recent-transactions {
    margin-top: 2rem;
}

.recent-transactions h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.transaction-item:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-blue);
}

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.transaction-icon.send {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.transaction-icon.receive {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.transaction-info {
    flex: 1;
}

.transaction-type {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.transaction-time {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.transaction-amount {
    font-weight: 700;
    font-size: 1.125rem;
}

.transaction-amount.positive {
    color: #10b981;
}

.transaction-amount.negative {
    color: #ef4444;
}

/* ===========================
   成就徽章
   =========================== */

.achievements-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.achievements-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.achievement-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.view-all-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
}

.view-all-link:hover {
    text-decoration: underline;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.achievement-item {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.achievement-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-blue);
}

.achievement-item.locked {
    opacity: 0.5;
    filter: grayscale(100%);
}

.achievement-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.achievement-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0.5rem 0 0.25rem 0;
}

.achievement-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ===========================
   活動記錄
   =========================== */

.activities-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0066ff 0%, #9333ea 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.activity-time {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ===========================
   NFT 展示
   =========================== */

.nfts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.nft-card {
    background: var(--bg-tertiary);
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.nft-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-blue);
}

.nft-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--bg-secondary);
}

.nft-info {
    padding: 1rem;
}

.nft-name {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.nft-details {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ===========================
   空狀態
   =========================== */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* ===========================
   響應式設計
   =========================== */

@media (max-width: 1024px) {
    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .assets-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .profile-header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 2rem 1.5rem 1.5rem;
    }
    
    .profile-avatar {
        width: 120px;
        height: 120px;
    }
    
    .profile-info {
        width: 100%;
    }
    
    .profile-name {
        font-size: 1.5rem;
    }
    
    .profile-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .profile-actions .btn-primary,
    .profile-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .profile-stats {
        grid-template-columns: 1fr;
    }
    
    .profile-content {
        padding: 1.5rem;
    }
    
    .tabs-header {
        gap: 0;
    }
    
    .tab-btn {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
    
    .tab-btn span {
        display: none;
    }
    
    .tab-btn i {
        font-size: 1.25rem;
    }
    
    .achievements-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .nfts-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .banner-background {
        height: 150px;
    }
    
    .profile-avatar {
        width: 100px;
        height: 100px;
    }
    
    .avatar-edit-btn {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }
    
    .profile-name {
        font-size: 1.25rem;
    }
    
    .stat-card {
        padding: 1rem;
        gap: 1rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .asset-card {
        padding: 1rem;
    }
    
    .asset-actions {
        flex-direction: column;
    }
    
    .btn-small {
        width: 100%;
    }
}

/* ===========================
   深色模式
   =========================== */

.dark-mode .profile-banner {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.dark-mode .stat-card,
.dark-mode .asset-card,
.dark-mode .transaction-item,
.dark-mode .achievement-item,
.dark-mode .activity-item,
.dark-mode .nft-card {
    background: rgba(255, 255, 255, 0.05);
}

.dark-mode .profile-avatar,
.dark-mode .avatar-edit-btn {
    border-color: var(--bg-primary);
}
