.quiz-performance-container {
    max-width: calc(100% - 80px);
    width: calc(100% - 80px);
    margin: 20px 40px;
}

.overall-stats-container {
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #0170B9 0%, #015a94 100%);
    border-radius: 8px;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stats-title-row {
    margin-bottom: 25px;
}

.stats-title-row h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    color: white;
}

.stats-content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    align-items: start;
}

/* Wide screens - two column layout */
@media (min-width: 1400px) {
    .stats-content-grid {
        grid-template-columns: 1fr 1.5fr;
    }
}

.stats-left {
    min-width: 0; /* Prevent grid overflow */
    overflow: hidden; /* Prevent content overflow */
}

.stats-right {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden; /* Prevent content overflow */
}

.graph-container {
    width: 100%;
    height: 450px;
    display: none;
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}

.graph-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.placeholder-graph {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

.placeholder-content {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

.placeholder-content svg {
    margin-bottom: 20px;
    opacity: 0.5;
}

.placeholder-content p {
    font-size: 16px;
    font-weight: 500;
}

.stats-loading {
    text-align: center;
    padding: 10px;
    margin-bottom: 15px;
}

.stats-loading p {
    margin: 10px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.overall-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    transition: opacity 0.3s ease;
}

.stats-disclaimer {
    margin: 15px 0 0 0;
    padding: 0;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
    text-align: center;
    line-height: 1.4;
}

.overall-stat-item {
    padding: 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: transform 0.2s, background 0.2s;
}

.overall-stat-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.25);
}

.overall-stat-item.highlight {
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.overall-stat-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    opacity: 0.95;
}

.overall-stat-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
}

.performance-feedback {
    margin-top: 20px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    border-left: 4px solid rgba(255, 255, 255, 0.5);
    animation: slideIn 0.3s ease-out;
}

.feedback-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.feedback-icon {
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.feedback-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: white;
}

.performance-feedback.feedback-excellent {
    background: rgba(76, 175, 80, 0.25);
    border-left-color: #4CAF50;
}

.performance-feedback.feedback-excellent .feedback-icon::before {
    content: '🌟';
}

.performance-feedback.feedback-good {
    background: rgba(139, 195, 74, 0.25);
    border-left-color: #8BC34A;
}

.performance-feedback.feedback-good .feedback-icon::before {
    content: '👍';
}

.performance-feedback.feedback-average {
    background: rgba(255, 193, 7, 0.25);
    border-left-color: #FFC107;
}

.performance-feedback.feedback-average .feedback-icon::before {
    content: '📊';
}

.performance-feedback.feedback-below {
    background: rgba(255, 152, 0, 0.25);
    border-left-color: #FF9800;
}

.performance-feedback.feedback-below .feedback-icon::before {
    content: '📈';
}

.performance-feedback.feedback-needs-work {
    background: rgba(244, 67, 54, 0.25);
    border-left-color: #F44336;
}

.performance-feedback.feedback-needs-work .feedback-icon::before {
    content: '💪';
}

.performance-feedback.feedback-neutral .feedback-icon::before {
    content: '🚀';
}

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

.ai-toggle-container {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    border-left: 4px solid rgba(255, 255, 255, 0.6);
}

.ai-toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 12px;
}

.ai-toggle-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ai-toggle-slider {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 26px;
    transition: .4s;
}

.ai-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}

.ai-toggle-checkbox:checked + .ai-toggle-slider {
    background-color: rgba(76, 175, 80, 0.8);
}

.ai-toggle-checkbox:checked + .ai-toggle-slider:before {
    transform: translateX(24px);
}

.ai-toggle-text {
    color: white;
    font-size: 15px;
    font-weight: 600;
}

.ai-toggle-description {
    margin: 10px 0 0 62px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.focus-areas-container {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    border-left: 4px solid rgba(255, 255, 255, 0.6);
}

.focus-areas-loading {
    text-align: center;
    padding: 20px;
}

.focus-areas-loading p {
    color: white;
    margin: 10px 0 0 0;
    font-size: 14px;
}

.small-spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.focus-areas-container {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    border-left: 4px solid rgba(255, 255, 255, 0.6);
}

.focus-areas-container h4 {
    margin: 0 0 15px 0;
    color: white;
    font-size: 16px;
    font-weight: 700;
}

.focus-areas-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.focus-areas-list li {
    padding: 10px 15px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    color: white;
    font-size: 14px;
    position: relative;
    padding-left: 35px;
}

.focus-areas-list li:before {
    content: '📌';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.focus-areas-list li:last-child {
    margin-bottom: 0;
}

.course-selector-inline {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    word-wrap: break-word;
}

.course-selector label,
.course-selector-inline label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 16px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.course-dropdown {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.3s;
}

.course-dropdown:hover,
.course-dropdown:focus {
    border-color: #36a2eb;
    outline: none;
}

.congratulations-message {
    background: rgba(76, 175, 80, 0.3) !important;
    border-left: 4px solid #4CAF50 !important;
    padding: 15px 15px 15px 20px !important;
    font-weight: 600;
    text-align: center;
}


.loading-message,
.no-data-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.loading-message p {
    margin: 0;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@media (max-width: 768px) {
    .quiz-performance-container {
        margin: 10px 20px;
        width: calc(100% - 40px);
        max-width: calc(100% - 40px);
    }
    
    .stats-content-grid {
        grid-template-columns: 1fr;
    }
    
    .graph-container {
        padding: 15px;
        height: 350px;
    }
    
    .overall-stats-grid {
        grid-template-columns: 1fr;
    }
}