/* Chinese Subject - Color Variables */
:root {
    --chinese-primary: #C9184A;
    --chinese-secondary: #FF4D6D;
    --chinese-accent: #FF8FA3;
    --chinese-light: #FFF1F2;
    --chinese-dark: #590D22;
}

/* Hero Section Styling */
.subject-hero {
    background: linear-gradient(135deg, var(--chinese-light) 0%, rgba(255, 241, 242, 0.8) 100%);
    padding: var(--spacing-xxl) 0;
}

.subject-hero-content h1 {
    color: var(--chinese-dark);
}

.subject-hero-content .gradient-text {
    background: linear-gradient(90deg, var(--chinese-primary), var(--chinese-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subject-description {
    color: var(--text-light);
    max-width: 600px;
    margin-bottom: var(--spacing-lg);
}

.section-header .gradient-text {
    background: linear-gradient(90deg, var(--chinese-primary), var(--chinese-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Topics Section */
.topics-section {
    padding: 4rem 0;
    background-color: var(--bg-light);
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.topic-card {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    cursor: pointer;
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--chinese-primary) 0%, var(--chinese-secondary) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.topic-card:hover::before {
    opacity: 0.1;
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.topic-icon {
    width: 80px;
    height: 80px;
    background: var(--chinese-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    z-index: 2;
}

.topic-icon i {
    font-size: 2rem;
    color: var(--chinese-primary);
    transition: all 0.3s ease;
}

.topic-card:hover .topic-icon {
    transform: scale(1.1);
    background: var(--chinese-primary);
}

.topic-card:hover .topic-icon i {
    color: white;
}

.topic-card h3 {
    font-size: 1.5rem;
    color: var(--chinese-dark);
    margin-bottom: 1rem;
    z-index: 2;
    transition: all 0.3s ease;
}

.topic-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    z-index: 2;
    transition: all 0.3s ease;
}

.topic-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 3;
}

.topic-card:hover .topic-hover {
    opacity: 1;
    transform: translateY(0);
}

.topic-card:hover h3,
.topic-card:hover p {
    opacity: 0;
}

.topic-hover p {
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.topic-hover .btn {
    background: var(--chinese-primary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.topic-hover .btn:hover {
    background: var(--chinese-secondary);
    transform: translateY(-2px);
}

/* Animation for cards appearing */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.topic-card {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.topic-card:nth-child(1) { animation-delay: 0.1s; }
.topic-card:nth-child(2) { animation-delay: 0.2s; }
.topic-card:nth-child(3) { animation-delay: 0.3s; }
.topic-card:nth-child(4) { animation-delay: 0.4s; }
.topic-card:nth-child(5) { animation-delay: 0.5s; }
.topic-card:nth-child(6) { animation-delay: 0.6s; }

/* Responsive Design */
@media (max-width: 768px) {
    .topics-grid {
        grid-template-columns: 1fr;
    }
    
    .topic-card {
        height: auto;
        min-height: 250px;
    }
    
    .topic-icon {
        width: 60px;
        height: 60px;
    }
    
    .topic-icon i {
        font-size: 1.5rem;
    }
    
    .topic-card h3 {
        font-size: 1.3rem;
    }
}

/* AI Assistant Section */
.ai-assistant-section {
    background-color: var(--bg-color);
    padding: var(--spacing-xxl) 0;
}

.chat-header {
    background-color: var(--chinese-primary);
}

/* Dictionary Section */
.dictionary-section {
    padding: var(--spacing-xxl) 0;
}

.dictionary-container {
    background-color: var(--bg-color);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
}

.dictionary-search {
    margin-bottom: var(--spacing-lg);
}

.character-display {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bg-dark);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
}

/* Literature Section */
.literature-section {
    padding: var(--spacing-xxl) 0;
}

.literature-categories {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
}

.literature-category-btn {
    padding: 0.5rem 1rem;
    background-color: var(--bg-color);
    border: 1px solid var(--bg-dark);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

.literature-category-btn.active {
    background-color: var(--chinese-primary);
    color: white;
    border-color: var(--chinese-primary);
}

.literature-content {
    background-color: var(--bg-color);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
}

/* Poem Container */
.poem-container {
    background-color: white;
    border-radius: var(--border-radius-md);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    max-width: 800px;
    margin: 0 auto;
}

.poem-title {
    font-size: 1.75rem;
    margin-bottom: var(--spacing-sm);
    text-align: center;
    color: var(--chinese-dark);
}

.poem-author {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-lg);
    text-align: center;
    font-style: italic;
}

.poem-content {
    font-family: 'Noto Sans SC', sans-serif;
    line-height: 1.8;
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.poem-line {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.poem-analysis {
    background-color: var(--chinese-light);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-md);
    margin-top: var(--spacing-xl);
    border-left: 4px solid var(--chinese-primary);
}

.poem-analysis h4 {
    margin-bottom: var(--spacing-sm);
    color: var(--chinese-primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .literature-categories {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: var(--spacing-sm);
    }
    
    .poem-line {
        font-size: 1.1rem;
    }
}

/* Character and component animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.character-animation {
    animation: fadeIn 0.5s ease-in-out;
}

/* Custom button styles */
.btn-primary {
    background-color: var(--chinese-primary);
    border-color: var(--chinese-primary);
}

.btn-primary:hover {
    background-color: var(--chinese-dark);
    border-color: var(--chinese-dark);
}

/* Quiz section customization */
.quiz-section .btn-primary {
    background-color: var(--chinese-primary);
    border-color: var(--chinese-primary);
}

.quiz-option.selected {
    background-color: var(--chinese-secondary);
    border-color: var(--chinese-secondary);
}

/* Quiz Section Styles */
.quiz-section {
    padding: 3rem 0;
    background-color: var(--bg-light);
}

.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.quiz-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.quiz-actions {
    text-align: center;
    margin-bottom: 2rem;
}

/* Quiz Header */
.quiz-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.quiz-header h3 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.quiz-progress {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Quiz Question */
.quiz-question {
    background-color: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.quiz-question p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.quiz-options {
    display: grid;
    gap: 1rem;
}

.quiz-option {
    background-color: white;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-option:hover {
    background-color: var(--primary-color-light);
    border-color: var(--primary-color);
}

.quiz-option.selected {
    background-color: var(--primary-color-light);
    border-color: var(--primary-color);
}

.quiz-option.correct {
    background-color: var(--success-light);
    border-color: var(--success-color);
}

.quiz-option.incorrect {
    background-color: var(--error-light);
    border-color: var(--error-color);
}

/* Quiz Actions */
.quiz-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.quiz-actions button {
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.quiz-actions button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Quiz Feedback */
.quiz-feedback {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 8px;
    background-color: var(--bg-light);
}

.feedback-content {
    padding: 1rem;
    border-radius: 8px;
}

.feedback-content.correct {
    background-color: var(--success-light);
    border-left: 4px solid var(--success-color);
}

.feedback-content.incorrect {
    background-color: var(--error-light);
    border-left: 4px solid var(--error-color);
}

.feedback-content h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.feedback-content p {
    line-height: 1.6;
    color: var(--text-dark);
}

/* Quiz Results */
.quiz-results {
    text-align: center;
    padding: 2rem;
}

.result-summary {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: var(--bg-light);
    border-radius: 8px;
}

.score {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.grade {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.result-message {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: var(--bg-light);
    border-radius: 8px;
}

/* Learning Assessment */
.learning-assessment {
    margin-top: 2rem;
    padding: 2rem;
    background-color: var(--bg-light);
    border-radius: 8px;
}

.learning-assessment h4 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.assessment-content {
    text-align: left;
    line-height: 1.8;
}

.assessment-content p {
    margin-bottom: 1rem;
}

.assessment-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.assessment-content li {
    margin-bottom: 0.5rem;
}

/* Markdown Formatting */
.assessment-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

.assessment-content em {
    font-style: italic;
    color: var(--text-muted);
}

.assessment-content code {
    background-color: var(--bg-dark);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
}

.assessment-content pre {
    background-color: var(--bg-dark);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

.assessment-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
    .quiz-container {
        padding: 1.5rem;
    }

    .quiz-controls {
        grid-template-columns: 1fr;
    }

    .quiz-actions {
        flex-direction: column;
    }

    .quiz-actions button {
        width: 100%;
    }

    .quiz-question p {
        font-size: 1.1rem;
    }

    .result-summary {
        padding: 1rem;
    }

    .score {
        font-size: 1.8rem;
    }

    .grade {
        font-size: 1.3rem;
    }
}

/* Loading Animation */
.loading p::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
} 