/* ==========================================
   全域變數與重設 (Reset & Variables)
   ========================================== */
:root {
    /* 主色彩系統 (HSL) */
    --bg-primary: hsl(230, 25%, 8%);
    --bg-secondary: hsl(230, 20%, 12%);
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    
    --text-primary: hsl(210, 20%, 98%);
    --text-secondary: hsl(210, 10%, 70%);
    --text-muted: hsl(210, 10%, 50%);
    
    --primary: hsl(215, 90%, 60%);
    --primary-hover: hsl(215, 100%, 65%);
    --primary-glow: rgba(30, 120, 255, 0.45);
    
    /* 燈號風險色彩 */
    --color-red: hsl(0, 85%, 60%);
    --color-red-glow: rgba(255, 70, 70, 0.5);
    --color-yellow: hsl(40, 95%, 55%);
    --color-yellow-glow: rgba(255, 180, 0, 0.5);
    --color-green: hsl(145, 65%, 50%);
    --color-green-glow: rgba(0, 220, 100, 0.5);
    
    /* 字型宣告 */
    --font-main: 'Outfit', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* 轉場與圓角 */
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 20px;
}

/* ==========================================
   發光背景裝飾 (Ambient Background Decor)
   ========================================== */
.bg-decor {
    position: fixed;
    width: 45vw;
    height: 45vw;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    filter: blur(120px);
    opacity: 0.15;
}

.bg-decor-1 {
    top: -10%;
    left: -10%;
    background: radial-gradient(circle, var(--primary) 0%, transparent 80%);
}

.bg-decor-2 {
    bottom: -10%;
    right: -10%;
    background: radial-gradient(circle, hsl(270, 80%, 50%) 0%, transparent 80%);
}

/* ==========================================
   主容器與卡片設計 (Layout & Card)
   ========================================== */
.app-container {
    width: 100%;
    max-width: 680px;
    margin: auto;
    z-index: 10;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 45px 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

/* 顯示與隱藏的樣式類別 */
.hidden {
    display: none !important;
}

/* 頁面切換淡入動畫 */
.fade-in {
    animation: fadeInAnimation 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* ==========================================
   文字排版與品牌 (Typography & Branding)
   ========================================== */
.logo-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-bottom: 25px;
    max-width: 250px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.brand-logo {
    width: 100%;
    height: auto;
    display: block;
}

.event-tag {
    display: inline-block;
    background: linear-gradient(90deg, rgba(30, 120, 255, 0.2), rgba(120, 30, 255, 0.1));
    color: hsl(215, 100%, 75%);
    border: 1px solid rgba(30, 120, 255, 0.3);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 50px;
    margin-bottom: 18px;
    letter-spacing: 1px;
}

.agenda-recommendation-box {
    margin-top: 25px;
    padding: 22px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
}

.agenda-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: hsl(215, 100%, 75%);
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.agenda-item {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border-left: 3px solid var(--primary);
}

.agenda-item.border-red {
    border-left-color: var(--color-red);
}

.agenda-item.border-yellow {
    border-left-color: var(--color-yellow);
}

.agenda-item.border-green {
    border-left-color: var(--color-green);
}

.agenda-item:last-child {
    margin-bottom: 0;
}

.agenda-time {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.agenda-time.text-red {
    color: var(--color-red);
}

.agenda-time.text-yellow {
    color: var(--color-yellow);
}

.agenda-time.text-green {
    color: var(--color-green);
}

.agenda-name {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
    line-height: 1.4;
}

.agenda-speaker {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.highlight {
    background: linear-gradient(90deg, #ffffff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

/* ==========================================
   按鈕樣式 (Buttons)
   ========================================== */
.btn {
    font-family: var(--font-main);
    font-size: 1.05rem;
    font-weight: 600;
    padding: 16px 36px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, hsl(220, 100%, 50%) 100%);
    color: white;
    box-shadow: 0 10px 25px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px var(--primary-glow);
    background: linear-gradient(135deg, var(--primary-hover) 0%, hsl(220, 100%, 55%) 100%);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================
   測驗主體設計 (Quiz Interface)
   ========================================== */
.quiz-header {
    margin-bottom: 35px;
}

.progress-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    display: block;
    margin-bottom: 12px;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), hsl(250, 100%, 65%));
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.question-title {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.option-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    padding: 20px 24px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    text-align: left;
}

.option-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(30, 120, 255, 0.4);
    transform: translateX(4px);
}

.option-prefix {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.option-card:hover .option-prefix {
    background: var(--primary);
    color: white;
}

.option-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.option-card:hover .option-text {
    color: var(--text-primary);
}

/* ==========================================
   診斷結果頁面設計 (Diagnostic Result)
   ========================================== */
.result-title {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
}

.result-score-box {
    text-align: center;
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.02);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    display: inline-block;
    width: 100%;
}

.score-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.score-value {
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    line-height: 1;
    display: inline-block;
}

.score-max {
    font-size: 1.1rem;
    color: var(--text-muted);
    display: inline-block;
    margin-left: 5px;
}

/* 燈號狀態展示 */
.status-light-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 35px;
    padding: 12px 24px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
}

.status-light {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.status-text {
    font-size: 1.1rem;
    font-weight: 700;
}

/* 燈號變體 */
.light-red {
    background-color: var(--color-red);
    box-shadow: 0 0 15px var(--color-red-glow);
    animation: pulseRed 2s infinite alternate;
}
.text-red {
    color: var(--color-red);
}

.light-yellow {
    background-color: var(--color-yellow);
    box-shadow: 0 0 15px var(--color-yellow-glow);
    animation: pulseYellow 2s infinite alternate;
}
.text-yellow {
    color: var(--color-yellow);
}

.light-green {
    background-color: var(--color-green);
    box-shadow: 0 0 15px var(--color-green-glow);
    animation: pulseGreen 2s infinite alternate;
}
.text-green {
    color: var(--color-green);
}

/* 呼吸動畫 */
@keyframes pulseRed {
    0% { opacity: 0.7; box-shadow: 0 0 8px var(--color-red-glow); }
    100% { opacity: 1; box-shadow: 0 0 20px var(--color-red); }
}
@keyframes pulseYellow {
    0% { opacity: 0.7; box-shadow: 0 0 8px var(--color-yellow-glow); }
    100% { opacity: 1; box-shadow: 0 0 20px var(--color-yellow); }
}
@keyframes pulseGreen {
    0% { opacity: 0.7; box-shadow: 0 0 8px var(--color-green-glow); }
    100% { opacity: 1; box-shadow: 0 0 20px var(--color-green); }
}

/* 診斷文字回饋區 */
.result-description-card {
    background: rgba(255, 255, 255, 0.02);
    border-left: 4px solid var(--primary);
    padding: 24px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-bottom: 40px;
    line-height: 1.8;
}

.result-description-card.border-red {
    border-left-color: var(--color-red);
}
.result-description-card.border-yellow {
    border-left-color: var(--color-yellow);
}
.result-description-card.border-green {
    border-left-color: var(--color-green);
}

.result-advice-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 12px;
}

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

.eap-solution-box {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.eap-badge {
    display: inline-block;
    background: rgba(30, 120, 255, 0.15);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    border: 1px solid rgba(30, 120, 255, 0.2);
}

.result-actions {
    display: flex;
    gap: 15px;
}

.line-container {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.line-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.line-container a img:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* ==========================================
   彈出式視窗樣式 (Modal)
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: var(--transition-smooth);
}

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 35px 30px;
    width: 95%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: modalPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    
    /* 隱藏滾動條但保持滾動功能（自訂樣式） */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.modal-card::-webkit-scrollbar {
    width: 6px;
}
.modal-card::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

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

.modal-brand {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.modal-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: white;
}

.modal-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 25px;
}

/* ==========================================
   Modal 表單元件樣式 (Modal Form Components)
   ========================================== */
.modal-form {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.required-star {
    color: var(--color-red);
    font-weight: bold;
}

.form-input {
    font-family: var(--font-main);
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    width: 100%;
    outline: none;
    transition: var(--transition-smooth);
}

.form-input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px var(--primary-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Chrome/Safari 數字鍵盤上下箭頭隱藏 */
.form-input[type=number]::-webkit-inner-spin-button, 
.form-input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
/* Firefox 數字鍵盤隱藏 */
.form-input[type=number] {
    -moz-appearance: textfield;
}

/* ==========================================
   客製化行動按鈕樣式 (CTA Buttons)
   ========================================== */
.btn-action-red {
    background: linear-gradient(135deg, var(--color-red) 0%, hsl(0, 85%, 45%) 100%);
    color: white;
    box-shadow: 0 8px 20px var(--color-red-glow);
}
.btn-action-red:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px var(--color-red-glow);
    background: linear-gradient(135deg, hsl(0, 90%, 65%) 0%, hsl(0, 85%, 50%) 100%);
}

.btn-action-yellow {
    background: linear-gradient(135deg, var(--color-yellow) 0%, hsl(40, 95%, 40%) 100%);
    color: white;
    box-shadow: 0 8px 20px var(--color-yellow-glow);
}
.btn-action-yellow:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px var(--color-yellow-glow);
    background: linear-gradient(135deg, hsl(40, 100%, 60%) 0%, hsl(40, 95%, 45%) 100%);
}

.btn-action-green {
    background: linear-gradient(135deg, var(--color-green) 0%, hsl(145, 65%, 38%) 100%);
    color: white;
    box-shadow: 0 8px 20px var(--color-green-glow);
}
.btn-action-green:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px var(--color-green-glow);
    background: linear-gradient(135deg, hsl(145, 75%, 55%) 0%, hsl(145, 65%, 42%) 100%);
}

/* ==========================================
   頁尾與響應式細節 (Footer & Media Queries)
   ========================================== */
.footer {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 40px;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .card {
        padding: 30px 20px;
        border-radius: var(--radius-md);
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .question-title {
        font-size: 1.25rem;
    }
    
    .option-card {
        padding: 16px;
    }
    
    .btn {
        padding: 14px 28px;
    }
}
