/* shared/progressStyles.css - Shared styles for progress tracking across all apps */

/* Progress Button */
.progress-btn {
    background: var(--color-primary, #3b82f6);
    color: white;
    border: none;
    border-radius: var(--radius-btn, 0.625rem);
    padding: 12px 24px;
    font-weight: 600;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    transition: all 0.2s ease;
    z-index: 1000;
    margin: 0 auto 1.5rem auto;
    width: fit-content;
}

.progress-btn:hover {
    background: var(--color-primary-hover, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

/* Progress Modal */
.progress-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2008; /* Below confetti (9999) but above everything else */
}

.progress-modal.hidden {
    display: none;
}

.progress-modal-content {
    background: white;
    border-radius: var(--radius-card);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2009;
}

/* Modal Header */
.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.progress-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Tabs */
.progress-tabs {
    display: flex;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 20px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 20px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
}

.tab-btn:hover {
    color: #4b5563;
}

.tab-btn.active {
    color: #3b82f6;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

/* Tab Content */
.progress-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.tab-content {
    display: none;
    position: relative;
    overflow: visible;
}

.tab-content.active {
    display: block;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: linear-gradient(135deg, #f3f4f6 0%, #ffffff 100%);
    border-radius: var(--radius-card-sm);
    padding: 20px;
    text-align: center;
    border: 1px solid #e5e7eb;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.card-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 5px;
}

.card-label {
    font-size: 14px;
    color: #6b7280;
    text-transform: capitalize;
    letter-spacing: 0.5px;
}

/* Inline summary cards on settings screen */
.inline-summary-cards {
    margin: 0 auto 1.5rem auto;
    max-width: 700px;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.inline-summary-cards .summary-card {
    padding: 14px 10px;
}

.inline-summary-cards .card-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.inline-summary-cards .card-value {
    font-size: 20px;
}

.inline-summary-cards .card-label {
    font-size: 12px;
}

/* Recent Activity */
.recent-activity {
    background: #f9fafb;
    border-radius: var(--radius-card-sm);
    padding: 20px;
}

.recent-activity h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #374151;
}

.session-item {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: var(--radius-chip);
    margin-bottom: 10px;
    border: 1px solid #e5e7eb;
}

.session-date {
    color: #6b7280;
    font-size: 16px;
}

.session-drill {
    font-weight: 600;
    color: #1f2937;
    font-size: 16px;
}

.session-time {
    text-align: right;
    color: #1d4ed8;
    font-weight: 600;
    font-size: 16px;
}

/* Chart Container */
.chart-container {
    background: white;
    border-radius: var(--radius-card-sm);
    padding: 20px;
    border: 1px solid #e5e7eb;
    min-height: 300px;
    height: auto;
    max-height: 50vh;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    flex: 1;
}

.chart-container:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.chart-controls {
    display: flex;
    gap: 10px;
}

.chart-container canvas {
    max-width: 100% !important;
    max-height: 100% !important;
    height: auto !important;
}

#progress-chart {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    z-index: 1;
}

/* Drill Layout */
.drill-layout {
    display: flex;
    gap: 20px;
    height: 100%;
    min-height: 600px;
}

.drill-sidebar {
    width: 320px;
    min-width: 320px;
    background: #f9fafb;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    height: 100%;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.drill-selector-grid {
    margin-bottom: 0;
    overflow-y: auto;
    flex: 1;
    padding-right: 5px;
}

.drill-selector-grid {
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,.18) transparent;
}
.drill-selector-grid::-webkit-scrollbar { width: 4px; }
.drill-selector-grid::-webkit-scrollbar-track { background: transparent; }
.drill-selector-grid::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 9999px; }
.drill-selector-grid::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.32); }
[data-theme="dark"] .drill-selector-grid { scrollbar-color: rgba(255,255,255,.18) transparent; }
[data-theme="dark"] .drill-selector-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); }
[data-theme="dark"] .drill-selector-grid::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.32); }

.drill-sidebar.collapsed {
    width: 0;
    min-width: 0;
    padding: 0;
    opacity: 0;
    border: none;
}

.drill-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
}

.drill-main-content.expanded {
    /* Additional styles when sidebar is collapsed */
}

.drill-main-content.expanded .chart-container {
    margin-left: 40px; /* Add space for the show sidebar button */
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
    flex-shrink: 0;
}

.sidebar-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
}

.sidebar-toggle {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: #2563eb;
    transform: scale(1.1);
}

/* Show Sidebar Button (appears when sidebar is collapsed) */
.show-sidebar-btn {
    position: absolute;
    top: 20px;
    left: -20px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    z-index: 100;
}

.show-sidebar-btn:hover {
    background: #2563eb;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Drill Selector Grid - styles moved above to combine with scrollbar styles */

.selector-header {
    margin-bottom: 20px;
}

.selector-header h3 {
    margin: 0 0 15px 0;
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
}

.search-filter {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#drill-search {
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#drill-search:focus {
    outline: none;
    border-color: #3b82f6;
}

.category-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    background: white;
    color: #6b7280;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.filter-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

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

.drill-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.drill-card:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.drill-card.selected {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.drill-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.drill-rating {
    font-size: 16px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}


.drill-name {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
    flex: 1;
    margin-right: 8px;
}

.drill-stats-mini {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.stat-mini {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-value {
    font-size: 12px;
    color: #374151;
}

/* Drill Stats */
.drill-stats {
    margin-top: 20px;
    background: white;
    border-radius: 15px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.stats-header h4 {
    margin: 0;
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
}

.performance-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.performance-badge.rating-queen {
    background: linear-gradient(135deg, #fef7f0, #f9a8d4);
    color: #9d174d;
}

.performance-badge.rating-mastery {
    background: linear-gradient(135deg, #fefbeb, #fbbf24);
    color: #a16207;
}

.performance-badge.rating-expert {
    background: linear-gradient(135deg, #ecfdf5, #34d399);
    color: #065f46;
}

.performance-badge.rating-developing {
    background: linear-gradient(135deg, #dcfce7, #4ade80);
    color: #047857;
}

.performance-badge.rating-beginner {
    background: linear-gradient(135deg, #f8fafc, #94a3b8);
    color: #1e293b;
}

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

.stat-item {
    background: linear-gradient(135deg, #f8fafc, #ffffff);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

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

.stat-label {
    font-size: 14px;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 14px;
    color: #1f2937;
    font-weight: 600;
}

/* History Table */
.history-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.history-table {
    background: white;
    border-radius: 15px;
    padding: 20px;
    overflow-x: auto;
}

#history-table {
    width: 100%;
	border-collapse: collapse;
}

#history-table thead {
   background: #f9fafb;
}

#history-table th,
#history-table td {
   padding: 12px;
   text-align: left;
   border-bottom: 1px solid #e5e7eb;
   font-size: 14px;
}

#history-table th {
   font-weight: 600;
   color: #374151;
   text-transform: uppercase;
   font-size: 12px;
   letter-spacing: 0.5px;
}

#history-table tbody tr:hover {
   background: #f9fafb;
}

/* Specific column styling for better layout */
#history-table .date-column {
   text-align: left;
   white-space: nowrap;
}

#history-table .drill-column {
   text-align: left;
}

#history-table .time-column {
   text-align: left;
   white-space: nowrap;
}

#history-table .performance-column {
   text-align: left;
}

/* Progress Actions */
.progress-actions {
   display: flex;
   gap: 10px;
   padding: 20px 30px;
   border-top: 1px solid #e5e7eb;
   background: #f9fafb;
   justify-content: center;
   flex-wrap: wrap;
}

/* Buttons */
.btn {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   padding: 8px 16px;
   border-radius: 8px;
   font-weight: 500;
   cursor: pointer;
   border: none;
   transition: all 0.2s ease;
   font-size: 14px;
}

.progress-modal-content .btn-primary {
   background: linear-gradient(135deg, #f0fdf4, #86efac);
   color: #065f46;
   border: 1px solid #bbf7d0;
}

.progress-modal-content .btn-primary:hover {
   background: linear-gradient(135deg, #ecfdf5, #6ee7b7);
   transform: translateY(-1px);
   box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.btn-secondary {
   background: #f8fafc;
   color: #64748b;
   border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
   background: #f1f5f9;
   color: #475569;
}

.btn-danger {
   background: #fee2e2;
   color: #dc2626;
   border: 1px solid #fecaca;
}

.btn-danger:hover {
   background: #fecaca;
   color: #dc2626;
}

/* Share Dialog */
.share-dialog {
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background: rgba(0, 0, 0, 0.5);
   display: flex;
   align-items: center;
   justify-content: center;
   z-index: 3000;
   animation: fadeIn 0.3s ease;
}

.share-dialog-content {
   background: white;
   border-radius: 15px;
   padding: 30px;
   max-width: 400px;
   width: 90%;
   box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
   animation: slideUp 0.3s ease;
}

.share-dialog-content h3 {
   margin-top: 0;
   margin-bottom: 20px;
   color: #1f2937;
}

.share-options {
   display: flex;
   flex-direction: column;
   gap: 10px;
   margin-bottom: 20px;
}

.share-option {
   padding: 15px;
   background: #f9fafb;
   border: 1px solid #e5e7eb;
   border-radius: 8px;
   font-weight: 600;
   color: #374151;
   cursor: pointer;
   transition: all 0.3s ease;
   text-align: left;
}

.share-option:hover {
   background: #3b82f6;
   color: white;
   border-color: #3b82f6;
}

.close-dialog {
   width: 100%;
   padding: 10px;
   background: #e5e7eb;
   border: none;
   border-radius: 8px;
   font-weight: 600;
   color: #374151;
   cursor: pointer;
   transition: background 0.3s ease;
}

.close-dialog:hover {
   background: #d1d5db;
}

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

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

/* Mobile Responsive */
@media (max-width: 768px) {
   .progress-modal-content {
       width: 100%;
       height: 100%;
       max-height: 100vh;
       border-radius: 0;
   }
   
   .progress-tabs {
       overflow-x: auto;
       white-space: nowrap;
       padding: 0 10px;
   }
   
   .tab-btn {
       padding: 12px 15px;
       font-size: 14px;
   }
   
   .progress-content {
       padding: 20px;
   }
   
   .summary-cards {
       grid-template-columns: repeat(2, 1fr);
       gap: 15px;
   }
   
   .session-item {
       grid-template-columns: 1fr;
       gap: 5px;
   }
   
   .session-date,
   .session-drill,
   .session-time {
       text-align: left;
   }
   
   .chart-container {
       min-height: 350px;
       max-height: 60vh;
       padding: 15px;
   }
   
   .chart-container canvas {
       min-height: 300px !important;
   }
   
   .progress-actions {
       flex-direction: column;
       padding: 15px;
   }
   
   .btn {
       width: 100%;
       justify-content: center;
   }
   
   .progress-btn {
       padding: 10px 20px;
       font-size: 14px;
       margin: 0 auto 1rem auto;
   }

   .progress-btn span {
       display: none;
   }
      
   .history-controls {
       flex-direction: column;
   }
   
   .history-controls .btn {
       width: 100%;
   }
   
   /* Drill Grid Mobile */
   /* Mobile Drill Layout */
   .drill-layout {
       flex-direction: column;
       gap: 15px;
       min-height: auto;
   }
   
   .drill-sidebar {
       width: 100%;
       min-width: 100%;
       max-height: 300px;
       overflow-y: auto;
   }
   
   .drill-sidebar.collapsed {
       width: 100%;
       min-width: 100%;
       opacity: 1;
       padding: 20px;
       border: 1px solid #e5e7eb;
       max-height: 60px;
   }
   
   .drill-sidebar.collapsed .drill-selector-grid {
       display: none;
   }
   
   /* Hide the regular sidebar toggle button on mobile - only show the show sidebar button */
   .sidebar-toggle {
       display: none !important;
   }
   
   .drill-main-content {
       width: 100%;
   }
   
   /* Show sidebar button positioning adjustment for mobile */
   .show-sidebar-btn {
       position: relative !important;
       top: 0 !important;
       left: 0 !important;
       margin-bottom: 15px;
       align-self: flex-start;
   }
   
   .drill-grid {
       grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
       gap: 10px;
   }
   
   .search-filter {
       gap: 10px;
   }
   
   .category-filters {
       gap: 6px;
       flex-wrap: wrap;
   }
   
   .filter-btn {
       padding: 6px 10px;
       font-size: 12px;
   }
   
   .drill-card {
       padding: 8px;
   }
   
   .drill-rating {
       width: 18px;
       height: 18px;
       font-size: 12px;
   }
   
   .drill-name {
       font-size: 12px;
   }
   
   .stat-value {
       font-size: 12px;
       font-weight: 600;
   }
   
   .stat-label {
       font-size: 10px;
   }
   
   .stats-grid {
       grid-template-columns: repeat(2, 1fr);
       gap: 10px;
   }
   
   .stat-item {
       padding: 15px 10px;
   }
   
   .stat-icon {
       font-size: 20px;
   }
   
   .sidebar-header h3 {
       font-size: 16px;
   }

   /* History table mobile adjustments */
   #history-table .date-column {
       width: 28%;
       font-size: 12px;
   }
   
   #history-table .drill-column {
       width: 32%;
       font-size: 12px;
   }
   
   #history-table .time-column {
       width: 12%;
       font-size: 12px;
   }
   
   #history-table .performance-column {
       width: 28%;
       font-size: 12px;
   }
}

/* Tooltip Support */
.tooltip {
   position: relative;
   display: inline-block;
}

.tooltip .tooltiptext {
   visibility: hidden;
   width: 200px;
   background-color: #1f2937;
   color: white;
   text-align: center;
   border-radius: 8px;
   padding: 8px 12px;
   position: absolute;
   z-index: 1;
   bottom: 125%;
   left: 50%;
   margin-left: -100px;
   opacity: 0;
   transition: opacity 0.3s;
   font-size: 14px;
}

.tooltip .tooltiptext::after {
   content: "";
   position: absolute;
   top: 100%;
   left: 50%;
   margin-left: -5px;
   border-width: 5px;
   border-style: solid;
   border-color: #1f2937 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
   visibility: visible;
   opacity: 1;
}

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

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

/* Print Styles */
@media print {
   .progress-modal {
       position: static;
       background: none;
   }
   
   .progress-modal-content {
       box-shadow: none;
       max-width: 100%;
   }
   
   .progress-header,
   .progress-tabs,
   .progress-actions,
   .close-btn,
   .drill-selector,
   .history-controls {
       display: none;
   }
   
   .tab-content {
       display: block !important;
       page-break-inside: avoid;
   }
   
   .chart-container {
       height: auto;
       page-break-inside: avoid;
   }
}

/* Mistakes Tab Styles */
.mistakes-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.mistakes-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    max-height: 400px;
    overflow-y: auto;
}

.mistakes-table table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.mistakes-table th {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    font-size: 14px;
    white-space: nowrap;
}

.mistakes-table td {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
    color: #1f2937;
    vertical-align: top;
}

.mistakes-table tbody tr {
    transition: all 0.2s ease;
}

.mistakes-table tbody tr:hover {
    background: #f8fafc;
}

.mistakes-table tbody tr:last-child td {
    border-bottom: none;
}

/* Column Specific Styles */
.level-column {
    font-weight: 600;
    color: #3b82f6;
    max-width: 150px;
    word-wrap: break-word;
}

.question-column,
.correct-answer-column,
.student-answer-column {
    max-width: 180px;
    word-wrap: break-word;
}

.date-column {
    color: #6b7280;
    min-width: 90px;
    white-space: nowrap;
    font-size: 12px;
}

.actions-column {
    text-align: center;
    width: 60px;
}

/* Math Display in Table */
.math-display {
    font-family: 'Computer Modern', 'Times New Roman', serif;
    font-size: 14px;
    background: #f9fafb;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    display: inline-block;
    margin: 2px 0;
}

/* Delete Button */
.delete-mistake-btn {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.delete-mistake-btn:hover {
    background: #fecaca;
    color: #b91c1c;
    border-color: #f87171;
}

.delete-mistake-btn svg {
    width: 14px;
    height: 14px;
}

/* Small button variant */
.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    min-height: auto;
}

/* No Mistakes Message */
.no-mistakes {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.no-mistakes.hidden {
    display: none;
}

.no-mistakes-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.no-mistakes h3 {
    color: #374151;
    margin: 16px 0 12px 0;
    font-size: 20px;
    font-weight: 600;
}

.no-mistakes p {
    color: #6b7280;
    font-size: 16px;
    margin: 0;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Practice Mistakes Button */
#practice-mistakes {
    background: #8ce6c5;
    color: #0b714c;
    font-weight: 600;
}

#practice-mistakes:hover {
    background: #7ce2bd;
    transform: translateY(-1px);
}

#practice-mistakes:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Clear Mistakes Button */
#clear-mistakes {
    background: #fee2e2;
    color: #dc2626;
    font-weight: 600;
}

#clear-mistakes:hover {
    background: #fecaca;
    transform: translateY(-1px);
}

/* Mobile Responsive for Mistakes */
@media (max-width: 768px) {
    .mistakes-controls {
        flex-direction: column;
        gap: 10px;
    }

    .mistakes-controls .btn {
        width: 100%;
    }

    .mistakes-table {
        max-height: 300px;
    }

    .mistakes-table th,
    .mistakes-table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .level-column,
    .question-column,
    .correct-answer-column,
    .student-answer-column {
        max-width: 120px;
    }

    .math-display {
        font-size: 12px;
        padding: 4px 6px;
    }

    .date-column {
        font-size: 11px;
        min-width: 80px;
    }

    .delete-mistake-btn {
        padding: 4px 6px;
    }

    .delete-mistake-btn svg {
        width: 12px;
        height: 12px;
    }

    .no-mistakes {
        padding: 40px 20px;
    }

    .no-mistakes-icon {
        font-size: 36px;
    }

    .no-mistakes h3 {
        font-size: 18px;
    }

    .no-mistakes p {
        font-size: 14px;
    }
}