/**
 * 문법 학습 스타일 - 호주장터 주황색 테마
 */

/* 문법 레슨 카드 */
.grammar-lesson-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(255, 107, 0, 0.1);
    border-left: 4px solid #ff6b00;
    transition: all 0.3s ease;
    cursor: pointer;
}

.grammar-lesson-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(255, 107, 0, 0.2);
    border-left-width: 6px;
}

.grammar-lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.grammar-lesson-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.grammar-lesson-title-ko {
    font-size: 1rem;
    color: #666;
    margin-top: 5px;
}

.grammar-level-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.grammar-level-badge.beginner {
    background: linear-gradient(135deg, #ffd89b 0%, #ff6b00 100%);
    color: white;
}

.grammar-level-badge.intermediate {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b00 100%);
    color: white;
}

.grammar-level-badge.advanced {
    background: linear-gradient(135deg, #ff6b00 0%, #d45500 100%);
    color: white;
}

.grammar-lesson-preview {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.grammar-lesson-examples {
    background: linear-gradient(135deg, #fff5eb 0%, #ffe8d6 100%);
    border-left: 4px solid #ff6b00;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
}

.grammar-example {
    margin-bottom: 10px;
}

.grammar-example:last-child {
    margin-bottom: 0;
}

.grammar-example-en {
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.grammar-example-ko {
    color: #666;
    font-size: 0.9rem;
}

/* 문법 상세 모달 */
.grammar-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.grammar-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideIn 0.3s;
}

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

.grammar-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.grammar-modal-close:hover,
.grammar-modal-close:focus {
    color: #000;
}

.grammar-detail-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.grammar-detail-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.grammar-detail-title-ko {
    font-size: 1.3rem;
    color: #666;
}

.grammar-section {
    margin-bottom: 30px;
}

.grammar-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ff6b00;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.grammar-section-title i {
    font-size: 1.5rem;
}

.grammar-explanation {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    line-height: 1.8;
    margin-bottom: 15px;
}

.grammar-explanation-en {
    color: #333;
    margin-bottom: 10px;
}

.grammar-explanation-ko {
    color: #666;
}

.grammar-tips {
    background: linear-gradient(135deg, #ff6b00 0%, #ff9a56 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
}

.grammar-tips-title {
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 흔한 실수 */
.grammar-mistakes {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 20px;
    border-radius: 10px;
}

.grammar-mistake-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.grammar-mistake-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.grammar-mistake-wrong {
    color: #dc3545;
    text-decoration: line-through;
    margin-bottom: 5px;
}

.grammar-mistake-correct {
    color: #28a745;
    font-weight: 600;
    margin-bottom: 5px;
}

.grammar-mistake-explanation {
    color: #666;
    font-size: 0.9rem;
}

/* 연습 문제 */
.grammar-practice {
    background: #e7f3ff;
    padding: 20px;
    border-radius: 10px;
}

.grammar-practice-question {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.grammar-practice-question:last-child {
    margin-bottom: 0;
}

.grammar-practice-text {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 15px;
}

.grammar-practice-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.grammar-practice-option {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.grammar-practice-option:hover {
    background: #fff5eb;
    border-color: #ff6b00;
    transform: scale(1.02);
}

.grammar-practice-option.correct {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.grammar-practice-option.wrong {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.grammar-practice-answer {
    margin-top: 15px;
    padding: 15px;
    background: #d4edda;
    border-radius: 8px;
    color: #155724;
    display: none;
}

.grammar-practice-answer.show {
    display: block;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .grammar-lesson-card {
        padding: 20px 15px;
        margin-bottom: 15px;
    }
    
    .grammar-lesson-title {
        font-size: 1.1rem;
    }
    
    .grammar-lesson-title-ko {
        font-size: 0.9rem;
    }
    
    .grammar-modal {
        padding: 10px;
    }
    
    .grammar-modal-content {
        width: 100%;
        margin: 5% auto;
        padding: 20px 15px;
        max-height: 90vh;
        border-radius: 15px;
    }
    
    .grammar-detail-title {
        font-size: 1.4rem;
    }
    
    .grammar-detail-title-ko {
        font-size: 1.1rem;
    }
    
    .grammar-section-title {
        font-size: 1.1rem;
    }
    
    .grammar-explanation,
    .grammar-tips,
    .grammar-mistakes,
    .grammar-practice {
        padding: 15px;
    }
    
    .grammar-practice-options {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .grammar-practice-option {
        padding: 15px 12px;
        font-size: 0.95rem;
    }
    
    .grammar-example-en {
        font-size: 0.95rem;
    }
    
    .grammar-example-ko {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .grammar-lesson-card {
        padding: 15px 12px;
    }
    
    .grammar-lesson-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .grammar-modal-content {
        padding: 15px 12px;
    }
    
    .grammar-detail-title {
        font-size: 1.2rem;
    }
    
    .grammar-section-title {
        font-size: 1rem;
    }
}


/* 학습 통계 카드 */
.grammar-stats {
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #fff5eb 0%, #ffe8d6 100%);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    border-left: 4px solid #ff6b00;
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.1);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ff6b00;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

/* 북마크 버튼 */
.grammar-bookmark-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #ccc;
    transition: all 0.3s ease;
    z-index: 10;
}

.grammar-bookmark-btn:hover {
    color: #ff6b00;
    transform: scale(1.2);
}

.grammar-bookmark-btn.bookmarked {
    color: #ff6b00;
}

/* 진도 표시 */
.grammar-progress-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #28a745;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.grammar-lesson-card {
    position: relative;
}

/* 퀴즈 모드 버튼 */
.grammar-quiz-mode-btn {
    background: linear-gradient(135deg, #ff6b00 0%, #ff9a56 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
    transition: all 0.3s ease;
}

.grammar-quiz-mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.4);
}

/* 카테고리 필터 스타일 개선 */
#grammarCategoryFilter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

#grammarCategoryFilter .filter-btn {
    flex: 0 0 auto;
    padding: 8px 16px;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* 레벨 필터와 카테고리 필터 간격 */
#grammarLevelFilter {
    margin-bottom: 15px;
}

#grammarLevelFilter .filter-btn {
    min-width: 70px;
}

/* 모바일 최적화 - 통계 */
@media (max-width: 768px) {
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .stat-card {
        padding: 12px 8px;
    }
    
    #grammarCategoryFilter .filter-btn {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .stat-number {
        font-size: 1.3rem;
    }
    
    .grammar-bookmark-btn {
        font-size: 1.2rem;
        top: 15px;
        right: 15px;
    }
}
