/**
 * Chatly App View - cahtly_appview.css
 * [최종 수정] Life 콘텐츠 내 인터랙티브 퀴즈 UI/UX 적용 (v2.4)
 */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #e9ebee;
}

.main-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.topic-list-panel {
    width: 320px;
    flex-shrink: 0;
    background-color: #f7f7f7;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}
.panel-header { padding: 18px 15px; border-bottom: 1px solid #ddd; flex-shrink: 0; }
.panel-header h2 { margin: 0; font-size: 18px; }
.list-content { overflow-y: auto; flex-grow: 1; }
.topic-item { display: block; padding: 12px 15px; border-bottom: 1px solid #eee; text-decoration: none; color: #333; font-size: 14px; transition: background-color 0.2s; }
.topic-item:hover { background-color: #f0f0f0; }
.topic-item.active { background-color: #dceaff; font-weight: bold; color: #0056b3; }

.app-container {
    flex-grow: 1;
    height: 100vh;
    background-color: #a7b7c5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-header {
    background-color: #a7b7c5;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    flex-shrink: 0;
}
.app-header h1 { margin: 0; font-size: 1em; }
.back-button { text-decoration: none; color: #000; font-size: 16px; }

.level-tabs {
    display: flex;
    background-color: #a7b7c5;
    padding: 5px 10px;
    flex-shrink: 0;
    border-bottom: 1px solid #9aa9b8;
}
.level-tab { padding: 8px 15px; border: none; background-color: transparent; cursor: pointer; font-size: 14px; border-radius: 18px; margin-right: 5px; transition: background-color 0.2s; }
.level-tab:hover { background-color: #9aa9b8; }
.level-tab.active { background-color: #007bff !important; font-weight: bold !important; color: #ffffff !important; box-shadow: none !important; }

.chat-screen { flex-grow: 1; overflow-y: auto; padding: 10px; }
.chat-message { margin-bottom: 15px; display: flex; flex-direction: column; }
.chat-message.received { align-items: flex-start; }
.chat-message.sent { align-items: flex-end; }
.profile { display: flex; align-items: center; margin-bottom: 5px; }
.profile-pic { width: 40px; height: 40px; background-color: #eee; border-radius: 15px; margin-right: 8px; }
.speaker-name { font-size: 14px; font-weight: 500; }
.chat-message.sent .profile { justify-content: flex-end; }
.message-bubble { max-width: 90%; padding: 10px 15px; border-radius: 18px; font-size: 15px; line-height: 1.5; word-wrap: break-word; }
.chat-message.received .message-bubble { background-color: #fff; border-top-left-radius: 0; }
.chat-message.sent .message-bubble { background-color: #fee500; border-top-right-radius: 0; }
.loader { text-align: center; padding: 50px; font-style: italic; color: #555; }

/* ★★★ [수정] Quiz UI/UX 스타일 최종본 ★★★ */
.quiz-wrapper {
    width: 100%;
    max-width: 420px;
    margin: 20px auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.quiz-question { font-size: 1.2em; font-weight: bold; text-align: center; margin-bottom: 8px; line-height: 1.4; }
.quiz-translation { font-size: 0.9em; color: #888; text-align: center; margin-bottom: 15px; }
.quiz-hint { font-size: 0.9em; color: #6c757d; margin-bottom: 20px; text-align: center; }
.options-container { display: flex; flex-direction: column; width: 100%; gap: 10px; }
.option-btn { padding: 12px; border: 2px solid #ced4da; background-color: #f8f9fa; cursor: pointer; font-size: 1em; border-radius: 12px; transition: all 0.2s ease-in-out; }
.option-btn:hover { border-color: #007bff; background-color: #e9ecef; }
.option-btn:disabled { cursor: not-allowed; opacity: 0.7; }
.option-btn.ox { font-weight: bold; font-size: 1.2em; }
.check-answer-btn { margin-top: 15px; width: 100%; padding: 12px; background-color: #28a745; color: white; border: none; border-radius: 8px; font-size: 1.1em; cursor: pointer; }
.check-answer-btn:disabled { background-color: #6c757d; }
.feedback-container { margin-top: 15px; }
.feedback { padding: 10px; border-radius: 8px; font-weight: bold; text-align: center; }
.feedback.correct { background-color: #d4edda; color: #155724; }
.feedback.incorrect { background-color: #f8d7da; color: #721c24; }
.explanation-container { margin-top: 10px; background-color: #e9ecef; padding: 15px; border-radius: 8px; }
.explanation-container h4 { margin-top: 0; margin-bottom: 10px; }
.explanation-container p { margin: 0; line-height: 1.6; }

.puzzle-container { width: 100%; display: flex; flex-direction: column; gap: 15px; }
.puzzle-answer-target, .puzzle-words-source { width: 100%; min-height: 50px; padding: 10px; border-radius: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.puzzle-answer-target { border: 2px dashed #007bff; background-color: #f0f8ff; }
.puzzle-words-source { border: 2px solid #e9ecef; background-color: #f8f9fa; }
.puzzle-word { padding: 8px 12px; background-color: white; border: 1px solid #ced4da; border-radius: 8px; cursor: grab; user-select: none; transition: all 0.2s ease; }
.puzzle-word:active { cursor: grabbing; }
.puzzle-word.dragging { opacity: 0.5; transform: scale(1.1); }