/* Listening Practice Dashboard Styles - Unified Theme */
:root {
    /* Unified color palette - matching index.html */
    --primary-color: #ED1C24; /* Main red color from index.html */
    --primary-light: #ff4757; /* Lighter red */
    --primary-dark: #c41e3a; /* Darker red for gradients */
    --secondary-color: #266EA3; /* Blue from index.html */
    --accent-color: #009838; /* Green from index.html */
    --text-color: #333333; /* Text color from index.html */
    --text-secondary: #666666; /* Secondary text from index.html */
    --bg-light: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --border-color: #E0E0E0;
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Listening Practice Dashboard Styles */

/* Filter Section */
.listening-filter-section .card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.listening-filter-section .card-header {
    background: linear-gradient(135deg, #ED1C24 0%, #C41230 100%);
    border: none;
    padding: 1rem 1.5rem;
}

.listening-filter-section .card-body {
    padding: 1.5rem;
}

.listening-filter-section .form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.listening-filter-section .form-select {
    border-radius: 12px;
    border: 2px solid #e0e7ef;
    background: #fff;
    font-size: 1.08rem;
    font-weight: 500;
    color: #222;
    padding: 0.75rem 1.2rem;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.06);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-select:focus {
    border-color: #ED1C24;
    box-shadow: 0 0 0 2px rgba(237, 28, 36, 0.2);
    outline: none;
}

.form-select option {
    font-size: 1.05rem;
    color: #222;
    background: #fff;
}

/* Choices.js Custom Styling */
.custom-choices .choices__inner {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem;
    background-color: #fff;
    min-height: auto;
}

.custom-choices .choices__list--single {
    padding: 0;
}

.custom-choices .choices__item--selectable {
    padding-right: 0;
}

.custom-choices .choices__list--dropdown {
    border: 2px solid #ED1C24;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(237, 28, 36, 0.15);
}

.custom-choices .choices__item--selectable.is-highlighted {
    background-color: #ED1C24;
    color: white;
}

/* Lessons Section */
.listening-lessons-section .card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.listening-lessons-section .card-header {
    background: linear-gradient(135deg, #266EA3 0%, #1E5A8A 100%);
    border: none;
    padding: 1rem 1.5rem;
}

.listening-lessons-section .card-body {
    padding: 1.5rem;
}

/* Lesson Cards - Improved for Listening Practice */
.lesson-card {
    border: none;
    border-radius: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #fff;
    height: 100%;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(237, 28, 36, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.lesson-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ED1C24, #266EA3, #009838);
    border-radius: 16px 16px 0 0;
}

.lesson-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(237, 28, 36, 0.3);
}

.lesson-card .card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.lesson-card .card-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    color: #1a1a1a;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.lesson-card .badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 400;
}

.lesson-card .lesson-meta {
    font-size: 0.85rem;
    color: #266EA3;
    font-weight: 600;
    font-style: normal;
    text-shadow: 0 1px 2px rgba(38, 110, 163, 0.1);
}

.lesson-card .lesson-level {
    display: flex;
    align-items: center;
}

.lesson-card .lesson-level .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    background: linear-gradient(135deg, #ED1C24 0%, #C41230 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(237, 28, 36, 0.3);
}

.lesson-card .lesson-level .badge i {
    font-size: 0.7rem;
}

.lesson-card .btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
    background: linear-gradient(135deg, #266EA3 0%, #1E5A8A 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(38, 110, 163, 0.3);
}

.lesson-card .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(38, 110, 163, 0.4);
    background: linear-gradient(135deg, #1E5A8A 0%, #266EA3 100%);
}

.lesson-card .btn:active {
    transform: translateY(0);
}

/* Pagination Styles */
.pagination {
    gap: 0.25rem;
}

.pagination .page-link {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #ED1C24 0%, #C41230 100%);
    border-color: #ED1C24;
    color: white;
}

.pagination .page-item.disabled .page-link {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
}

.pagination-info {
    font-size: 0.9rem;
    color: #6c757d;
}

/* Fixed Pagination Container */
.pagination-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #dee2e6;
    padding: 1rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.pagination-container .d-flex {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
}

/* Add bottom padding to lesson list to prevent overlap with fixed pagination */
.lesson-list-container {
    padding-bottom: 80px;
}

/* Responsive adjustments for fixed pagination */
@media (max-width: 768px) {
    .pagination-container {
        padding: 0.75rem;
    }

    .pagination-container .d-flex {
        padding: 0 0.75rem;
        gap: 0.75rem;
    }

    .pagination-info {
        font-size: 0.8rem;
    }

    .pagination .page-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .pagination-container {
        padding: 0.5rem;
    }

    .pagination-container .d-flex {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .pagination-info {
        order: 2;
        text-align: left;
    }

    .pagination {
        order: 1;
    }
}

/* Empty State - Improved for Listening */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    margin: 2rem 0;
}

.empty-state i {
    color: #dee2e6;
    margin-bottom: 1.5rem;
    font-size: 4rem;
}

.empty-state h5 {
    color: #6c757d;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.empty-state p {
    color: #adb5bd;
    margin-bottom: 0;
    font-size: 1rem;
}

/* Loading State - Improved */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-text {
    color: #6c757d;
    font-weight: 500;
    margin: 0;
}

/* Practice Panel */
.listening-practice-panel .card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.listening-practice-panel .card-header {
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
    border: none;
    padding: 1rem 1.5rem;
}

.listening-practice-panel .btn-light {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.listening-practice-panel .btn-light:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}

/* Loading States */
.listening-practice-container.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Keyboard Shortcuts Note */
.keyboard-shortcuts-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.shortcuts-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    color: #495057;
    font-weight: 600;
    font-size: 0.9rem;
}

.shortcuts-header i {
    margin-right: 0.5rem;
    color: #6c757d;
}

.shortcuts-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.shortcut-item kbd {
    background: #343a40;
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    min-width: 2.5rem;
    text-align: center;
}

.shortcut-item span {
    flex: 1;
}

/* Practice Keyboard Shortcuts Note */
.practice-keyboard-shortcuts {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 8px;
    border: 1px solid #90caf9;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.practice-keyboard-shortcuts .shortcuts-header {
    display: flex;
    align-items: center;
    color: #1976d2;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0;
}

.practice-keyboard-shortcuts .shortcuts-header i {
    margin-right: 0.5rem;
    color: #1976d2;
}

.practice-keyboard-shortcuts .shortcuts-content {
    display: flex;
    gap: 1.5rem;
    margin: 0;
}

.practice-keyboard-shortcuts .shortcut-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #424242;
    margin: 0;
}

.practice-keyboard-shortcuts .shortcut-item kbd {
    background: #1976d2;
    color: #fff;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    min-width: 2rem;
    text-align: center;
}

/* Practice Completion Styles */
.practice-completion-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 0;
}

.completion-header-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.completion-icon-large {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #ffd700;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
}

.completion-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.completion-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin: 0;
}

.completion-stats-section {
    margin-bottom: 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stats-grid .stat-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    overflow: hidden;
}

.stats-grid .stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.stats-grid .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.stats-grid .stat-icon-questions {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stats-grid .stat-icon-correct {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.stats-grid .stat-icon-time {
    background: linear-gradient(135deg, #fd7e14 0%, #ffc107 100%);
}

.stats-grid .stat-content {
    width: 100%;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stats-grid .stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.stats-grid .stat-content p {
    color: #6c757d;
    font-weight: 500;
    margin: 0;
    line-height: 1.4;
}

.challenge-history-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.challenge-history-list {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.challenge-history-scrollable {
    max-height: 400px;
    overflow-y: auto;
}

.challenge-history-scrollable::-webkit-scrollbar {
    width: 8px;
}

.challenge-history-scrollable::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.challenge-history-scrollable::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.challenge-history-scrollable::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.challenge-history-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s ease;
}

.challenge-history-item:last-child {
    border-bottom: none;
}

.challenge-history-item:hover {
    background-color: #f8f9fa;
}

.challenge-history-item.correct {
    border-left: 4px solid #28a745;
}

.challenge-history-item.incorrect {
    border-left: 4px solid #dc3545;
}

.challenge-number {
    margin-right: 1rem;
}

.challenge-content {
    flex: 1;
    margin-right: 1rem;
}

.challenge-text {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.challenge-answer {
    font-size: 0.9rem;
}

.user-answer-text {
    font-weight: 500;
    color: #495057;
    font-style: italic;
}

.challenge-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.challenge-status i {
    font-size: 1.2rem;
}

.completion-actions-section {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-buttons .btn {
    min-width: 180px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.action-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .listening-filter-section .card-body {
        padding: 1rem;
    }

    .listening-filter-section .row {
        margin: 0 -0.5rem;
    }

    .listening-filter-section .col-md-3 {
        padding: 0 0.5rem;
        margin-bottom: 1rem;
    }

    .listening-lessons-section .card-body {
        padding: 1rem;
    }

    .lesson-card {
        margin-bottom: 1rem;
    }

    .lesson-card .card-body {
        padding: 1rem;
    }

    .keyboard-shortcuts-note {
        margin-top: 1rem;
        padding: 0.75rem;
    }

    .shortcuts-content {
        gap: 0.4rem;
    }

    .shortcut-item {
        font-size: 0.8rem;
        gap: 0.5rem;
    }

    .shortcut-item kbd {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
        min-width: 2rem;
    }

    .practice-keyboard-shortcuts {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.5rem 0.75rem;
    }

    .practice-keyboard-shortcuts .shortcuts-content {
        gap: 1rem;
    }

    .practice-keyboard-shortcuts .shortcut-item {
        font-size: 0.8rem;
        gap: 0.4rem;
    }

    .practice-keyboard-shortcuts .shortcut-item kbd {
        padding: 0.15rem 0.3rem;
        font-size: 0.65rem;
        min-width: 1.8rem;
    }
}

@media (max-width: 576px) {
    .listening-filter-section .card-header,
    .listening-lessons-section .card-header,
    .listening-practice-panel .card-header {
        padding: 0.75rem 1rem;
    }

    .listening-filter-section .col-md-3 {
        padding: 0 0.25rem;
        margin-bottom: 0.75rem;
    }

    .listening-filter-section .card-header h5,
    .listening-lessons-section .card-header h5,
    .listening-practice-panel .card-header h5 {
        font-size: 1rem;
    }

    .lesson-card .card-title {
        font-size: 0.9rem;
    }

    .lesson-card .btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .practice-keyboard-shortcuts {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .practice-keyboard-shortcuts .shortcuts-header {
        font-size: 0.8rem;
    }

    .practice-keyboard-shortcuts .shortcuts-content {
        gap: 0.75rem;
    }

    .practice-keyboard-shortcuts .shortcut-item {
        font-size: 0.75rem;
    }

    /* Completion responsive */
    .completion-title {
        font-size: 2rem;
    }

    .completion-subtitle {
        font-size: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stats-grid .stat-card {
        padding: 1rem;
        min-height: 150px;
    }

    .stats-grid .stat-content h3 {
        font-size: 1.5rem;
    }

    .challenge-history-scrollable {
        max-height: 250px;
    }

    .action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .action-buttons .btn {
        min-width: 200px;
        width: 100%;
        max-width: 300px;
    }
}

/* Animation Effects */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lesson-card {
    animation: fadeInUp 0.6s ease-out;
}

.lesson-card:nth-child(1) {
    animation-delay: 0.1s;
}

.lesson-card:nth-child(2) {
    animation-delay: 0.2s;
}

.lesson-card:nth-child(3) {
    animation-delay: 0.3s;
}

.lesson-card:nth-child(4) {
    animation-delay: 0.4s;
}

.lesson-card:nth-child(5) {
    animation-delay: 0.5s;
}

.lesson-card:nth-child(6) {
    animation-delay: 0.6s;
}

/* Hover Effects */
.hover-shadow {
    transition: box-shadow 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Custom Scrollbar for Choices.js */
.choices__list--dropdown .choices__list::-webkit-scrollbar {
    width: 6px;
}

.choices__list--dropdown .choices__list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.choices__list--dropdown .choices__list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.choices__list--dropdown .choices__list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Focus States */
.listening-filter-section .form-select:focus,
.custom-choices.is-focused .choices__inner {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Success/Error States */
.lesson-card.success {
    border-left: 4px solid #28a745;
}

.lesson-card.error {
    border-left: 4px solid #dc3545;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .lesson-card,
    .lesson-card:hover,
    .listening-filter-section .form-select,
    .custom-choices .choices__inner {
        transition: none;
    }

    .lesson-card {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .lesson-card {
        border: 2px solid #000;
    }

    .listening-filter-section .card,
    .listening-lessons-section .card {
        border: 2px solid #000;
    }
}

/* Practice Interface */
.practice-interface {
    max-width: 1200px;
    margin: 0 auto;
}

.practice-header .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.audio-player-section .card-header {
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
}

.practice-content .card-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

/* Audio Player Styling */
#lessonAudio {
    border-radius: 8px;
    background: #f8f9fa;
}

.audio-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.audio-controls .btn {
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.audio-controls .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.audio-speed-row {
    align-items: center !important;
}

.audio-speed-dropdown {
    display: flex;
    align-items: center;
    margin-left: 12px;
    height: 100%;
    align-self: center;
}

.audio-speed-dropdown label {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0;
    margin-right: 4px;
    align-self: center;
}

.audio-speed-dropdown select {
    min-width: 80px;
    max-width: 110px;
    font-size: 1rem;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1.5px solid #e9ecef;
    background: #f8f9fa;
    margin-left: 2px;
    height: 38px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.btn-lg {
    font-size: 1.15rem;
    padding: 0.75rem 2rem;
    border-radius: 8px;
}

.px-4 {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

.btn-outline-primary {
    color: #2563eb;
    border-color: #2563eb;
    background: #fff;
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.badge.bg-success {
    font-size: 1rem;
    padding: 0.5em 1em;
    border-radius: 0.5em;
}

@media (max-width: 600px) {
    .audio-speed-dropdown {
        margin-left: 0;
        margin-top: 8px;
    }

    .audio-speed-dropdown select {
        height: 34px;
        font-size: 0.95rem;
    }
}

/* Practice Content */
.practice-content .card-body {
    min-height: 300px;
}

.practice-content .btn-primary {
    border-radius: 25px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.practice-content .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* Practice Questions */
#practiceQuestions {
    margin-top: 2rem;
}

/* Responsive Design for Practice Interface */
@media (max-width: 768px) {
    .practice-interface {
        margin: 0 1rem;
    }

    .audio-controls {
        flex-direction: column;
        align-items: center;
    }

    .audio-controls .btn {
        width: 100%;
        max-width: 200px;
    }

    .practice-content .btn-primary {
        padding: 0.6rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .practice-header .card-header,
    .audio-player-section .card-header,
    .practice-content .card-header {
        padding: 0.75rem 1rem;
    }

    .practice-header h5,
    .audio-player-section h6,
    .practice-content h6 {
        font-size: 1rem;
    }
}

/* Practice Interface Customization */
.practice-interface {
    max-width: 900px;
    margin: 0 auto;
}

.practice-interface .row {
    margin-left: 0;
    margin-right: 0;
}

#challengeAudio {
    width: 100%;
    max-width: 320px;
    margin-bottom: 0.5rem;
    display: block;
}

.practice-question {
    margin-top: 1.5rem;
}

.practice-question input[type="text"] {
    font-size: 1.1rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
}

.practice-question .btn {
    min-width: 110px;
}

.explanation-box {
    min-height: 120px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-top: 5.5rem;
    word-break: break-word;
}

@media (max-width: 900px) {
    .practice-interface {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .practice-interface .col-md-6, .practice-interface .col-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .explanation-box {
        margin-top: 1rem;
    }
}

#answerFeedback {
    min-height: 32px;
    font-size: 1rem;
}

.reveal-correct {
    color: #22c55e;
    font-weight: bold;
    background: #e7fbe9;
    border-radius: 4px;
    padding: 0 2px;
}

.reveal-mask {
    color: #b0b0b0;
    font-family: 'Fira Mono', 'Consolas', monospace;
    background: #f3f3f3;
    border-radius: 4px;
    padding: 0 2px;
}

.btn-show-solution {
    border-radius: 20px;
    background: #f3f4f6;
    color: #2563eb;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 2px 14px 2px 10px;
    box-shadow: none;
    border: 1px solid #e5e7eb;
    transition: background 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
}

.btn-show-solution:hover,
.btn-show-solution:focus {
    background: #e5e7eb;
    color: #2563eb;
    border-color: #d1d5db;
}

.btn-show-solution i {
    margin-right: 4px;
}

.answer-box {
    background: #f0f6ff;
    border: 1.5px solid #2563eb;
    border-radius: 12px;
    color: #2563eb;
    font-weight: 500;
    padding: 14px 18px;
    margin-top: 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    font-size: 1.08rem;
}

.answer-box .answer-label {
    font-weight: bold;
    margin-right: 8px;
}

.answer-box .answer-text {
    font-weight: 500;
}

.answer-box i {
    font-size: 1.2em;
    margin-right: 8px;
    color: #2563eb;
}

.btn-gradient-back {
    background: linear-gradient(90deg, #2563eb 0%, #7c3aed 100%);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.5rem 1.2rem;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.08);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.btn-gradient-back:hover, .btn-gradient-back:focus {
    background: linear-gradient(90deg, #7c3aed 0%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 6px 24px rgba(44, 62, 80, 0.13);
}

/* Fix Choices.js dropdown hiển thị nổi bật */
.custom-choices .choices__list--dropdown,
.custom-choices .choices__list[role="listbox"] {
    background: #fff !important;
    color: #222 !important;
    z-index: 9999 !important;
    border: 1.5px solid #2563eb !important;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.13);
}

.custom-choices .choices__item--selectable {
    color: #222 !important;
    background: #fff !important;
}

.custom-choices .choices__item--selectable.is-highlighted {
    background: #2563eb !important;
    color: #fff !important;
}

.auto-grow-input {
    min-height: 48px;
    max-height: 280px;
    border-radius: 12px;
    font-size: 1.12rem;
    font-weight: 500;
    padding: 0.85rem 1.2rem;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.06);
    background: #fff;
    color: #222;
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow-x: hidden;
    resize: vertical;
}

.auto-grow-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px #2563eb33;
    outline: none;
}

.show-solution-row {
    margin-top: 12px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

@media (max-width: 600px) {
    .show-solution-row {
        justify-content: center;
    }

    /* Completion responsive for very small screens */
    .completion-header-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .completion-icon-large {
        font-size: 2.5rem;
    }

    .completion-title {
        font-size: 1.5rem;
    }

    .completion-subtitle {
        font-size: 0.8rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .stats-grid .stat-card {
        padding: 0.5rem;
        min-height: 120px;
    }

    .stats-grid .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .stats-grid .stat-content h3 {
        font-size: 1.1rem;
    }

    .challenge-history-item {
        padding: 0.5rem 0.75rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .challenge-number {
        margin-right: 0;
    }

    .challenge-content {
        margin-right: 0;
        width: 100%;
    }

    .challenge-status {
        align-self: flex-end;
    }

    .completion-actions-section {
        padding: 1rem;
    }

    .action-buttons .btn {
        min-width: 120px;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Lesson List Panel */
.lesson-list-panel {
    padding: 2rem 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.lesson-list-header {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.lesson-list-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.lesson-list-header .lesson-info h2 {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.lesson-list-header .lesson-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lesson-list-header .lesson-type {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.lesson-list-header .btn-back {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    padding: 0.5rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.lesson-list-header .btn-back:hover {
    background: #e9ecef;
    color: #495057;
    transform: translateY(-2px);
}

/* Filter Section */
.filter-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
}

.filter-section .form-group {
    margin-bottom: 0;
}

.filter-section .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-section .form-label i {
    color: #667eea;
}

.filter-section .form-select {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.filter-section .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.info-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-weight: 500;
}

.info-item i {
    color: white;
}

/* Lesson List Container */
.lesson-list-container {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Responsive improvements for lesson list */
@media (max-width: 768px) {
    .lesson-list-panel {
        padding: 1rem 0;
    }

    .lesson-list-header {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .lesson-list-header .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .lesson-list-header .btn-back {
        align-self: flex-end;
    }

    .filter-section {
        padding: 1rem;
    }

    .filter-section .row {
        gap: 1rem;
    }

    .lesson-list-container {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .lesson-list-header {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .lesson-list-header .lesson-info h2 {
        font-size: 1.5rem;
    }

    .filter-section {
        padding: 0.75rem;
    }

    .lesson-list-container {
        padding: 1rem;
    }

    .info-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Mobile optimization for practice interface */
@media (max-width: 576px) {
    .practice-interface {
        padding: 0.5rem !important;
    }

    .practice-interface .container-fluid {
        max-width: 100% !important;
        padding: 0 0.5rem !important;
    }

    .practice-keyboard-shortcuts {
        display: none !important;
    }

    /* Audio controls optimization */
    .audio-speed-row {
        flex-direction: row !important;
        gap: 0.5rem !important;
        align-items: center !important;
    }

    #challengeAudio {
        width: 100% !important;
        max-width: 366px !important;
        height: 40px !important;
    }

    .audio-speed-dropdown {
        width: auto !important;
        text-align: center !important;
    }

    .audio-speed-dropdown select {
        width: 110px !important;
        max-width: 110px !important;
        margin: 0 auto !important;
        font-size: 0.8rem !important;
        padding: 0.3rem !important;
        height: 36px !important;
    }

    /* Practice question optimization */
    .practice-question {
        margin-top: 0.5rem !important;
    }

    .practice-question textarea {
        font-size: 0.85rem !important;
        padding: 0.5rem !important;
        min-height: 50px !important;
        max-height: 80px !important;
    }

    .practice-question .btn {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.8rem !important;
        margin: 0.2rem !important;
        height: 36px !important;
    }

    .practice-question .d-flex {
        flex-direction: row !important;
        gap: 0.5rem !important;
        justify-content: space-between !important;
    }

    .practice-question .d-flex .btn {
        width: 48% !important;
        flex: 1 !important;
    }

    /* Explanation box optimization */
    .explanation-box {
        font-size: 0.8rem !important;
        padding: 0.5rem !important;
        margin-top: 0.5rem !important;
    }

    /* Badge optimization */
    .badge {
        font-size: 0.65rem !important;
        padding: 0.25rem 0.5rem !important;
    }

    /* Back button optimization */
    #listeningBackBtn {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.8rem !important;
        margin-bottom: 0.5rem !important;
        height: 36px !important;
    }

    /* Lesson title optimization */
    .fw-bold {
        font-size: 0.9rem !important;
    }

    /* Row optimization */
    .row.g-3 {
        gap: 0.3rem !important;
    }

    /* Container optimization */
    .container-fluid {
        padding-left: 0.3rem !important;
        padding-right: 0.3rem !important;
    }

    /* Additional mobile optimizations */
    .mb-2 {
        margin-bottom: 0.5rem !important;
    }

    .mb-3 {
        margin-bottom: 8px !important;
    }

    .mt-3 {
        margin-top: 0.75rem !important;
    }

    .gap-2 {
        gap: 0.5rem !important;
    }

    .gap-3 {
        gap: 0.75rem !important;
    }

    /* Reduce spacing between elements */
    .d-flex.align-items-center.mb-2 {
        margin-bottom: 0.3rem !important;
    }

    .d-flex.align-items-center.gap-3.mb-2 {
        margin-bottom: 0.3rem !important;
    }

    /* Optimize practice interface padding */
    .practice-interface {
        padding: 0.3rem !important;
    }

    .practice-interface .container-fluid {
        padding: 0 0.3rem !important;
    }

    /* Answer box optimization for mobile */
    .answer-box {
        font-size: 0.8rem !important;
        padding: 0.5rem !important;
    }

    .answer-box .answer-label {
        font-size: 0.75rem !important;
        font-weight: 600 !important;
    }

    .answer-box .answer-text {
        font-size: 0.8rem !important;
        line-height: 1.3 !important;
    }

    .answer-box i {
        font-size: 0.7rem !important;
    }

    /* Answer feedback optimization */
    #answerFeedback {
        font-size: 0.8rem !important;
    }

    #answerFeedback .text-danger,
    #answerFeedback .text-success {
        font-size: 0.8rem !important;
    }
}

/* Practice Tracking Styles */
.practice-tracking {
    border-top: 1px solid #e9ecef;
    padding-top: 0.75rem;
}

.practice-tracking .practice-count,
.practice-tracking .last-practice,
.practice-tracking .practice-status {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
}

.practice-tracking .practice-count i,
.practice-tracking .last-practice i,
.practice-tracking .practice-status i {
    width: 16px;
    text-align: center;
}

.practice-tracking .practice-count {
    margin-bottom: 0.25rem;
}

.practice-tracking .practice-count small {
    font-weight: 500;
}

.practice-tracking .last-practice small {
    color: #6c757d;
}

.practice-tracking .practice-status small {
    color: #fd7e14;
    font-weight: 500;
}

/* Enhanced lesson card styles */
.lesson-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.lesson-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.lesson-card .card-body {
    padding: 1.25rem;
}

.lesson-card .lesson-header {
    border-bottom: 1px solid #f8f9fa;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.lesson-card .lesson-level {
    margin-bottom: 0.5rem;
}

.lesson-card .lesson-meta {
    border-top: 1px solid #f8f9fa;
    padding-top: 0.5rem;
    margin-top: auto;
}

.lesson-card .lesson-actions {
    margin-top: 0.75rem;
}

.lesson-card .start-lesson-btn {
    width: 100%;
    font-weight: 500;
    padding: 0.625rem 0.875rem;
}

/* Practice count badge styles */
.practice-count-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.practice-count-badge i {
    margin-right: 0.25rem;
    font-size: 0.7rem;
}

/* Last practice date styles */
.last-practice-date {
    display: inline-flex;
    align-items: center;
    background: #f8f9fa;
    color: #6c757d;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.last-practice-date i {
    margin-right: 0.25rem;
    font-size: 0.7rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .practice-tracking {
        padding-top: 0.5rem;
    }

    .practice-tracking .practice-count,
    .practice-tracking .last-practice,
    .practice-tracking .practice-status {
        font-size: 0.8rem;
    }

    .lesson-card .card-body {
        padding: 1rem;
    }

    .lesson-card .lesson-header {
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .lesson-card .lesson-level {
        margin-bottom: 0.5rem;
    }

    .lesson-card .lesson-meta {
        padding-top: 0.5rem;
    }

    .lesson-card .lesson-actions {
        margin-top: 0.75rem;
    }

    .lesson-card .start-lesson-btn {
        padding: 0.625rem 0.875rem;
        font-size: 0.9rem;
    }
}

/* Animation for practice tracking */
.practice-tracking {
    animation: fadeInUp 0.3s ease-out;
}

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

/* Hover effects for practice tracking */
.practice-tracking:hover {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 0.75rem;
    margin: -0.75rem;
    margin-top: 0.75rem;
}

/* Practice status indicators */
.practice-status-new {
    color: #fd7e14;
}

.practice-status-in-progress {
    color: #007bff;
}

.practice-status-completed {
    color: #28a745;
}

/* Enhanced lesson card with practice tracking */
.lesson-card.has-practice {
    border-left: 4px solid #28a745;
}

.lesson-card.no-practice {
    border-left: 4px solid #fd7e14;
}

.lesson-card.has-practice .practice-tracking {
    background: linear-gradient(135deg, #f8fff9, #e8f5e8);
    border-radius: 6px;
    padding: 0.75rem;
    margin: 0.75rem -0.75rem 0.75rem -0.75rem;
    margin-bottom: 0px !important;
    margin-top: 0px !important;
}

.lesson-card.no-practice .practice-tracking {
    background: linear-gradient(135deg, #fff8f0, #ffe8d1);
    border-radius: 6px;
    padding: 0.75rem;
    margin: 0.75rem -0.75rem 0.75rem -0.75rem;
}

.lesson-header span {
    font-size: 12px !important;
}

.card-title {
    font-size: 16px !important;
}

/* Enhanced lesson card styles for 4 cards per row */
.lesson-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    min-height: 220px; /* Reduced height for more compact cards */
}

.lesson-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.lesson-card .card-body {
    padding: 0.875rem; /* Further reduced padding for more compact cards */
    display: flex;
    flex-direction: column;
    height: 100%;
}

.lesson-card .lesson-header {
    border-bottom: 1px solid #f8f9fa;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.lesson-card .lesson-header h6 {
    font-size: 0.9rem; /* Smaller font size for 4 cards layout */
    line-height: 1.2;
    margin-bottom: 0;
}

.lesson-card .lesson-level {
    margin-bottom: 0.5rem;
}

.lesson-card .lesson-level .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.lesson-card .lesson-meta {
    border-top: 1px solid #f8f9fa;
    padding-top: 0.5rem;
    margin-top: auto;
}

.lesson-card .lesson-actions {
    margin-top: 0.75rem;
}

.lesson-card .start-lesson-btn {
    width: 100%;
    font-weight: 500;
    padding: 0.5rem 0.75rem; /* Smaller padding for 4 cards layout */
    font-size: 0.85rem; /* Smaller font size */
}

/* Practice tracking styles optimized for 4 cards */
.practice-tracking {
    border-top: 1px solid #e9ecef;
    padding-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.practice-tracking .practice-count,
.practice-tracking .last-practice,
.practice-tracking .practice-status {
    display: flex;
    align-items: center;
    font-size: 0.8rem; /* Smaller font size for 4 cards */
}

.practice-tracking .practice-count i,
.practice-tracking .last-practice i,
.practice-tracking .practice-status i {
    width: 14px;
    text-align: center;
    font-size: 0.75rem;
}

.practice-tracking .practice-count {
    margin-bottom: 0.2rem;
}

.practice-tracking .practice-count small,
.practice-tracking .last-practice small,
.practice-tracking .practice-status small {
    font-size: 0.75rem;
}

/* Responsive adjustments for 4 cards layout */
@media (max-width: 1200px) {
    .lesson-card .card-body {
        padding: 0.875rem;
    }

    .lesson-card .lesson-header h6 {
        font-size: 0.85rem;
    }

    .lesson-card .start-lesson-btn {
        padding: 0.45rem 0.65rem;
        font-size: 0.8rem;
    }

    .practice-tracking .practice-count,
    .practice-tracking .last-practice,
    .practice-tracking .practice-status {
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .lesson-card {
        min-height: 200px;
    }

    .lesson-card .card-body {
        padding: 0.75rem;
    }

    .lesson-card .lesson-header {
        padding-bottom: 0.4rem;
        margin-bottom: 0.4rem;
    }

    .lesson-card .lesson-level {
        margin-bottom: 0.4rem;
    }

    .lesson-card .lesson-meta {
        padding-top: 0.4rem;
    }

    .lesson-card .lesson-actions {
        margin-top: 0.6rem;
    }

    .lesson-card .start-lesson-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

    .practice-tracking {
        padding-top: 0.4rem;
        margin-bottom: 0.4rem;
    }

    .practice-tracking .practice-count,
    .practice-tracking .last-practice,
    .practice-tracking .practice-status {
        font-size: 0.7rem;
    }

    .practice-tracking .practice-count i,
    .practice-tracking .last-practice i,
    .practice-tracking .practice-status i {
        width: 12px;
        font-size: 0.65rem;
    }
}

/* Enhanced lesson card with practice tracking for 4 cards layout */
.lesson-card.has-practice {
    border-left: 3px solid #28a745; /* Thinner border for 4 cards */
}

.lesson-card.no-practice {
    border-left: 3px solid #fd7e14; /* Thinner border for 4 cards */
}

.lesson-card.has-practice .practice-tracking {
    background: linear-gradient(135deg, #f8fff9, #e8f5e8);
    border-radius: 6px;
    padding: 0.5rem;
    margin: 0.5rem -0.5rem 0.5rem -0.5rem;
    margin-bottom: 0px !important;
    margin-top: 0px !important;
}

.lesson-card.no-practice .practice-tracking {
    background: linear-gradient(135deg, #fff8f0, #ffe8d1);
    border-radius: 6px;
    padding: 0.5rem;
    margin: 0.5rem -0.5rem 0.5rem -0.5rem;
    margin-bottom: 0px !important;
    margin-top: 0px !important;
}

.lesson-card.has-practice .practice-tracking {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
    border: 1px solid rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.lesson-card.no-practice .practice-tracking {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.1) 0%, rgba(73, 80, 87, 0.1) 100%);
    border: 1px solid rgba(108, 117, 125, 0.2);
    color: #6c757d;
}

/* Listening Practice Button Container */
#listeningButtonContainer {
    margin-bottom: 1.5rem;
}

#listeningButtonContainer .btn {
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#listeningButtonContainer .btn-primary {
    background: linear-gradient(135deg, #ED1C24 0%, #C41230 100%);
    border: none;
    color: white;
}

#listeningButtonContainer .btn-primary:hover {
    background: linear-gradient(135deg, #C41230 0%, #A01028 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 28, 36, 0.3);
}

#listeningButtonContainer .btn-outline-primary {
    background: transparent;
    border: 2px solid #ED1C24;
    color: #ED1C24;
}

#listeningButtonContainer .btn-outline-primary:hover {
    background: #ED1C24;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 28, 36, 0.3);
}

/* Transcript Modal Styles */
.transcript-container {
    max-height: 60vh;
    overflow-y: auto;
}

.transcript-item {
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
    background: #fff;
}

.transcript-item:hover {
    border-color: #ED1C24;
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 28, 36, 0.1);
}

.transcript-item[data-challenge-index] {
    cursor: pointer;
}

.transcript-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #333;
}

.transcript-translation {
    color: #28a745;
    font-style: italic;
    padding: 0.5rem;
    background: rgba(40, 167, 69, 0.05);
    border-radius: 6px;
    border-left: 3px solid #28a745;
    margin: 0.5rem 0;
    transition: all 0.3s ease;
}

.transcript-translation .fa-spinner {
    color: #17a2b8;
}

.transcript-translation .text-warning {
    color: #ffc107 !important;
}

.transcript-translation .fa-exclamation-triangle {
    color: #ffc107;
}

.transcript-explanation {
    font-style: italic;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #ED1C24;
}

.transcript-item .badge {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}

.transcript-item .text-muted {
    font-size: 0.85rem;
}

/* Modal customization */
#transcriptModal .modal-dialog {
    max-width: 800px;
}

#transcriptModal .modal-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    border-bottom: none;
}

#transcriptModal .modal-title {
    font-weight: 600;
}

#transcriptModal .modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
}

#transcriptModal .modal-footer .btn {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

#transcriptModal .btn-primary {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}

#transcriptModal .btn-primary:hover {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
}

/* Responsive transcript modal */
@media (max-width: 768px) {
    #transcriptModal .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }

    .transcript-text {
        font-size: 1rem;
    }

    .transcript-item {
        padding: 0.75rem;
    }

    #transcriptModal .modal-footer .btn {
        height: 40px;
        min-width: 100px;
        font-size: 0.9rem;
    }

    #listeningButtonContainer {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    #listeningButtonContainer .btn {
        margin-right: 0 !important;
        margin-bottom: 0;
        margin-top: 0;
        flex: 1;
        min-width: auto;
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
        height: 38px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        line-height: 1;
        box-sizing: border-box;
        border-width: 2px;
    }

    /* Đảm bảo button outline có cùng kích thước với button solid */
    #listeningButtonContainer .btn-outline-primary {
        border-width: 2px;
        padding: calc(0.6rem - 2px) calc(0.8rem - 2px);
    }

    #listeningButtonContainer .btn:last-child {
        margin-bottom: 0;
    }

    /* Ẩn text của button Góp ý trên mobile, chỉ hiển thị icon */
    .btn-warning .fas {
        margin-right: 0 !important;
    }

    .btn-warning span {
        display: none;
    }

    /* Điều chỉnh kích thước button Góp ý khi chỉ hiển thị icon */
    .btn-warning {
        min-width: 44px;
        padding: 0.5rem;
    }
}

@media (max-width: 576px) {
    .transcript-container {
        max-height: 50vh;
    }

    .transcript-item .d-flex {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
    }

    .transcript-item .badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
        white-space: nowrap;
    }

    .transcript-item .text-muted.small {
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .transcript-translation {
        font-size: 0.9rem;
        padding: 0.4rem;
    }

    .transcript-translation .fa-spinner,
    .transcript-translation .fa-exclamation-triangle {
        font-size: 0.8rem;
    }

    #listeningButtonContainer {
        gap: 0.3rem;
    }

    #listeningButtonContainer .btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
        min-width: 0;
        height: 36px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        line-height: 1;
        box-sizing: border-box;
        border-width: 2px;
    }

    /* Đảm bảo button outline có cùng kích thước với button solid trên mobile */
    

    #transcriptModal .modal-footer .btn {
        height: 38px;
        min-width: 90px;
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
}

/* Button close màu trắng cho popup transcript */
#transcriptModal .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    color: white;
}

#transcriptModal .btn-close::before,
#transcriptModal .btn-close::after {
    background-color: white;
}

#transcriptModal .btn-close::after {
    color: white;
    background-color: white;
}

/* Mobile responsive cho filters - thu nhỏ khoảng cách và giảm bold */
@media (max-width: 768px) {
    /* Thu nhỏ khoảng cách giữa các element trong row g-3 mb-3 */
    .row.g-3.mb-3 {
        --bs-gutter-x: 0.75rem !important;
        --bs-gutter-y: 0.75rem !important;
    }

    .row.g-3.mb-3 > * {
        padding-right: calc(var(--bs-gutter-x) * 0.5) !important;
        padding-left: calc(var(--bs-gutter-x) * 0.5) !important;
        margin-bottom: calc(var(--bs-gutter-y) * 0.5) !important;
    }

    /* Giảm bold cho form-label trên mobile */
    .form-label.fw-bold {
        font-weight: 500 !important;
        font-size: 0.85rem !important;
    }

    /* Thu nhỏ margin bottom cho form-label */
    .form-label {
        margin-bottom: 0.25rem !important;
    }

    /* Thu nhỏ padding cho form-control và form-select */
    .form-control,
    .form-select {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.9rem !important;
    }

    /* Thu nhỏ margin cho col-md-* */
    .col-md-3,
    .col-md-2 {
        margin-bottom: 0.5rem !important;
    }

    /* Căn giữa filters-section trên mobile */
    .filters-section {
        text-align: center !important;
    }

    .filters-section .row {
        justify-content: center !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .filters-section .col-md-3,
    .filters-section .col-md-2 {
        text-align: center !important;
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .filters-section .form-label {
        text-align: left !important;
        justify-content: flex-start !important;
    }

    .filters-section .form-control,
    .filters-section .form-select {
        width: 100% !important;
        text-align: center !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

@media (max-width: 576px) {
    /* Thu nhỏ hơn nữa cho mobile nhỏ */
    .row.g-3.mb-3 {
        --bs-gutter-x: 0.5rem !important;
        --bs-gutter-y: 0.5rem !important;
    }

    /* Giảm bold hơn nữa */
    .form-label.fw-bold {
        font-weight: 400 !important;
        font-size: 0.8rem !important;
    }

    /* Thu nhỏ padding và font-size */
    .form-control,
    .form-select {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.85rem !important;
    }

    /* Thu nhỏ margin */
    .col-md-3,
    .col-md-2 {
        margin-bottom: 0.4rem !important;
    }

    /* Thu nhỏ mb-3 */
    .mb-3 {
        margin-bottom: 0.75rem !important;
    }

    /* Căn giữa filters-section trên mobile nhỏ */
    .filters-section {
        text-align: center !important;
    }

    .filters-section .row {
        justify-content: center !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .filters-section .col-md-3,
    .filters-section .col-md-2 {
        text-align: center !important;
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .filters-section .form-label {
        text-align: left !important;
        justify-content: flex-start !important;
    }

    .filters-section .form-control,
    .filters-section .form-select {
        width: 100% !important;
        text-align: center !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}