/**
 * 深色深紫色系列個人網站樣式
 * Bootstrap 5.3.8 深色主題
 */

/* ============================================
   CSS 變數定義 - 深紫色系列
   ============================================ */
:root {
    /* 深紫色主題色 */
    --primary-purple: #7C3AED;
    --dark-purple: #5B21B6;
    --darker-purple: #4C1D95;
    --light-purple: #A78BFA;
    --accent-purple: #C084FC;
    
    /* 背景色 */
    --bg-primary: #0F0A1E;
    --bg-secondary: #1A1332;
    --bg-tertiary: #251B47;
    --bg-card: rgba(26, 19, 50, 0.8);
    
    /* 文字色 */
    --text-primary: #F3F4F6;
    --text-secondary: #D1D5DB;
    --text-muted: #9CA3AF;
    
    /* 邊框與陰影 */
    --border-color: rgba(124, 58, 237, 0.3);
    --shadow-sm: 0 2px 8px rgba(124, 58, 237, 0.15);
    --shadow-md: 0 4px 16px rgba(124, 58, 237, 0.2);
    --shadow-lg: 0 8px 32px rgba(124, 58, 237, 0.3);
    --shadow-xl: 0 16px 48px rgba(124, 58, 237, 0.4);
    
    /* 動畫速度 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* 圓角 */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;
}

/* ============================================
   全局樣式重置
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Noto Sans TC', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* ============================================
   背景漸層效果
   ============================================ */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(135deg, 
        var(--bg-primary) 0%, 
        var(--darker-purple) 30%, 
        var(--dark-purple) 60%, 
        var(--bg-primary) 100%
    );
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ============================================
   粒子背景
   ============================================ */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
}

/* ============================================
   主容器
   ============================================ */
.main-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

/* ============================================
   個人資料卡片
   ============================================ */
.profile-card {
    max-width: 800px;
    width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(180deg, 
        rgba(124, 58, 237, 0.1) 0%, 
        transparent 100%
    );
    z-index: 0;
}

.profile-card > * {
    position: relative;
    z-index: 1;
}

/* ============================================
   頭像區域
   ============================================ */
.avatar-section {
    text-align: center;
    margin-bottom: 2rem;
}

.avatar-wrapper {
    position: relative;
    display: inline-block;
    width: 160px;
    height: 160px;
}

.avatar-image {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 4px solid var(--primary-purple);
    box-shadow: var(--shadow-lg);
    transition: var(--transition-normal);
}

.avatar-image:hover {
    transform: scale(1.05);
    border-color: var(--accent-purple);
}

.avatar-ring {
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: var(--radius-full);
    border: 2px solid var(--accent-purple);
    opacity: 0.5;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* ============================================
   個人資訊區域
   ============================================ */
.profile-info {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-name {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--light-purple), var(--primary-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.profile-name-en {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.profile-tagline {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: rgba(124, 58, 237, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--accent-purple);
    font-size: 0.9rem;
    font-weight: 600;
}

.profile-badge i {
    font-size: 1rem;
}

/* ============================================
   簡介區域
   ============================================ */
.bio-section {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2.5rem;
}

.bio-text {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   區塊標題
   ============================================ */
.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.section-title i {
    color: var(--primary-purple);
}

/* ============================================
   服務項目區域
   ============================================ */
.services-section {
    margin-bottom: 2.5rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.service-item {
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.75rem 1.25rem;
    text-align: center;
    transition: var(--transition-normal);
    cursor: default;
}

.service-item:hover {
    background: rgba(124, 58, 237, 0.2);
    border-color: var(--primary-purple);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.service-icon {
    font-size: 2.5rem;
    color: var(--accent-purple);
    margin-bottom: 1rem;
    transition: var(--transition-normal);
}

.service-item:hover .service-icon {
    transform: scale(1.1);
    color: var(--light-purple);
}

.service-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.service-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* ============================================
   社交連結區域
   ============================================ */
.social-section {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1.5rem;
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: var(--transition-slow);
}

.social-link:hover::before {
    left: 100%;
}

.social-link i {
    font-size: 1.25rem;
    transition: var(--transition-fast);
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
}

/* Discord */
.social-link.discord:hover {
    background: linear-gradient(135deg, #5865F2, #7289DA);
    border-color: #5865F2;
}

/* GitHub */
.social-link.github:hover {
    background: linear-gradient(135deg, #333, #24292e);
    border-color: #333;
}

/* Twitter */
.social-link.twitter:hover {
    background: linear-gradient(135deg, #1DA1F2, #0A66C2);
    border-color: #1DA1F2;
}

/* Instagram */
.social-link.instagram:hover {
    background: linear-gradient(135deg, #E1306C, #C13584, #833AB4);
    border-color: #E1306C;
}

/* Email */
.social-link.email:hover {
    background: linear-gradient(135deg, var(--primary-purple), var(--accent-purple));
    border-color: var(--primary-purple);
}

/* Facebook */
.social-link.facebook:hover {
    background: linear-gradient(135deg, #1877F2, #0A66C2);
    border-color: #1877F2;
}

/* Threads */
.social-link.threads:hover {
    background: linear-gradient(135deg, #000000, #1A1A1A);
    border-color: #000000;
}

/* Telegram */
.social-link.telegram:hover {
    background: linear-gradient(135deg, #0088CC, #2AABEE);
    border-color: #0088CC;
}

/* ============================================
   友站連結
   ============================================ */
.friend-sites-section {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border-color);
}

.friend-sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.friend-site-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.75rem 1.25rem;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition-normal);
    cursor: pointer;
}

.friend-site-item:hover {
    background: rgba(124, 58, 237, 0.2);
    border-color: var(--primary-purple);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.friend-site-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-purple), var(--accent-purple));
    border-radius: 50%;
    font-size: 1.75rem;
    color: white;
    margin-bottom: 1rem;
    transition: var(--transition-normal);
    overflow: hidden;
}

.friend-site-item:hover .friend-site-icon {
    transform: scale(1.1) rotate(5deg);
}

.friend-site-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    background: rgba(255, 255, 255, 0.1);
}

.friend-site-info {
    width: 100%;
}

.friend-site-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    transition: var(--transition-fast);
}

.friend-site-item:hover .friend-site-name {
    color: var(--accent-purple);
}

.friend-site-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.friend-site-arrow {
    display: none;
}

/* ============================================
   頁腳
   ============================================ */
.profile-footer {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.powered-by {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0;
}

.powered-by a {
    color: var(--accent-purple);
    text-decoration: none;
    transition: var(--transition-fast);
}

.powered-by a:hover {
    color: var(--light-purple);
    text-decoration: underline;
}

/* ============================================
   響應式設計
   ============================================ */

/* 平板 */
@media (max-width: 768px) {
    .profile-card {
        padding: 2.5rem 2rem;
    }
    
    .profile-name {
        font-size: 2rem;
    }
    
    .profile-name-en {
        font-size: 1.125rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .friend-site-item {
        padding: 1rem;
    }
    
    .friend-site-icon {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
}

/* 手機 */
@media (max-width: 576px) {
    .main-container {
        padding: 1rem 0.75rem;
    }
    
    .profile-card {
        padding: 2rem 1.5rem;
        border-radius: var(--radius-lg);
    }
    
    .avatar-wrapper {
        width: 120px;
        height: 120px;
    }
    
    .profile-name {
        font-size: 1.75rem;
    }
    
    .profile-name-en {
        font-size: 1rem;
    }
    
    .profile-tagline {
        font-size: 1rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .service-item {
        padding: 1.5rem 1rem;
    }
    
    .friend-sites-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .friend-site-item {
        padding: 1.5rem 1rem;
    }
    
    .social-links {
        flex-direction: column;
        align-items: stretch;
    }
    
    .social-link {
        justify-content: center;
        width: 100%;
    }
    
    .friend-site-item {
        padding: 1rem 0.875rem;
    }
    
    .friend-site-icon {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }
    
    .friend-site-name {
        font-size: 0.9rem;
    }
    
    .friend-site-desc {
        font-size: 0.8rem;
    }
    
    .section-title {
        font-size: 1.125rem;
    }
}

/* ============================================
   動畫效果
   ============================================ */

/* 淡入動畫 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 從下往上滑入 */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 從上往下滑入 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 縮放動畫 */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   載入動畫
   ============================================ */
.profile-card {
    animation: fadeIn 0.8s ease-out;
}

/* ============================================
   無障礙設計
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   列印樣式
   ============================================ */
@media print {
    .background-gradient,
    .particles {
        display: none;
    }
    
    .profile-card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .social-link {
        page-break-inside: avoid;
    }
}

/* ============================================
   選取文字顏色
   ============================================ */
::selection {
    background-color: var(--primary-purple);
    color: var(--text-primary);
}

::-moz-selection {
    background-color: var(--primary-purple);
    color: var(--text-primary);
}

/* ============================================
   滾動條樣式
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-purple);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}
