/* استایل‌های اختصاصی برای صفحات درسی */

/* عمومی */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
    color: white;
    padding: 60px 0;
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

/* صفحه دوره‌ها */
.hsk-progress {
    position: relative;
    margin: 50px auto;
    max-width: 900px;
}

.hsk-track {
    height: 4px;
    background: linear-gradient(to left, var(--success-color), #ffc107, var(--primary-color));
    position: absolute;
    top: 25px;
    right: 0;
    left: 0;
    z-index: 1;
}

.hsk-points {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.hsk-point {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.hsk-point:hover {
    transform: translateY(-5px);
}

.point-circle {
    width: 50px;
    height: 50px;
    background-color: white;
    border: 4px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 10px;
    transition: var(--transition);
}

.hsk-point.active .point-circle {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
}

.tab-headers {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.tab-header {
    padding: 12px 30px;
    background-color: #f0f0f0;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.tab-header.active {
    background-color: var(--primary-color);
    color: white;
}

.course-card-full {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--box-shadow);
    position: relative;
}

.course-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 8px 20px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-weight: 600;
}

.course-details {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}

.detail {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-color);
}

/* صفحه الفبا */
.pinyin-intro .intro-card {
    background-color: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 40px;
}

.example-box {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: var(--border-radius);
    margin: 20px 0;
    border-right: 4px solid var(--primary-color);
}

.chinese-example {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.character {
    font-family: var(--font-zh);
    font-size: 2.5rem;
}

.table-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.table-filter {
    padding: 10px 25px;
    background-color: #f0f0f0;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.table-filter.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-dark);
}

.pinyin-section {
    display: none;
}

.pinyin-section.active {
    display: block;
}

.initials-grid, .finals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.initial-card, .final-card {
    background-color: white;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.initial-card:hover, .final-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: var(--box-shadow);
}

.tones-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.tone-card {
    background-color: white;
    padding: 25px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--box-shadow);
}

.tone-marker {
    width: 60px;
    height: 40px;
    margin: 0 auto 15px;
    background-color: #f0f0f0;
    border-radius: 4px;
    position: relative;
}

.tone-marker.tone1::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 10px;
    left: 10px;
    height: 3px;
    background-color: var(--primary-color);
    transform: translateY(-50%);
}

.tone-marker.tone2::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    bottom: 10px;
    width: 3px;
    background-color: var(--primary-color);
    transform: skewX(-20deg);
}

/* تمرین تلفظ */
.practice-area {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.practice-card {
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.play-pinyin {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.tone-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tone-opt {
    padding: 10px 20px;
    background-color: #f0f0f0;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.tone-opt:hover {
    border-color: var(--primary-color);
}

.record-btn {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* کاراکترها */
.characters-filter {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.characters-filter input, .characters-filter select {
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-family: var(--font-fa);
    flex: 1;
    min-width: 200px;
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.character-card {
    background-color: white;
    padding: 25px;
    border-radius: var(--border-radius);
    border: 2px solid #e0e0e0;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.character-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
}

.character-card .chinese {
    font-family: var(--font-zh);
    font-size: 3rem;
    margin-bottom: 10px;
    display: block;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
}

.page-btn {
    padding: 10px 25px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
}

.page-numbers {
    display: flex;
    gap: 10px;
}

.page-num {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.page-num.active {
    background-color: var(--primary-color);
    color: white;
}

/* صفحه واژگان */
.search-box {
    position: relative;
    margin-bottom: 30px;
}

.search-box input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #ddd;
    border-radius: 50px;
    font-size: 1.1rem;
    font-family: var(--font-fa);
}

.search-btn {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-filters {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 600;
}

.filter-group select {
    padding: 8px 15px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-family: var(--font-fa);
}

.vocab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.view-options {
    display: flex;
    gap: 10px;
}

.view-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    background-color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.view-btn.active {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
}

/* فلش کارت */
.flashcard-container {
    max-width: 500px;
    margin: 0 auto;
}

.flashcard {
    width: 100%;
    height: 300px;
    perspective: 1000px;
    margin-bottom: 30px;
}

.flashcard-content {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-content {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--border-radius);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.flashcard-front {
    background-color: white;
    border: 2px solid var(--primary-color);
}

.flashcard-back {
    background-color: var(--primary-color);
    color: white;
    transform: rotateY(180deg);
}

.flip-btn {
    margin-top: 20px;
    padding: 10px 25px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
}

.flashcard-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 10px 20px;
    background-color: #f0f0f0;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.control-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.progress-bar {
    height: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

/* صفحه گرامر */
.grammar-toc .toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.toc-level {
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.toc-items {
    list-style: none;
    margin-top: 20px;
}

.toc-items li {
    margin-bottom: 15px;
    padding-right: 15px;
    border-right: 3px solid #f0f0f0;
    transition: var(--transition);
}

.toc-items li:hover {
    border-right-color: var(--primary-color);
}

.toc-items a {
    text-decoration: none;
    color: var(--dark-color);
    display: block;
    transition: var(--transition);
}

.toc-items a:hover {
    color: var(--primary-color);
    padding-right: 5px;
}

.grammar-lesson {
    background-color: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 40px;
}

.grammar-example {
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 20px 0;
}

.sentence-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.grammar-breakdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 15px 0;
    padding: 15px;
    background-color: white;
    border-radius: var(--border-radius);
}

.subject, .verb, .object {
    padding: 5px 15px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-weight: 600;
}

.connector {
    color: var(--gray-color);
}

pre[class*="language-"] {
    border-radius: var(--border-radius);
    margin: 20px 0;
    direction: ltr;
}

.practice-exercises {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.exercise {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.exercise-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.exercise-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.exercise-options label:hover {
    background-color: #e9ecef;
}

.check-answer {
    padding: 10px 25px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
}

/* رسپانسیو */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }
    
    .hsk-points {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }
    
    .hsk-track {
        display: none;
    }
    
    .course-details {
        flex-direction: column;
    }
    
    .table-controls {
        flex-direction: column;
    }
    
    .characters-filter {
        flex-direction: column;
    }
    
    .vocab-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }
    
    .search-filters {
        flex-direction: column;
    }
}