/* 全域樣式 - 綠色及暖色系 */
:root {
    --primary-color: #2d8659;        /* 深綠色 */
    --primary-light: #4a9f6f;        /* 淺綠色 */
    --primary-lighter: #e8f5e9;      /* 極淺綠色 */
    --success-color: #d4a574;        /* 暖棕色 */
    --danger-color: #e8735f;         /* 暖紅色 */
    --warning-color: #f4b860;        /* 暖黃色 */
    --info-color: #7fb3a0;           /* 青綠色 */
    --accent-warm: #f5a962;          /* 暖橙色 */
    --accent-peach: #f8d4c4;         /* 桃色 */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #d4e8e0 0%, #c5dfd5 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #1a3a2e;
}

main {
    flex: 1;
}

/* 導航欄 */
.navbar {
    background: linear-gradient(90deg, #1a5a3a 0%, #2d8659 100%) !important;
    box-shadow: 0 4px 12px rgba(26, 90, 58, 0.3);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
}

.navbar-dark .navbar-nav .nav-link {
    color: #ffffff !important;
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: #f5a962 !important;
}

/* 卡片 */
.card {
    border: none;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    background: white;
    border-left: 4px solid var(--primary-color);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(45, 134, 89, 0.15) !important;
    border-left-color: var(--accent-warm);
}

/* 按鈕 */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

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

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(45, 134, 89, 0.25);
}

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

.btn-success:hover {
    background-color: #c49563;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(212, 165, 116, 0.25);
}

.btn-outline-primary {
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

/* 表單 */
.form-control,
.form-select {
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fafbfa;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 0.2rem rgba(45, 134, 89, 0.15);
}

/* 警告訊息 */
.alert {
    border-radius: 8px;
    border: none;
    border-left: 4px solid;
}

.alert-success {
    background-color: #e8f5e9;
    color: #2d5016;
    border-left-color: var(--primary-color);
}

.alert-danger {
    background-color: #fce4ec;
    color: #8b3a3a;
    border-left-color: var(--danger-color);
}

.alert-warning {
    background-color: #fff8e1;
    color: #7d6608;
    border-left-color: var(--warning-color);
}

.alert-info {
    background-color: #e0f2f1;
    color: #004d40;
    border-left-color: var(--info-color);
}

/* 頁面標題 */
.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--primary-color);
    text-shadow: 0 2px 4px rgba(45, 134, 89, 0.1);
}

/* 問卷相關 */
.question-card {
    background: linear-gradient(135deg, #ffffff 0%, #f5f9f7 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(45, 134, 89, 0.08);
    border-left: 4px solid var(--primary-color);
}

.question-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.emoji-option {
    display: inline-block;
    font-size: 2rem;
    cursor: pointer;
    margin: 0.5rem;
    transition: transform 0.2s ease, filter 0.2s ease;
    padding: 0.5rem;
    border-radius: 8px;
}

.emoji-option:hover {
    transform: scale(1.2);
    background-color: var(--primary-lighter);
}

.emoji-option.selected {
    transform: scale(1.3);
    background-color: var(--accent-peach);
    filter: drop-shadow(0 0 8px rgba(45, 134, 89, 0.4));
}

/* 聊天相關 */
.chat-container {
    background: linear-gradient(135deg, #ffffff 0%, #f5f9f7 100%);
    border-radius: 12px;
    height: 500px;
    overflow-y: auto;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(45, 134, 89, 0.08);
}

.message {
    margin-bottom: 1rem;
    display: flex;
    animation: slideIn 0.3s ease;
}

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

.message.user {
    justify-content: flex-end;
}

.message.counselor {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    word-wrap: break-word;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(45, 134, 89, 0.2);
}

.message.counselor .message-bubble {
    background-color: #e8f5e9;
    color: #2c3e50;
    border-left: 3px solid var(--success-color);
}

.message-time {
    font-size: 0.75rem;
    color: #7fb3a0;
    margin-top: 0.25rem;
}

/* 結果視覺化 */
.result-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 20px rgba(45, 134, 89, 0.25);
}

.result-score {
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
}

.result-level {
    font-size: 1.5rem;
    text-align: center;
    margin-top: 1rem;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.75rem;
    }

    .message-bubble {
        max-width: 90%;
    }

    .result-card {
        padding: 1.5rem;
    }

    .result-score {
        font-size: 2rem;
    }
}

/* 頁腳 */
footer {
    margin-top: auto;
    border-top: 2px solid #a8d5c4;
    background: linear-gradient(90deg, #c5dfd5 0%, #b8d9ce 100%);
    color: #1a5a3a;
}

/* 載入動畫 */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(45, 134, 89, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 心理諮商特色樣式 */
.wellness-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.wellness-icon.warm {
    color: var(--success-color);
}

.wellness-icon.accent {
    color: var(--accent-warm);
}

.hero-section {
    background: linear-gradient(135deg, #ffffff 0%, #f5f9f7 100%);
    border-radius: 12px;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(45, 134, 89, 0.1);
    border: 2px solid #d4e8e0;
}

.hero-section h1 {
    color: #1a5a3a;
    font-weight: 700;
}

.hero-section .lead {
    color: #2c3e50;
    font-size: 1.2rem;
}

/* 使用者下拉菜單 */
.navbar-dark .navbar-nav .dropdown-toggle::after {
    border-color: #ffffff;
}

.navbar-dark .navbar-nav .dropdown-toggle:hover::after {
    border-color: #f5a962;
}

.dropdown-menu {
    border: none;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(26, 90, 58, 0.15);
    margin-top: 0.5rem;
}

.dropdown-menu .dropdown-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    color: #1a5a3a;
    font-weight: 600;
    padding: 0.75rem 1rem;
}

.dropdown-menu .dropdown-item-text {
    display: block;
    padding: 0.5rem 1rem;
    color: #1a3a2e;
    font-size: 0.95rem;
}

.dropdown-menu .dropdown-item {
    color: #1a3a2e;
    transition: all 0.2s ease;
}

.dropdown-menu .dropdown-item:hover {
    background-color: #e8f5e9;
    color: #1a5a3a;
    padding-left: 1.5rem;
}

.dropdown-menu .dropdown-item i {
    margin-right: 0.5rem;
    color: #2d8659;
}

.dropdown-menu .dropdown-divider {
    margin: 0.5rem 0;
    border-color: #e9ecef;
}

/* 使用者名稱和身份徽章 */
.navbar-dark .navbar-nav .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-dark .navbar-nav .dropdown-toggle .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
    font-weight: 600;
}

