/* Performance Report - Tab Container Styles */
#performance-content { padding: 15px 0px;  border-radius: 25px 25px 0px 0px;}

/* IMPORTANT: Force filters to stay on same row */
#test-performance-container .filters-section .filters,
.filters-section .filters {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-end !important;
    gap: 20px !important;
    width: 100% !important;
}

#test-performance-container .filters-section .filter-group,
.filters-section .filter-group {
    flex: 1 !important;
    min-width: 0 !important;
    max-width: 33.333% !important;
}


/* Filter Section for Performance Report */
.filters-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.filters-section .filters {
    display: flex !important;
    gap: 20px;
    flex-wrap: nowrap !important;
    align-items: flex-end;
    justify-content: flex-start;
    width: 100%;
}

.filters-section .filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 0;
    max-width: 33.333%;
}

.filters-section .filter-group label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.filters-section .filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    min-width: 120px;
    width: 100%;
    box-sizing: border-box;
}

.filters-section .filter-group select:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* Ensure filters stay on same row on larger screens */
@media (min-width: 769px) {
    .filters-section .filters {
        flex-wrap: nowrap !important;
        flex-direction: row !important;
    }
    
    .filters-section .filter-group {
        flex: 1 1 30%;
        min-width: 150px;
    }
}

/* Tab Responsive */
@media (max-width: 768px) {
    .tab-navigation {
        flex-direction: column;
        margin: 10px;
    }
    
    .tab-button {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .filters-section .filters {
        flex-direction: column !important;
        gap: 15px;
    }
    
    .filters-section .filter-group {
        flex: none !important;
        max-width: none !important;
    }
    
    .filters-section .filter-group select {
        min-width: 100%;
        width: 100%;
    }
}

/* Recent Attempts Section Styles */
.recent-attempts-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-top: 30px;
}

.recent-attempts-section h3 {
    margin: 0 0 24px 0;
    color: #1f2937;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.recent-attempts-section h3 svg {
    color: #dc267f;
}

.recent-attempts-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.recent-attempt-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.recent-attempt-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.recent-attempt-card.expanded {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.recent-attempt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f8455a 0%, #dc267f 100%);
    color: white;
}

.recent-attempt-info {
    flex: 1;
}

.recent-attempt-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.recent-attempt-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

.recent-attempt-score {
    text-align: right;
    margin-left: 20px;
}

.recent-score-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    display: inline-block;
    margin-bottom: 4px;
}

.recent-score-percentage {
    font-size: 12px;
    opacity: 0.8;
}

.recent-attempt-meta {
    padding: 16px 24px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.recent-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recent-meta-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recent-meta-value {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}

.recent-attempt-actions {
    padding: 16px 24px;
    background: white;
    display: flex;
    justify-content: flex-end;
    border-bottom: 1px solid #e5e7eb;
}

.recent-view-details-btn {
    background: #dc267f;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recent-view-details-btn:hover {
    background: #b91c5c;
    transform: translateY(-1px);
}

.recent-view-details-btn.expanded {
    background: #6b7280;
}

.recent-view-details-btn.expanded:hover {
    background: #4b5563;
}

.recent-attempt-details {
    display: none;
    background: white;
    padding: 24px;
    border-top: 1px solid #e5e7eb;
}

.recent-attempt-details.expanded {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
        padding-top: 24px;
        padding-bottom: 24px;
    }
}

.recent-attempt-summary {
    margin-bottom: 24px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
}

.recent-summary-stat {
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    line-height: 20px;
}

.recent-summary-stat .small { font-size: 12px;;
    
}

.recent-summary-stat.correct {
    background: #dcfce7;
    color: #166534;
}

.recent-summary-stat.wrong {
    background: #fee2e2;
    color: #991b1b;
}

.recent-summary-stat.not-answered {
    background: #fef3c7;
    color: #92400e;
}

.recent-summary-stat.total {
    background: #e0f2fe;
    color: #0c4a6e;
}

.recent-questions-container h4 {
    margin: 0 0 16px 0;
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recent-question-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.recent-question-item.correct {
    border-left: 4px solid #10b981;
}

.recent-question-item.wrong {
    border-left: 4px solid #ef4444;
}

.recent-question-item.not-answered {
    border-left: 4px solid #f59e0b;
}

.recent-question-header {
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: between;
    align-items: center;
}

.recent-question-number {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.recent-question-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recent-question-status.correct {
    background: #dcfce7;
    color: #166534;
}

.recent-question-status.wrong {
    background: #fee2e2;
    color: #991b1b;
}

.recent-question-status.not-answered {
    background: #fef3c7;
    color: #92400e;
}

.recent-question-content {
    padding: 16px;
}

.recent-question-text {
    color: #1f2937;
    font-size: 16px;
    line-height: 1.6;
    font-weight: 500;
    margin-bottom: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 6px;
}

.recent-answers-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-answer-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recent-answer-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recent-user-answer,
.recent-correct-answer {
    padding: 10px 14px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    border: 1px solid;
}

.recent-user-answer.correct {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.recent-user-answer.wrong {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.recent-user-answer.not-answered {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.recent-correct-answer {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.recent-explanation {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.recent-explanation-text {
    padding: 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    color: #0c4a6e;
    font-size: 14px;
    line-height: 1.5;
}

.no-attempts-message {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
}

/* Loading state for recent attempts */
.recent-attempts-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.recent-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #dc267f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

/* Responsive styles for recent attempts */
@media (max-width: 768px) {
	#performance-content { padding: 0px;  border-radius: 25px 25px 0px 0px;}
    .recent-attempts-section {
        padding: 16px;
        margin-top: 20px;
    }
    
    .recent-attempt-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 16px;
    }
    
    .recent-attempt-score {
        text-align: center;
        margin-left: 0;
    }
    
    .recent-attempt-meta {
        gap: 12px;
        padding: 12px 16px;
    }
    
    .recent-attempt-actions {
        padding: 12px 16px;
    }
    
    .recent-attempt-details {
        padding: 16px;
    }
    
    .recent-attempt-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 16px;
    }
    
    .recent-question-content {
        padding: 12px;
    }
    
    .recent-question-text {
        padding: 12px;
        font-size: 14px;
    }
}