/* 基本設置 */
/*@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700&display=swap');*/

@font-face {
	font-family: 'NotoSansTC';
	src: url("/fonts/NotoSansTC/NotoSansTC-Regular.ttf") format("opentype");
}

:root {
    --color-blue: #4169E1;
    --color-orange: #FF7F50;
    --color-green: #3CB371;
    --color-yellow: #FFD700;
    --color-multi: linear-gradient(90deg, #4169E1, #FF7F50, #3CB371, #FFD700);
    --transition-speed: 0.3s;
    --bg-color: #ded0c5;
    --content-width: 600px;
    --footer-height: 200px;
    --quiz-padding: 20px;
}

/* 全局基本樣式 */
body {
    font-family: 'NotoSansTC', '微軟正黑體', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    line-height: 1.8;
    color: #333;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

/* 容器樣式 */
.container {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - var(--footer-height));
    display: flex;
    flex-direction: column;
}

/* 音樂控制按鈕 */
.music-control {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1030;
    width: 40px;
    height: 40px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-control:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-speed) ease;
}

.music-control i {
    font-size: 18px;
    color: #666;
}

.music-control.playing i {
    color: var(--color-blue);
}

/* Landing Page 樣式 */
.landing-content {
    text-align: center;
    padding: 2rem 0;
    min-height: calc(100vh - var(--footer-height));
}

.landing-title-container {
    width: 100%;
}

.landing-title-container .title-image {
    width: 400px;
    max-width: 100%;
}

.landing-scene {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.landing-bg {
    width: 100%;
    height: auto;
    opacity: 0;
    animation: fadeIn 1s ease forwards;
}

.dialog-wrapper {
    position: absolute;
    top: 20%;
    left: 30%;
    width: 50%;
    max-width: 200px;
    opacity: 0;
    animation: slideIn 1s ease 0.5s forwards;
}

.landing-dialog {
    width: 100%;
    height: auto;
}



/* 按鈕樣式 */
.btn-start {
    background-color: #212529;
    color: white;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    border-radius: 50px;
    border: none;
    transition: all var(--transition-speed) ease;
}

.btn-start:hover {
    transform: translateY(-2px);
    background-color: #343a40;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: white;
}

/* 問題卡片樣式 */
#quiz-container {
    padding-bottom: var(--quiz-padding);
}

.quiz-card {
    width: 100%;
    height: calc(100vh - var(--footer-height) - var(--quiz-padding) * 2);
    border: none;
    border-radius: 15px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.quiz-title-image {
    width: 200px;
    max-width: 100%;
    margin: 1rem auto;
    display: block;
    position: relative;
    z-index: 2;
}

.question-overlay {
    flex: 1;
    padding: 2rem;
    margin-top: -50px;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-title {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* 選項樣式 */
.form-check {
    margin-bottom: 1rem;
    padding-left: 0;
}

.form-check-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.form-check-label {
    display: block;
    padding: 1rem 1.5rem;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    text-align: center;
    border: 2px solid transparent;
}

.form-check-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background-color: #fff;
}

.form-check-input:checked + .form-check-label {
    background-color: var(--color-blue);
    color: white;
    border-color: #fff;
}

/* 結果頁面樣式 */
.result-container {
    height: auto;
    overflow-y: visible;
    padding-bottom: 20px;
}

.result-container .card {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.result-container .card-title {
    color: #333;
    text-shadow: none;
}

.result-image-container {
    margin: 2rem 0;
    text-align: center;
}

.result-image {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 書籍推薦樣式 */
.book-recommendation {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
    text-align: center;
}

.book-display {
    max-width: 500px;
    margin: 0 auto;
}

.book-cover {
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition-speed) ease;
}

.book-cover:hover {
    transform: scale(1.05);
}

.book-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 1rem 0 0.5rem;
}

.book-author {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1.5rem;
}

/* 分享功能樣式 */
.button-container {
    position: relative;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.social-share-menu {
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    background-color: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    z-index: 1000;
    display: none;
    opacity: 0;
}

.social-share-menu.show {
    display: block;
    animation: fadeInCenter 0.3s ease forwards;
}

.button-container .d-flex {
    width: 100%;
    gap: 1rem;
}

.button-container .btn {
    flex: 1;
    margin: 0.5rem 0;
}

.social-share-grid {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.social-icon-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    background-color: #212529;
    color: white;
}

.social-icon-btn:hover {
    transform: translateY(-2px);
}

.social-icon-btn:nth-child(1):hover { background-color: #1877f2; }
.social-icon-btn:nth-child(2):hover { background-color: #00b900; }
.social-icon-btn:nth-child(3):hover { background-color: #000000; }
.social-icon-btn:nth-child(4):hover { background-color: #6c757d; }

/* Loading 樣式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(222, 208, 197, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* 動畫效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes fadeInCenter {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .card-title {
        font-size: 20px;
    }

    .form-check-label {
        padding: 0.75rem 1rem;
    }

    .book-cover {
        max-height: 250px;
    }

    .social-icon-btn {
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }

    .btn-start {
        padding: 0.8rem 2rem;
        font-size: 1.1rem;
    }
}

/* 無障礙支援 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}