/* 主要樣式 */
:root {
    --primary-color: #9370DB;  /* 鮮豔的淺紫色 */
    --secondary-color: #6A0DAD;  /* 深紫色 */
    --accent-color: #B19CD9;  /* 淡淺紫色 */
    --bg-blur: rgba(255, 255, 255, 0.15);
    --text-color: #f8f9fa;
    --card-bg: rgba(106, 13, 173, 0.15);
    --card-border: rgba(255, 255, 255, 0.18);
    --gradient-start: #E6E6FA;  /* 淡薰衣草色 */
    --gradient-middle: #D8BFD8; /* 薊色 */
    --gradient-end: #DDA0DD;    /* 李子色 */
}

/* 基本設定 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans TC', Arial, sans-serif;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-middle), var(--gradient-end));
    background-attachment: fixed;
    color: #333; /* 更深色的文本顏色以提高可讀性 */
    line-height: 1.6;
    overflow-x: hidden;
}

/* 毛玻璃效果共用類 */
.glass {
    background: var(--bg-blur);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

/* Dock 風格導航欄樣式 */
.navbar {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0;
    border-radius: 20px;
    position: sticky;
    top: 20px;
    z-index: 1000;
    background: rgba(147, 112, 219, 0.4) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    padding: 0.5rem 1.5rem;
    border-radius: 16px;
    background: rgba(147, 112, 219, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    margin-left: 0.5rem;
    transition: all 0.3s ease;
    color: #333;
}

.navbar-brand:hover {
    background: rgba(147, 112, 219, 0.7);
    transform: scale(1.05);
    color: #333;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 0 2px rgba(147, 112, 219, 0.5);
    transition: transform 0.3s ease;
}

.avatar:hover {
    transform: scale(1.1);
}

.navbar-dark .navbar-nav .nav-link {
    color: #333;
    font-weight: 500;
    padding: 0.7rem 1.2rem;
    border-radius: 14px;
    transition: all 0.3s ease;
    margin: 0 3px;
    display: inline-flex; /* Ensure icon and text are treated as inline elements */
    align-items: center; /* Align icon and text vertically */
}

.navbar-dark .navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.2); /* Add subtle background on hover */
    color: var(--secondary-color); /* Change text color on hover */
    transform: translateY(-2px);
}

.navbar .navbar-toggler {
    border: none;
    padding: 0.5rem;
    margin-right: 1rem;
}

.navbar .navbar-toggler:focus {
    box-shadow: none;
}

/* Discord 按鈕樣式 */
.discord-btn {
    background: linear-gradient(135deg, #9370DB, #6A0DAD);
    border: none;
    border-radius: 25px;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(147, 50, 204, 0.5);
}

.discord-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 20px rgba(147, 50, 204, 0.7);
    background: linear-gradient(135deg, #9932CC, #800080);
}

.discord-btn svg {
    margin-right: 8px;
}

/* 主內容區樣式 */
main {
    min-height: calc(100vh - 160px);
    padding-top: 1rem;
    padding-bottom: 2rem;
}

.jumbotron {
    padding: 2rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    color: #333;
}

/* 卡片樣式 */
.card {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: #333;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.card-header {
    background: rgba(147, 112, 219, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #333;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

/* 表單樣式 */
.form-control, .form-select {
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(147, 112, 219, 0.5);
    color: #333;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    background-color: rgba(255, 255, 255, 0.9);
    border-color: var(--primary-color);
    color: #333;
    box-shadow: 0 0 0 3px rgba(147, 112, 219, 0.25);
}

.form-control::placeholder {
    color: #777;
}

/* 按鈕樣式 */
.btn {
    padding: 0.6rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

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

.btn-outline-primary {
    color: var(--secondary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 通知提示樣式 */
.alert {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.8);
    color: white;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.8);
    color: white;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.8);
    color: #212529;
}

.alert-info {
    background-color: rgba(147, 50, 204, 0.8);
    color: white;
}

/* 頁腳樣式 */
.footer {
    background: rgba(147, 112, 219, 0.4) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.5rem 0;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #333;
}

/* 響應式樣式調整 */
@media (max-width: 768px) {
    .jumbotron {
        padding: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
        padding: 0.4rem 1rem;
        margin-left: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .navbar-dark .navbar-nav .nav-link {
        padding: 0.6rem 1rem;
        margin: 0.3rem;
    }
}

@media (max-width: 576px) {
    main {
        padding-top: 0.5rem;
    }
    
    .jumbotron {
        padding: 1.2rem;
        border-radius: 12px;
    }
    
    .card {
        border-radius: 12px;
    }
    
    .card-header {
        padding: 0.8rem 1rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .display-4 {
        font-size: 1.75rem;
    }
    
    .navbar {
        margin: 10px;
        width: calc(100% - 20px);
    }
}

/* 使用者頭像和個人資料區塊 */
.user-profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1rem;
}

.user-avatar {
    width: 120px;
    height: 120px;
    border-radius: 60px;
    object-fit: cover;
    border: 3px solid rgba(147, 112, 219, 0.5);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
}

/* 歡迎頁特殊樣式 */
.welcome-icon img {
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    transition: transform 0.5s ease;
}

.welcome-icon img:hover {
    transform: scale(1.1) rotate(5deg);
}

/* 導航欄項目 hover 動畫 */
@keyframes nav-glow {
    0% {
        box-shadow: 0 0 5px rgba(147, 50, 204, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(147, 50, 204, 0.8);
    }
    100% {
        box-shadow: 0 0 5px rgba(147, 50, 204, 0.5);
    }
}

.navbar-dark .navbar-nav .nav-link:hover {
    animation: nav-glow 1.5s infinite;
}

/* 改進易讀性 */
p, .card-text, .lead {
    line-height: 1.7;
    font-size: 1.05rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

h1, h2, h3, h4, h5, h6 {
    letter-spacing: 0.02em;
    font-weight: 600;
}

/* 社群媒體按鈕 */
.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
    transition: transform 0.3s, background 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-btn:hover {
    background: rgba(147, 50, 204, 0.5);
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(147, 50, 204, 0.6);
}

/* 添加社群媒體下拉選單的樣式 */
.icon-dropdown-menu {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 0;
    width: auto;
    min-width: 200px;
    position: absolute;
    z-index: 1050;
}

.social-icon-select {
    cursor: pointer;
    width: 60px; /* 固定圖示選擇框的寬度 */
    justify-content: center;
}

.social-link-item .input-group {
    flex-wrap: nowrap;
}

/* Style for the combined user info block */
.nav-user-info {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem; /* Adjust padding as needed */
    border-radius: 14px;
    transition: all 0.3s ease;
}

.nav-user-info:hover {
    background: rgba(147, 112, 219, 0.2); /* Optional: subtle background on hover */
    transform: translateY(-2px);
}

.nav-user-info .avatar {
    width: 30px; /* Slightly smaller avatar */
    height: 30px;
    margin-right: 8px;
    box-shadow: none; /* Remove extra shadow if desired */
}

.nav-user-info .username {
    color: #333;
    font-weight: 500;
    /* No need for nav-link class here anymore */
}

/* User Info Block in Navbar */
.navbar-user-info {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    margin-left: auto; /* Push to the right */
    color: #333; /* Match nav link color */
    font-weight: 500;
}

.navbar-user-info a {
    color: inherit; /* Inherit color from parent */
    text-decoration: none; /* Remove underline */
}

.navbar-user-info a:hover {
    text-decoration: underline; /* Optional: Add underline on hover */
    /* color: var(--primary-color); */ /* Optional: Change color on hover */
}

.navbar-user-info .username {
    margin-left: 8px;
    font-size: 0.9rem;
}