.hide-cite { display: none; }

:root {
    --primary: #006D77;
    --secondary: #83C5BE;
    --accent: #E29578;
    --bg: #EDF6F9;
    --text: #2B2D42;
    --white: #FFFFFF;
}

body {
    font-family: 'Google Sans', 'Prompt', 'Kanit', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    overflow-x: hidden;
}

.progress-container { width: 100%; height: 5px; background: #ccc; position: fixed; top: 0; z-index: 100; }
.progress-bar { height: 100%; background: var(--primary); width: 0%; transition: width 0.4s ease; }

.app-container { max-width: 1000px; margin: 60px auto 40px; padding: 0 20px; position: relative; min-height: 70vh; }
.slide { display: none; animation: fadeIn 0.5s forwards; }
.slide.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

#slide-0 { position: relative; height: 70vh; border-radius: 20px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.1); display: none; }
#slide-0.active { display: flex; align-items: center; justify-content: center; }
.cover-bg { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: url('smr-cover.jpg') center/cover no-repeat; filter: brightness(0.4); z-index: 1; }
.cover-content { position: relative; z-index: 2; text-align: center; color: var(--white); padding: 40px; }
.cover-content h1 { font-size: 3.5rem; margin: 10px 0; }
.badge { background: var(--accent); padding: 5px 15px; border-radius: 20px; font-size: 0.9rem; display: inline-block; }

/* การ์ดพร้อมพื้นหลังลวดลาย Energy Landscape (SVG ภายใน) */
.card {
    background-color: var(--white);
    background-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M-100 150 Q 250 50 600 150 T 1200 150' fill='none' stroke='%23006D77' stroke-width='3' opacity='0.03'/%3E%3Cpath d='M-100 200 Q 350 250 700 150 T 1300 200' fill='none' stroke='%2383C5BE' stroke-width='3' opacity='0.04'/%3E%3Ccircle cx='80%25' cy='20%25' r='100' fill='none' stroke='%23E29578' stroke-width='2' opacity='0.02'/%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    padding: 40px 40px 100px 40px; /* เว้นที่ด้านล่างให้มาสคอต */
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    position: relative; /* สำคัญมาก เพื่อให้มาสคอตอยู่ในการ์ด */
}

.split { display: flex; gap: 40px; align-items: center; margin-top: 20px; }
.split > div { flex: 1; }

h2 { color: var(--primary); font-size: 2rem; margin-top: 0;}
h3 { color: var(--secondary); }
.mt-1 { margin-top: 10px; } .mt-2 { margin-top: 20px; }
.center-text { text-align: center; }
.img-fluid { max-width: 100%; height: auto; }
.rounded { border-radius: 15px; } .shadow { box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

.feature-list li { margin-bottom: 10px; }
.timeline { border-left: 3px solid var(--secondary); padding-left: 20px; margin: 20px 0;}
.timeline-item { margin-bottom: 15px; position: relative; z-index: 2;}
.timeline-item::before { content: ''; position: absolute; left: -27px; top: 5px; width: 10px; height: 10px; background: var(--primary); border-radius: 50%; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 20px; }
.box { background: rgba(255, 255, 255, 0.8); padding: 15px; border-radius: 10px; border-left: 4px solid var(--accent); font-size: 0.9rem; z-index: 2; position: relative;}

/* ปุ่ม */
.btn { padding: 12px 25px; border-radius: 30px; cursor: pointer; font-family: inherit; font-size: 1rem; font-weight: 600; transition: all 0.3s; border: none; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: #004f56; transform: translateY(-2px); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-nav { background: var(--text); color: var(--white); padding: 10px 20px;}
.btn-nav:hover { background: var(--primary); }
.btn-nav:disabled { background: #ccc; cursor: not-allowed; opacity: 0.5;}

.nav-controls { display: flex; justify-content: center; gap: 20px; margin-top: 20px; }

/* Mascot ให้อยู่ในการ์ดมุมขวาล่าง */
.mascot-container {
    position: absolute;
    bottom: 20px;
    right: 30px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    z-index: 10;
}
.mascot-icon {
    font-size: 2.5rem;
    background: var(--bg);
    border-radius: 50%;
    padding: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    animation: bounce 2s infinite;
}
.mascot-bubble {
    background: var(--bg);
    padding: 12px 18px;
    border-radius: 20px 20px 0 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    max-width: 250px;
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
}
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* Quiz Modal */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); }
.modal-content { background-color: var(--white); margin: 10% auto; padding: 30px; border-radius: 15px; width: 90%; max-width: 500px; position: relative; }
.close { position: absolute; right: 20px; top: 15px; font-size: 28px; cursor: pointer; color: #888;}
.quiz-option { display: block; width: 100%; padding: 12px; margin: 10px 0; background: var(--bg); border: 1px solid #ddd; border-radius: 10px; cursor: pointer; text-align: left; font-family: inherit; font-size: 1rem;}
.quiz-option:hover { background: #e2e8f0; }
.quiz-result { margin-top: 15px; text-align: left; line-height: 1.5;}

/* CSS สำหรับหน้าสารบัญ (Table of Contents) */
.toc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    max-width: 800px;
    margin: 20px auto 40px auto;
}

@media (min-width: 768px) {
    .toc-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.toc-grid .btn-outline {
    text-align: left;
    padding: 15px 20px;
    font-size: 0.95rem;
    white-space: normal;
    height: 100%;
    display: flex;
    align-items: center;
}