body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.container {
    width: 90%;
    max-width: 450px;
    text-align: center;
}

header h1 {
    margin-bottom: 0.2rem;
    color: #2c3e50;
}

header p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 2rem;
}

.card {
    background: white;
    padding: 2.5rem 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    position: relative;
    transition: transform 0.2s;
}

.category {
    background-color: #e1ecf4;
    color: #39739d;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* 독일어 단어와 스피커 버튼 배치 */
.term-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
}

#german-term {
    font-size: 2.2rem;
    margin: 0;
    cursor: pointer;
    border-bottom: 2px dashed #ccc; /* 클릭 가능함을 암시 */
    transition: color 0.3s, border-bottom-color 0.3s;
}

#german-term:hover {
    color: #3498db;
    border-bottom-color: #3498db;
}

/* 스피커 버튼 스타일 */
.tts-btn {
    background-color: #f1f3f4;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    color: #555;
    font-size: 1.2rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tts-btn:hover {
    background-color: #dce0e3;
    color: #000;
    transform: scale(1.1);
}

/* 한국어 뜻 영역 */
#meaning-container {
    background-color: #fafafa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid #eee;
    animation: fadeIn 0.3s ease-in-out;
}

.hidden {
    display: none !important;
}

.meaning {
    font-size: 1.4rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 10px 0;
}

hr {
    border: 0;
    height: 1px;
    background: #e0e0e0;
    margin: 10px 0;
}

.desc {
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
    word-break: keep-all;
}

.nav-btn {
    background-color: #2c3e50;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1rem;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    transition: background 0.3s;
}

.nav-btn:hover {
    background-color: #1a252f;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
/* =========================================
   추가된 스타일 (강의 목록 및 독해 페이지)
   ========================================= */

/* 메인 화면: 강의 목록 링크 */
.lecture-list {
    margin-top: 30px;
    width: 100%;
}

.lecture-list h3 {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 15px;
    text-align: left;
    padding-left: 10px;
}

.lecture-link {
    display: flex;
    align-items: center;
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.lecture-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.lecture-number {
    font-weight: bold;
    color: #3498db;
    margin-right: 15px;
    font-size: 0.9rem;
}

.lecture-title {
    flex-grow: 1;
    text-align: left;
    font-weight: 600;
}

/* 독해 페이지 (Article View) */
.article-view {
    text-align: left; /* 독해는 왼쪽 정렬이 편함 */
}

.back-btn {
    display: inline-block;
    text-decoration: none;
    color: #666;
    margin-bottom: 20px;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.back-btn:hover { color: #2c3e50; }

.subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
    font-weight: normal;
    margin-top: -10px;
    margin-bottom: 30px;
}

.article-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    line-height: 1.8;
}

.german-text p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-family: 'Georgia', serif; /* 독일어는 세리프 폰트가 읽기 좋음 */
}

.keyword {
    color: #c0392b; /* 중요 단어 강조색 */
    font-weight: bold;
}

/* 번역 버튼 및 섹션 */
.toggle-trans-btn {
    width: 100%;
    padding: 12px;
    background-color: #f1f3f4;
    border: none;
    border-radius: 8px;
    color: #555;
    font-weight: bold;
    cursor: pointer;
    margin: 20px 0;
    transition: background 0.2s;
}

.toggle-trans-btn:hover { background-color: #e0e0e0; }

.korean-text {
    background-color: #fafafa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #3498db;
    animation: fadeIn 0.4s;
}

.korean-text p {
    font-size: 1rem;
    color: #555;
    margin-bottom: 1rem;
}

.korean-text p:last-child { margin-bottom: 0; }

/* =========================================
   팝업(Modal) 스타일 추가
   ========================================= */

/* 클릭 가능한 단어 스타일 (밑줄 표시) */
.interactive-word {
    color: #2c3e50;
    border-bottom: 2px dotted #3498db;
    cursor: pointer;
    transition: all 0.2s;
}

.interactive-word:hover {
    color: #3498db;
    background-color: rgba(52, 152, 219, 0.1);
}

/* 팝업 뒷배경 (반투명) */
.modal-overlay {
    display: none; /* 기본적으로 숨김 */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* 검정색 50% 투명 */
    backdrop-filter: blur(5px); /* 배경 흐리기 효과 (고급스러움) */
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

/* 팝업창 본문 */
.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    position: relative;
    text-align: center;
    transform: translateY(20px);
    animation: slideUp 0.3s forwards;
}

/* 닫기 버튼 (X) */
.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    color: #aaa;
    cursor: pointer;
}

.close-btn:hover { color: #333; }

/* 팝업 내부 텍스트 */
.modal-german {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.modal-grammar {
    color: #e74c3c;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 15px;
    display: block;
    background: #fdf0ed;
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
}

.modal-meaning {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.modal-desc {
    color: #666;
    line-height: 1.5;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

/* 애니메이션 */
@keyframes slideUp {
    to { transform: translateY(0); }
}
/* =========================================
   문장 카드(Sentence Card) 스타일
   ========================================= */

.sentence-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 50px;
}

.sentence-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s;
    text-align: left;
}

/* 상단 영역: 버튼 + 독일어 문장 */
.card-top {
    display: flex;
    align-items: flex-start; /* 문장이 길어도 버튼은 위쪽에 고정 */
    gap: 15px;
}

.play-btn {
    background-color: #e1ecf4;
    color: #3498db;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    flex-shrink: 0; /* 버튼 크기 줄어들지 않게 고정 */
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.play-btn:hover {
    background-color: #3498db;
    color: white;
    transform: scale(1.1);
}

.german-sentence {
    font-size: 1.15rem;
    margin: 0;
    line-height: 1.5;
    color: #2c3e50;
    cursor: pointer;
    flex-grow: 1;
    font-family: 'Georgia', serif;
}

.german-sentence:hover {
    color: #3498db;
}

.toggle-icon {
    font-size: 0.8rem;
    color: #ccc;
    margin-left: 8px;
    vertical-align: middle;
}

/* 한국어 해석 (아코디언 효과) */
.korean-translation {
    margin-top: 15px;
    padding: 15px;
    background-color: #fafafa;
    border-left: 3px solid #3498db;
    border-radius: 0 8px 8px 0;
    color: #555;
    font-size: 1rem;
    line-height: 1.6;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 어휘/문법 박스 */
.grammar-box {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background-color: #f0f2f5;
    color: #555;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

/* =========================================
   상세 학습(단어/문법) 스타일 추가
   ========================================= */

.detail-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
    border-top: 1px dashed #eee;
}

.detail-list li {
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-list li:last-child {
    border-bottom: none;
}

/* 단어 행: 단어 + 스피커 + 뜻 */
.word-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.word {
    font-size: 1.1rem;
    font-weight: bold;
    color: #2c3e50;
    font-family: 'Georgia', serif;
}

.meaning {
    font-size: 0.95rem;
    color: #555;
    flex-grow: 1; /* 남은 공간 차지 */
}

/* 작은 스피커 버튼 */
.mini-play {
    background-color: transparent;
    border: 1px solid #ddd;
    color: #888;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mini-play:hover {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* 문법 설명 박스 */
.grammar-note {
    background-color: #f9f9f9;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
    line-height: 1.5;
}

.grammar-note b {
    color: #333;
}

/* 문법 태그 (배지) */
.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
    margin-right: 5px;
    vertical-align: text-top;
}

.badge.red { background-color: #e74c3c; }   /* 명사 성별 등 */
.badge.blue { background-color: #3498db; }  /* 동사, 숙어 */
.badge.green { background-color: #27ae60; } /* 중성 등 */
.badge.purple { background-color: #9b59b6; }/* 문법 규칙 */
.badge.gray { background-color: #95a5a6; }  /* 형용사 등 */

/* --- 클릭 가능한 단어 & 사전 팝업 스타일 --- */

/* 1. 본문 단어 스타일 */
.interactive-word {
    cursor: pointer;
    border-bottom: 2px dotted #bdc3c7; /* 밑줄 점선 */
    transition: all 0.2s;
    padding-bottom: 1px;
}
.interactive-word:hover, .interactive-word.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background-color: rgba(52, 152, 219, 0.1);
}

/* 2. 사전 팝업창 (Bottom Sheet) */
#word-popup {
    position: fixed;
    bottom: -100%; /* 평소에는 화면 아래 숨김 */
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    border-radius: 20px 20px 0 0;
    padding: 25px;
    box-sizing: border-box;
    transition: bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}
#word-popup.show {
    bottom: 0; /* 나타날 때 */
}

/* 팝업 내용 */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.popup-word {
    font-size: 1.5rem;
    font-weight: 800;
    color: #2c3e50;
}
.popup-close {
    font-size: 1.5rem;
    color: #95a5a6;
    cursor: pointer;
    background: none;
    border: none;
}
.popup-meaning {
    font-size: 1.1rem;
    color: #34495e;
    font-weight: bold;
    margin-bottom: 8px;
}
.popup-grammar {
    font-size: 0.9rem;
    color: #7f8c8d;
    background-color: #f0f3f4;
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-block;
    line-height: 1.4;
}
.popup-play {
    width: 40px; height: 40px;
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    border: none;
    font-size: 1rem;
    margin-left: 10px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}

