/* Master 문법 공통 스타일 (2024 리뉴얼)
   - intermediate-common.css 구조 기반 + 마스터 전용 컬러/포인트 적용
*/

/* 전체 박스/폰트/배경 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Nanum Gothic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #FF9800 0%, #FF5722 100%);
    min-height: 100vh;
    padding: 20px;
}

/* 메인 컨테이너 스타일 */
.learning-container {
    padding: 20px;
    padding-bottom: 120px;
    max-width: 1400px;
    margin: 0 auto;
}

.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.theory-panel {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.practice-panel {
    background: white;
    border-radius: 12px;
    padding: 30px;
    padding-bottom: 100px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    min-height: 80vh;
}

/* 프로그레스 바 스타일 */
.progress-indicator {
    margin-bottom: 25px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF9800, #FF5722);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

/* 레슨 헤더 스타일 */
.lesson-header {
    background: linear-gradient(135deg, #FF9800 0%, #FF5722 100%);
    padding: 25px 30px;
    border-radius: 15px;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.3);
}

.lesson-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: 1;
}

.lesson-header::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -10%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    z-index: 1;
}

.lesson-header h2 {
    color: white;
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 2;
    position: relative;
    letter-spacing: -0.5px;
}

/* header-content 추가 */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-content h1 {
    flex-grow: 1;
    text-align: center;
}

/* 백 헤더 스타일 */
.back-header {
    background: linear-gradient(135deg, #FF9800 0%, #FF5722 100%);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
    z-index: 2;
}

.header-content h1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.level-indicator {
    margin-left: auto;
}

.back-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: 1;
}

.back-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -30px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    z-index: 1;
}

.back-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    z-index: 2;
    position: relative;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.back-button i {
    font-size: 18px;
}

.back-header h1 {
    color: white;
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 2;
    position: relative;
    flex: 1;
    text-align: center;
}

.level-indicator {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    padding: 6px 12px;
    border-radius: 25px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 2;
    position: relative;
    align-self: center;
}

.level-indicator i {
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* 주제 선택 토글 버튼 */
.topic-toggle-container {
    margin-bottom: 25px;
}

.topic-toggle-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #FF9800;
    border: 3px solid #FF9800;
    padding: 18px 30px;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.25);
    position: relative;
    overflow: hidden;
    text-shadow: none;
    letter-spacing: 0.5px;
}

.topic-toggle-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 152, 0, 0.35);
    background: linear-gradient(135deg, #fff8e1 0%, #fff3e0 100%);
    border-color: #FF5722;
    color: #FF5722;
}

.topic-toggle-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 152, 0, 0.1), transparent);
    transition: left 0.5s;
}

.topic-toggle-btn:hover::before {
    left: 100%;
}

.topic-toggle-btn i:first-child {
    font-size: 20px;
    color: #FF9800;
    transition: all 0.3s ease;
}

.topic-toggle-btn:hover i:first-child {
    color: #FF5722;
    transform: scale(1.1);
}

.toggle-icon {
    transition: transform 0.3s ease;
    font-size: 16px;
    color: #FF9800;
}

.topic-toggle-btn:hover .toggle-icon {
    color: #FF5722;
    transform: rotate(180deg);
}

/* 시제 관련 스타일 */
.tense-overview {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.tense-timeline {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    gap: 10px;
}

.tense-item {
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    flex: 1;
}

.tense-item.past { background: linear-gradient(135deg, #FF6B6B, #FF8E8E); color: white; }
.tense-item.present { background: linear-gradient(135deg, #4ECDC4, #44A08D); color: white; }
.tense-item.future { background: linear-gradient(135deg, #45B7D1, #96C5F7); color: white; }

.tense-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.tense-details .tense-section {
    background: white;
    padding: 20px;
    margin: 15px 0;
    border-radius: 10px;
    border-left: 4px solid #FF9800;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tense-formula {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
    font-family: monospace;
}

.example-box {
    background: #e8f5e8;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
}

.usage-tip {
    background: #fff3cd;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    border-left: 3px solid #ffc107;
}

.quick-reference {
    background: linear-gradient(135deg, #FF9800 0%, #FF5722 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.ref-item {
    background: rgba(255,255,255,0.2);
    padding: 10px;
    border-radius: 6px;
    text-align: center;
}

/* 퀴즈 관련 스타일 */
.quiz-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.quiz-section h2 {
    color: #FF9800;
    font-size: 28px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.quiz-container {
    margin: 0 auto;
    max-width: 800px;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-radius: 12px;
    border: 1px solid #ffe0b2;
}

.quiz-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #e65100;
    margin: 0;
}

.quiz-progress {
    font-size: 16px;
    font-weight: 600;
    color: #e65100;
}

.current-set {
    background: #FF9800;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: bold;
}

.quiz-score {
    font-size: 16px;
    font-weight: 600;
    color: #e65100;
}

#totalScore {
    background: #FF9800;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: bold;
}

.quiz-content {
    margin-bottom: 30px;
}

.question-container {
    margin-bottom: 30px;
}

.question-number {
    background: linear-gradient(135deg, #FF9800 0%, #FF5722 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.18);
}

.question-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.6;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.option-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #FF9800 0%, #FF5722 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.option-label:hover {
    border-color: #FF9800;
    background: linear-gradient(135deg, #fff8e1 0%, #fff3e0 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.15);
}

.option-label:hover::before {
    transform: scaleY(1);
}

.option-label input[type="radio"] {
    display: none;
}

.option-label input[type="radio"]:checked + .option-text {
    color: #e65100;
    font-weight: 600;
}

.option-label:has(input[type="radio"]:checked) {
    border-color: #FF9800;
    background: linear-gradient(135deg, #fff8e1 0%, #fff3e0 100%);
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.2);
}

.option-label:has(input[type="radio"]:checked)::before {
    transform: scaleY(1);
}

.option-text {
    font-size: 16px;
    color: #333;
    line-height: 1.5;
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 1;
    padding-left: 15px;
}

.option-label:hover .option-text {
    color: #e65100;
}

/* 입력 필드 스타일 */
.fill-container, .translation-container {
    margin-bottom: 20px;
}

.fill-input, .translation-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    font-family: 'Nanum Gothic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    outline: none;
}

.fill-input:focus, .translation-input:focus {
    outline: none;
    border-color: #FF9800;
    background: linear-gradient(135deg, #fff8e1 0%, #fff3e0 100%);
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.15);
    transform: translateY(-2px);
}

.fill-input::placeholder, .translation-input::placeholder {
    color: #6c757d;
    font-style: italic;
    opacity: 0.7;
}

.fill-input:hover, .translation-input:hover {
    border-color: #FF9800;
    background: linear-gradient(135deg, #fff8e1 0%, #fff3e0 100%);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.1);
}

.translation-input {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* 번역 입력 필드 스타일 */
.answer-textarea {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    font-family: 'Nanum Gothic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    outline: none;
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
    color: #333;
}

.answer-textarea:focus {
    outline: none;
    border-color: #FF9800;
    background: linear-gradient(135deg, #fff8e1 0%, #fff3e0 100%);
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.15);
    transform: translateY(-2px);
}

.answer-textarea::placeholder {
    color: #6c757d;
    font-style: italic;
    opacity: 0.7;
}

.answer-textarea:hover {
    border-color: #FF9800;
    background: linear-gradient(135deg, #fff8e1 0%, #fff3e0 100%);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.1);
}

.hint-options {
    color: #6c757d;
    font-size: 14px;
    margin-top: 8px;
    font-style: italic;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #FF9800;
}

/* 결과 컨테이너 */
.result-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    text-align: center;
}

.result-content {
    max-width: 600px;
    margin: 0 auto;
}

.result-title {
    color: #FF9800;
    font-size: 28px;
    margin-bottom: 20px;
}

.result-score {
    font-size: 24px;
    font-weight: bold;
    color: #e65100;
    margin-bottom: 15px;
}

.result-details {
    font-size: 16px;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 피드백/설명/점수/결과 */
.feedback {
    margin-top: 15px;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: slideDown 0.3s;
}

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

.feedback.correct {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    color: #155724;
}

.feedback.incorrect {
    background: linear-gradient(135deg, #f8d7da 0%, #f1b0b7 100%);
    border: 1px solid #f1b0b7;
    color: #721c24;
}

.feedback i {
    font-size: 18px;
    margin-top: 2px;
}

.set-score, .score-display, .final-score {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #bbdefb;
    border-radius: 15px;
    text-align: center;
    animation: pulse 0.5s;
}

@keyframes pulse {
    0% { transform: scale(0.95); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.grade, .final-grade {
    font-size: 32px;
    font-weight: bold;
    color: #FF9800;
}

.percentage, .final-percentage {
    font-size: 24px;
    color: #333;
    font-weight: 600;
}

.score-detail, .final-detail {
    font-size: 16px;
    color: #666;
}

/* 주제 선택기 스타일 */
.topic-selector {
    display: none;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.topic-selector.visible {
    opacity: 1;
    transform: translateY(0);
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.topic-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
}

.topic-card:hover {
    border-color: #FF9800;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.topic-card.current {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.topic-card.unavailable {
    opacity: 0.6;
    cursor: not-allowed;
}

.topic-card.unavailable .lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 24px;
    color: #6c757d;
}

.topic-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.topic-info h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 16px;
}

.topic-info p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.current-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
}

/* 퀴즈 컨트롤 버튼 */
.quiz-controls {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 32px 0 0 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 36px;
    font-size: 20px;
    font-weight: 700;
    border: none;
    border-radius: 32px;
    background: linear-gradient(135deg, #FF9800 0%, #FF5722 100%);
    color: #fff;
    box-shadow: 0 6px 24px rgba(255, 152, 0, 0.18);
    cursor: pointer;
    transition: all 0.25s;
    outline: none;
    position: relative;
    z-index: 1;
}

.btn i {
    font-size: 22px;
    margin-right: 2px;
}

.btn.primary {
    background: linear-gradient(135deg, #FF9800 0%, #FFD600 100%);
    color: #fff;
    box-shadow: 0 8px 28px rgba(255, 152, 0, 0.22);
}

.btn.secondary {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #FF9800;
    border: 2px solid #FF9800;
    box-shadow: 0 4px 16px rgba(255, 152, 0, 0.10);
}

.btn.secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #ffe0b2 0%, #ffd180 100%);
}

.btn:active {
    transform: scale(0.98);
    filter: brightness(0.96);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.2);
    box-shadow: none;
}

/* check-btn: 퀴즈 답 확인 버튼 */
.check-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 36px;
    font-size: 20px;
    font-weight: 700;
    border: none;
    border-radius: 32px;
    background: linear-gradient(135deg, #FF9800 0%, #FF5722 100%);
    color: #fff;
    box-shadow: 0 8px 28px rgba(255, 152, 0, 0.18);
    cursor: pointer;
    transition: all 0.25s;
    outline: none;
    position: relative;
    z-index: 1;
    margin: 24px auto 0 auto;
    width: 100%;
    letter-spacing: 1px;
}

.check-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 12px 32px rgba(255, 152, 0, 0.25);
    filter: brightness(1.08);
    background: linear-gradient(135deg, #FFA726 0%, #FFD600 100%);
}

.check-btn:active {
    transform: scale(0.98);
    filter: brightness(0.96);
}

.check-btn:disabled,
.check-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.2);
    box-shadow: none;
}

/* 팁 버튼 스타일 */
.tip-btn {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    position: relative;
    z-index: 10;
}

.tip-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.tip-btn i {
    color: #fff;
    font-size: 14px;
}

/* 팁 모달 스타일 */
.tip-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tip-modal.show {
    display: flex;
    opacity: 1;
}

.tip-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.tip-modal.show .tip-content {
    transform: translateY(0);
}

.tip-header {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    padding: 20px 25px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.tip-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.close-tip {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.close-tip:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.tip-body {
    padding: 25px;
    line-height: 1.6;
}

.tip-body h4 {
    color: #333;
    margin: 20px 0 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.tip-body h5 {
    color: #555;
    margin: 15px 0 8px 0;
    font-size: 16px;
    font-weight: 600;
}

.tip-body p {
    color: #666;
    margin: 10px 0;
}

.tip-body ul {
    margin: 10px 0;
    padding-left: 20px;
}

.tip-body li {
    color: #666;
    margin: 8px 0;
    position: relative;
}

/* 팁 섹션 스타일 */
.tip-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    border-left: 5px solid #FF9800;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.tip-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: 1;
}

.tip-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    z-index: 1;
}

.tip-section h4 {
    color: white;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.tip-section h4 i {
    color: #FFD700;
    font-size: 20px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.tip-section p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    line-height: 1.6;
    z-index: 2;
    position: relative;
}

/* 팁 예시 섹션 */
.tip-examples {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid #ff8a65;
    box-shadow: 0 4px 15px rgba(252, 182, 159, 0.3);
    position: relative;
    overflow: hidden;
}

.tip-examples::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b6b, #ffa726, #66bb6a, #42a5f5, #ab47bc);
}

.tip-examples h5 {
    color: #d84315;
    font-weight: 700;
    font-size: 17px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 2px rgba(216, 67, 21, 0.1);
}

.tip-examples ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.tip-examples li {
    background: rgba(255, 255, 255, 0.8);
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 10px;
    border-left: 4px solid #ff6b6b;
    font-weight: 500;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.tip-examples li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #ff6b6b, #ffa726);
    transition: all 0.3s ease;
}

.tip-examples li:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateX(5px) translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.tip-examples li:hover::before {
    width: 6px;
    background: linear-gradient(180deg, #ff6b6b, #ffa726, #66bb6a);
}

.tip-examples li strong {
    color: #d84315;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(216, 67, 21, 0.1);
}

/* 팁 사용법 섹션 */
.tip-usage {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid #81c784;
    box-shadow: 0 4px 15px rgba(168, 237, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.tip-usage::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #66bb6a, #42a5f5, #ab47bc, #ff6b6b, #ffa726);
}

.tip-usage h5 {
    color: #2e7d32;
    font-weight: 700;
    font-size: 17px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 2px rgba(46, 125, 50, 0.1);
}

.tip-usage ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.tip-usage li {
    background: rgba(255, 255, 255, 0.8);
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 10px;
    border-left: 4px solid #66bb6a;
    font-weight: 500;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.tip-usage li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #66bb6a, #42a5f5);
    transition: all 0.3s ease;
}

.tip-usage li:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateX(5px) translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 187, 106, 0.3);
}

.tip-usage li:hover::before {
    width: 6px;
    background: linear-gradient(180deg, #66bb6a, #42a5f5, #ab47bc);
}

.tip-usage li strong {
    color: #2e7d32;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(46, 125, 50, 0.1);
}

/* 구체적인 예시 섹션 특별 스타일 */
.tip-usage h5:contains("구체적인 예시") + ul li,
.tip-usage h5:contains("🔍") + ul li {
    border-left-color: #e91e63;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 235, 238, 0.9) 100%);
}

.tip-usage h5:contains("구체적인 예시") + ul li::before,
.tip-usage h5:contains("🔍") + ul li::before {
    background: linear-gradient(180deg, #e91e63, #ff5722);
}

.tip-usage h5:contains("구체적인 예시") + ul li:hover,
.tip-usage h5:contains("🔍") + ul li:hover {
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}

.tip-usage h5:contains("구체적인 예시") + ul li strong,
.tip-usage h5:contains("🔍") + ul li strong {
    color: #c2185b;
}

/* 주의사항 섹션 특별 스타일 */
.tip-usage h5:contains("주의사항") + ul li,
.tip-usage h5:contains("⚠️") + ul li {
    border-left-color: #f44336;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 235, 238, 0.9) 100%);
}

.tip-usage h5:contains("주의사항") + ul li::before,
.tip-usage h5:contains("⚠️") + ul li::before {
    background: linear-gradient(180deg, #f44336, #ff5722);
}

.tip-usage h5:contains("주의사항") + ul li:hover,
.tip-usage h5:contains("⚠️") + ul li:hover {
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.tip-usage h5:contains("주의사항") + ul li strong,
.tip-usage h5:contains("⚠️") + ul li strong {
    color: #d32f2f;
}

/* 비교 설명 섹션 특별 스타일 */
.tip-usage h5:contains("차이점") + ul li,
.tip-usage h5:contains("🔄") + ul li {
    border-left-color: #2196f3;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(227, 242, 253, 0.9) 100%);
}

.tip-usage h5:contains("차이점") + ul li::before,
.tip-usage h5:contains("🔄") + ul li::before {
    background: linear-gradient(180deg, #2196f3, #42a5f5);
}

.tip-usage h5:contains("차이점") + ul li:hover,
.tip-usage h5:contains("🔄") + ul li:hover {
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.tip-usage h5:contains("차이점") + ul li strong,
.tip-usage h5:contains("🔄") + ul li strong {
    color: #1976d2;
}

/* 기본 구조 섹션 특별 스타일 */
.tip-examples h5:contains("기본 구조") + ul li,
.tip-examples h5:contains("📝") + ul li {
    border-left-color: #ff9800;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 243, 224, 0.9) 100%);
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.tip-examples h5:contains("기본 구조") + ul li::before,
.tip-examples h5:contains("📝") + ul li::before {
    background: linear-gradient(180deg, #ff9800, #ffa726);
}

.tip-examples h5:contains("기본 구조") + ul li:hover,
.tip-examples h5:contains("📝") + ul li:hover {
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.tip-examples h5:contains("기본 구조") + ul li strong,
.tip-examples h5:contains("📝") + ul li strong {
    color: #f57c00;
}

/* 주요 특징 섹션 특별 스타일 */
.tip-examples h5:contains("주요 특징") + ul li,
.tip-examples h5:contains("🎯") + ul li {
    border-left-color: #4caf50;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(232, 245, 233, 0.9) 100%);
}

.tip-examples h5:contains("주요 특징") + ul li::before,
.tip-examples h5:contains("🎯") + ul li::before {
    background: linear-gradient(180deg, #4caf50, #66bb6a);
}

.tip-examples h5:contains("주요 특징") + ul li:hover,
.tip-examples h5:contains("🎯") + ul li:hover {
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.tip-examples h5:contains("주요 특징") + ul li strong,
.tip-examples h5:contains("🎯") + ul li strong {
    color: #388e3c;
}

/* 사용 시기 섹션 특별 스타일 */
.tip-usage h5:contains("사용 시기") + ul li,
.tip-usage h5:contains("💡") + ul li {
    border-left-color: #2196f3;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(227, 242, 253, 0.9) 100%);
}

.tip-usage h5:contains("사용 시기") + ul li::before,
.tip-usage h5:contains("💡") + ul li::before {
    background: linear-gradient(180deg, #2196f3, #42a5f5);
}

.tip-usage h5:contains("사용 시기") + ul li:hover,
.tip-usage h5:contains("💡") + ul li:hover {
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.tip-usage h5:contains("사용 시기") + ul li strong,
.tip-usage h5:contains("💡") + ul li strong {
    color: #1976d2;
}

/* 주요 가정법 동사들 섹션 특별 스타일 */
.tip-usage h5:contains("주요 가정법 동사들") + ul li {
    border-left-color: #9c27b0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(243, 229, 245, 0.9) 100%);
}

.tip-usage h5:contains("주요 가정법 동사들") + ul li::before {
    background: linear-gradient(180deg, #9c27b0, #ba68c8);
}

.tip-usage h5:contains("주요 가정법 동사들") + ul li:hover {
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.3);
}

.tip-usage h5:contains("주요 가정법 동사들") + ul li strong {
    color: #7b1fa2;
}

/* 일반 시제와의 차이 섹션 특별 스타일 */
.tip-usage h5:contains("일반 시제와의 차이") + ul li {
    border-left-color: #ff9800;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 243, 224, 0.9) 100%);
}

.tip-usage h5:contains("일반 시제와의 차이") + ul li::before {
    background: linear-gradient(180deg, #ff9800, #ffa726);
}

.tip-usage h5:contains("일반 시제와의 차이") + ul li:hover,
.tip-usage h5:contains("🔄") + ul li:hover {
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.tip-usage h5:contains("일반 시제와의 차이") + ul li strong,
.tip-usage h5:contains("🔄") + ul li strong {
    color: #f57c00;
}

/* 자주 사용되는 형용사 섹션 특별 스타일 */
.tip-usage h5:contains("자주 사용되는 형용사") + ul li,
.tip-usage h5:contains("📋") + ul li {
    border-left-color: #9c27b0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(243, 229, 245, 0.9) 100%);
}

.tip-usage h5:contains("자주 사용되는 형용사") + ul li::before,
.tip-usage h5:contains("📋") + ul li::before {
    background: linear-gradient(180deg, #9c27b0, #ba68c8);
}

.tip-usage h5:contains("자주 사용되는 형용사") + ul li:hover,
.tip-usage h5:contains("📋") + ul li:hover {
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.3);
}

.tip-usage h5:contains("자주 사용되는 형용사") + ul li strong,
.tip-usage h5:contains("📋") + ul li strong {
    color: #7b1fa2;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .split-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .theory-panel {
        position: static;
        order: 1;
    }
    .practice-panel {
        order: 2;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .learning-container {
        padding: 15px;
        padding-bottom: 150px;
    }
    
    .split-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .theory-panel {
        position: static;
        order: 1;
    }
    
    .practice-panel {
        order: 2;
        padding-bottom: 120px;
    }
    
    .back-header {
        padding: 15px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .back-header h1 {
        font-size: 20px;
        flex: 1;
        text-align: center;
        margin: 0;
    }
    
    .level-indicator {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .topic-toggle-btn {
        font-size: 14px;
        padding: 12px 20px;
    }
    
    .topic-toggle-btn i:first-child {
        font-size: 16px;
    }
    
    .topic-grid {
        grid-template-columns: 1fr;
    }
    
    .tense-timeline {
        flex-direction: column;
        gap: 10px;
    }
    
    .reference-grid {
        grid-template-columns: 1fr;
    }
    
    .quiz-controls {
        flex-direction: column;
        gap: 16px;
        margin-top: 18px;
    }
    
    .btn {
        width: 100%;
        font-size: 18px;
        padding: 14px 0;
        justify-content: center;
    }
    
    .btn i {
        font-size: 20px;
    }
    
    .check-btn {
        width: 100%;
        font-size: 18px;
        padding: 14px 0;
    }
    
    .tip-content {
        width: 95%;
        margin: 10% auto;
        max-height: 85vh;
    }
    
    .tip-header {
        padding: 15px 20px;
    }
    
    .tip-header h3 {
        font-size: 18px;
    }
    
    .tip-body {
        padding: 20px;
    }
    
    .tip-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .tip-examples,
    .tip-usage {
        padding: 15px;
        margin: 12px 0;
    }
    
    .tip-examples li,
    .tip-usage li {
        padding: 8px 10px;
        margin: 6px 0;
        font-size: 14px;
    }
    
    .tip-section h4 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .tip-examples h5,
    .tip-usage h5 {
        font-size: 15px;
        margin-bottom: 10px;
    }
}

/* TTS 스피커 아이콘 스타일 */
.tts-btn {
    transition: all 0.3s ease;
    display: inline-block;
    vertical-align: middle;
    -webkit-tap-highlight-color: transparent; /* iOS 터치 하이라이트 제거 */
    touch-action: manipulation; /* iOS 터치 최적화 */
    user-select: none; /* 텍스트 선택 방지 */
}

.tts-btn:hover {
    transform: scale(1.1);
    color: #FF5722 !important;
    text-shadow: 0 0 8px rgba(255, 87, 34, 0.4);
}

.tts-btn:active {
    transform: scale(0.95);
}

/* iOS 터치 최적화 */
@media (hover: none) and (pointer: coarse) {
    .tts-btn:hover {
        transform: none;
        color: #FF9800 !important;
        text-shadow: none;
    }
    
    .tts-btn:active {
        transform: scale(0.95);
        color: #FF5722 !important;
    }
}

/* 팁 내용에서 스피커 아이콘이 있는 리스트 아이템 스타일 */
.tip-usage li:has(.tts-btn),
.tip-examples li:has(.tts-btn) {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding-left: 8px;
}

.tip-usage li:has(.tts-btn) .tts-btn,
.tip-examples li:has(.tts-btn) .tts-btn {
    flex-shrink: 0;
    margin-top: 2px;
}

/* 스피커 아이콘 애니메이션 */
@keyframes ttsPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.tts-btn.playing {
    animation: ttsPulse 0.6s ease-in-out;
    color: #FF5722 !important;
}

/* iOS Safari 최적화 */
@supports (-webkit-touch-callout: none) {
    .tts-btn {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    .tip-usage li,
    .tip-examples li {
        -webkit-tap-highlight-color: transparent;
    }
}
