@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700;900&display=swap');

:root {
    --primary: #4a90e2;
    --secondary: #50e3c2;
    --accent: #f5a623;
    --bg-gradient: linear-gradient(135deg, #f0f4f8 0%, #e0eaf5 100%);
    --text-main: #333333;
    --text-light: #666666;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans TC', sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
}

.glass-header {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    padding: 30px 20px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.glass-header h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.glass-header h2 {
    font-size: 1.2rem;
    color: var(--text-light);
    font-weight: 400;
    margin-bottom: 15px;
}

.meeting-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

section {
    margin-bottom: 60px;
}

.section-title {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--secondary);
    border-radius: 2px;
}

/* File Cards */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.file-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.file-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.file-card .icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.file-card h3 {
    font-size: 1.3rem;
    color: var(--text-main);
    margin-bottom: 10px;
}

.file-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Flashcards */
.flashcard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    perspective: 1000px;
}

.scene {
    width: 100%;
    height: 250px;
    perspective: 1000px;
    cursor: pointer;
}

.card {
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
    position: relative;
    /* Do not use backdrop-filter here to avoid 3D flattening */
}

.scene.is-flipped .card {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--card-shadow);
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.card-front {
    color: var(--text-main);
}

.card-front h4 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.card-front p {
    font-size: 1.2rem;
    font-weight: 500;
}

.card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.card-back p {
    font-size: 1.1rem;
    line-height: 1.5;
}

.card-back .ans-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Quiz Section */
.quiz-container {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--card-shadow);
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--text-light);
}

.question-text {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 30px;
    color: var(--text-main);
}

.options-grid {
    display: grid;
    gap: 15px;
}

.option-btn {
    background: white;
    border: 2px solid #e0e0e0;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 1.1rem;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.option-btn:hover {
    border-color: var(--primary);
    background: rgba(74, 144, 226, 0.05);
}

.option-btn.correct {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.option-btn.wrong {
    background: #ffebee;
    border-color: #f44336;
    color: #c62828;
}

.next-btn {
    margin-top: 30px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s;
    display: none;
    font-weight: 500;
}

.next-btn:hover {
    background: #3a7bc8;
}

#quiz-result {
    text-align: center;
    display: none;
}

#quiz-result h3 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 15px;
}

#quiz-result p {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.restart-btn {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: 500;
}

/* Comic Section */
.comic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.comic-panel {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    position: relative;
}

.comic-panel img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.comic-panel .panel-number {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--accent);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.comic-caption {
    padding: 15px;
    font-size: 0.95rem;
    color: var(--text-main);
    text-align: justify;
    border-top: 3px solid var(--primary);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 800px;
    border-radius: 20px;
    padding: 30px;
    position: relative;
    transform: scale(0.9);
    transition: all 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-title {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.modal-body {
    width: 100%;
}

.audio-player {
    width: 100%;
    margin-bottom: 20px;
}
