/* 5貓日記 AI 獸醫系統 - 樣式 */

:root {
    --primary: #4A9B8C;
    --primary-dark: #3A7B6C;
    --secondary: #F5A962;
    --bg-light: #F8FAFB;
    --bg-white: #FFFFFF;
    --text-dark: #2C3E50;
    --text-muted: #7F8C8D;
    --border: #E8ECEF;
    --danger: #E74C3C;
    --warning: #F39C12;
    --success: #27AE60;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-white);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0,0,0,0.1);
}

/* 頁首 */
header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 20px 16px;
    text-align: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
}

.subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-top: 4px;
}

.status-bar {
    margin-top: 12px;
}

.status {
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
}

.status.online {
    background: var(--success);
}

.status.offline {
    background: var(--danger);
}

/* 主要內容 */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 16px;
}

/* AI 獸醫頭像 */
.vet-avatar-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.vet-avatar {
    width: 56px;
    height: 56px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.vet-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.vet-status {
    font-size: 0.85rem;
    color: var(--success);
}

/* 緊急橫幅 */
.emergency-banner {
    background: var(--danger);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    margin: 12px 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.emergency-icon {
    font-size: 1.2rem;
}

/* 聊天區 */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 45vh;
}

.welcome-message {
    background: var(--bg-light);
    padding: 16px;
    border-radius: 12px;
    text-align: center;
}

.welcome-message p {
    margin-bottom: 8px;
}

.welcome-message .disclaimer {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 12px;
}

/* 聊天泡泡 */
.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    animation: fadeIn 0.3s ease;
}

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

.message.user {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message.ai {
    background: var(--bg-light);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message .timestamp {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 6px;
}

/* 快速症狀按鈕 */
.quick-symptoms {
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.symptom-category {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.quick-symptoms button {
    flex: 1;
    min-width: calc(33% - 6px);
    padding: 8px 4px;
    border: 1px solid var(--border);
    background: var(--bg-white);
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-symptoms button:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 輸入區 */
.input-section {
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.input-wrapper textarea {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    resize: none;
    font-size: 1rem;
    font-family: inherit;
}

.input-wrapper textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.send-btn {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.4rem;
    cursor: pointer;
    transition: background 0.2s;
}

.send-btn:hover {
    background: var(--primary-dark);
}

.send-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.input-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 6px;
}

/* 底部導航 */
.bottom-nav {
    display: flex;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    padding: 8px 0;
}

.nav-item {
    flex: 1;
    text-align: center;
    padding: 8px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:hover {
    color: var(--primary);
}

.nav-icon {
    display: block;
    font-size: 1.4rem;
    margin-bottom: 2px;
}

/* 知識庫、緊急、5貓檔案 頁面（預設隱藏） */
.knowledge-page,
.emergency-page,
.cats-page {
    display: none;
}

.knowledge-page.active,
.emergency-page.active,
.cats-page.active {
    display: block;
}

/* 知識庫卡片 */
.knowledge-card {
    background: var(--bg-light);
    padding: 16px;
    border-radius: 12px;
    margin: 12px 0;
}

.knowledge-card h3 {
    color: var(--primary);
    margin-bottom: 8px;
}

.knowledge-card ul {
    margin-left: 20px;
}

/* 響應式 */
@media (max-width: 400px) {
    .quick-symptoms button {
        min-width: calc(50% - 4px);
    }
}