/* Basic styles for the exam test generator */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

.settings-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.settings-btn.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.help-text {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 0.85em;
}

.form-actions {
    margin-top: 30px;
    text-align: center;
}

/* Button Styles */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 40px;
}

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

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

.loading-text {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 10px;
}

.loading-subtext {
    color: #888;
}

/* Error Message */
.error-message {
    background: #fee;
    border: 2px solid #fcc;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.error-icon {
    font-size: 2em;
}

.error-text {
    flex: 1;
    color: #c33;
}

/* Modal Styles */
.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: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2em;
    color: #888;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-description {
    color: #666;
    margin-bottom: 20px;
}

/* API Status */
.api-status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.api-status.success {
    background: #d4edda;
    color: #155724;
}

.api-status.error {
    background: #f8d7da;
    color: #721c24;
}

.api-status.testing {
    background: #d1ecf1;
    color: #0c5460;
}

.status-icon {
    font-size: 1.5em;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .settings-btn {
        width: 35px;
        height: 35px;
        font-size: 1.2em;
    }
}

/* ============================================
   ENHANCED RESPONSIVE DESIGN - Task 8.2
   ============================================ */

/* Tablet Devices (768px and below) */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .container {
        padding: 25px;
        border-radius: 10px;
    }
    
    h1 {
        font-size: 2.2em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    /* Form adjustments */
    .form-group input,
    .form-group select {
        padding: 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Button adjustments */
    .btn {
        padding: 14px 25px;
        font-size: 1em;
        width: 100%;
    }
    
    /* Modal adjustments */
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
}

/* Mobile Devices (480px and below) */
@media (max-width: 480px) {
    body {
        padding: 8px;
    }
    
    .container {
        padding: 15px;
        border-radius: 8px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .subtitle {
        font-size: 0.95em;
    }
    
    header {
        margin-bottom: 20px;
    }
    
    .settings-btn {
        width: 32px;
        height: 32px;
        font-size: 1.1em;
    }
    
    /* Form adjustments for small screens */
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 0.95em;
    }
    
    .form-group input,
    .form-group select {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .help-text {
        font-size: 0.8em;
    }
    
    /* Button adjustments */
    .btn {
        padding: 12px 20px;
        font-size: 0.95em;
    }
    
    /* Loading indicator */
    .loading-indicator {
        padding: 30px 15px;
    }
    
    .spinner {
        width: 40px;
        height: 40px;
    }
    
    .loading-text {
        font-size: 1em;
    }
    
    /* Error message */
    .error-message {
        padding: 15px;
        flex-direction: column;
        text-align: center;
    }
    
    .error-icon {
        font-size: 1.5em;
    }
    
    /* Modal adjustments */
    .modal-content {
        width: 98%;
        max-height: 95vh;
    }
    
    .modal-header h2 {
        font-size: 1.3em;
    }
    
    .close-btn {
        font-size: 1.5em;
    }
}

/* Touch-friendly enhancements */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .btn {
        min-height: 44px;
        padding: 14px 25px;
    }
    
    .option {
        min-height: 50px;
        padding: 16px;
    }
    
    .option input[type="radio"] {
        width: 24px;
        height: 24px;
        margin-right: 15px;
    }
    
    .grid-item {
        min-height: 44px;
        padding: 14px;
    }
    
    .settings-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .close-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .btn-primary:hover {
        transform: none;
    }
    
    .option:hover {
        border-color: #e0e0e0;
        background: white;
    }
    
    /* Add active states instead */
    .btn-primary:active {
        transform: scale(0.98);
    }
    
    .option:active {
        border-color: #667eea;
        background: #f5f7ff;
    }
}


/* ============================================
   TEST INTERFACE STYLES - Task 7.2
   ============================================ */

.test-container {
    max-width: 900px;
}

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

.test-info h2 {
    margin: 0 0 5px 0;
    color: #333;
}

.test-meta {
    color: #666;
    font-size: 0.9em;
}

.test-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
}

.timer-icon {
    font-size: 1.2em;
}

/* Progress Bar */
.progress-bar {
    position: relative;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    border-radius: 15px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

/* Question Display */
.question-display {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
}

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

.question-number {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1em;
}

.question-topic {
    color: #888;
    font-size: 0.9em;
    font-style: italic;
}

.question-text {
    font-size: 1.1em;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}

/* Options */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option:hover {
    border-color: #667eea;
    background: #f5f7ff;
}

.option input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
}

.option label {
    flex: 1;
    cursor: pointer;
    font-size: 1em;
    line-height: 1.5;
}

.option input[type="radio"]:checked + label {
    font-weight: 600;
    color: #667eea;
}

/* Navigation Controls */
.navigation-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.navigation-controls .btn {
    flex: 1;
    max-width: 150px;
}

.question-grid-toggle {
    flex: 1;
    text-align: center;
}

.navigation-controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Question Grid */
.question-grid {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.question-grid h3 {
    margin-bottom: 15px;
    color: #333;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.grid-item {
    padding: 12px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.grid-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.grid-item.answered {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

/* Submit Section */
.submit-section {
    text-align: center;
    padding: 20px 0;
    border-top: 2px solid #e0e0e0;
}

.submit-section .btn {
    padding: 15px 40px;
    font-size: 1.1em;
}

/* Warning Box */
.warning-box {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.warning-box strong {
    color: #856404;
}

.warning-box ul {
    margin: 10px 0 0 20px;
    color: #856404;
}

/* Test Content Hidden State */
#test-content.hidden {
    display: none;
}

#test-content {
    display: block;
}

/* Responsive Design for Test Interface */
@media (max-width: 600px) {
    .test-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .navigation-controls {
        flex-direction: column;
    }
    
    .navigation-controls .btn {
        max-width: 100%;
    }
    
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    }
}

/* Enhanced Test Interface Responsive Design - Task 8.2 */
@media (max-width: 768px) {
    .test-container {
        max-width: 100%;
    }
    
    .test-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .test-timer {
        font-size: 1.3em;
    }
    
    .question-display {
        padding: 20px;
    }
    
    .question-text {
        font-size: 1.05em;
    }
    
    .navigation-controls {
        flex-wrap: wrap;
    }
    
    .navigation-controls .btn {
        flex: 1 1 45%;
        max-width: none;
    }
    
    .question-grid-toggle {
        flex: 1 1 100%;
    }
    
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .test-header {
        padding-bottom: 15px;
    }
    
    .test-info h2 {
        font-size: 1.3em;
    }
    
    .test-meta {
        font-size: 0.85em;
    }
    
    .test-timer {
        font-size: 1.2em;
    }
    
    .progress-bar {
        height: 25px;
        margin-bottom: 20px;
    }
    
    .progress-text {
        font-size: 0.85em;
    }
    
    .question-display {
        padding: 15px;
    }
    
    .question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .question-number {
        font-size: 1em;
    }
    
    .question-topic {
        font-size: 0.85em;
    }
    
    .question-text {
        font-size: 1em;
        margin-bottom: 15px;
    }
    
    .options-container {
        gap: 10px;
    }
    
    .option {
        padding: 12px;
    }
    
    .option label {
        font-size: 0.95em;
    }
    
    .navigation-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .navigation-controls .btn {
        flex: 1 1 100%;
        max-width: 100%;
    }
    
    .question-grid {
        padding: 15px;
    }
    
    .question-grid h3 {
        font-size: 1.1em;
    }
    
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
        gap: 6px;
    }
    
    .grid-item {
        padding: 10px;
        font-size: 0.9em;
    }
    
    .submit-section {
        padding: 15px 0;
    }
    
    .submit-section .btn {
        padding: 14px 30px;
        font-size: 1em;
    }
    
    .warning-box {
        padding: 12px;
        font-size: 0.9em;
    }
    
    .warning-box ul {
        margin: 8px 0 0 15px;
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .test-header {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .navigation-controls {
        flex-direction: row;
    }
    
    .navigation-controls .btn {
        flex: 1 1 30%;
    }
    
    .question-grid-toggle {
        flex: 1 1 40%;
    }
}


/* ============================================
   RESULTS INTERFACE STYLES - Task 7.3
   ============================================ */

.results-container {
    max-width: 1000px;
}

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

.results-header h1 {
    margin: 0;
    color: #333;
}

#results-content {
    display: block;
}

#results-content.hidden {
    display: none;
}

/* Score Summary */
.score-summary {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 12px;
    color: white;
    margin-bottom: 30px;
}

.score-circle {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.score-circle svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.score-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 12;
}

.score-fill {
    fill: none;
    stroke: white;
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-percentage {
    font-size: 3em;
    font-weight: bold;
}

.score-label {
    font-size: 1.2em;
    opacity: 0.9;
}

.score-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.score-item-label {
    font-size: 1.1em;
}

.score-item-value {
    font-size: 1.5em;
    font-weight: bold;
}

/* Performance Section */
.performance-section,
.cutoff-section,
.recommendations-section,
.solutions-section {
    margin-bottom: 30px;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 12px;
}

.performance-section h2,
.cutoff-section h2,
.recommendations-section h2,
.solutions-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.subject-performance {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.subject-bar {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 15px;
    align-items: center;
}

.subject-label {
    font-weight: 600;
    color: #333;
}

.bar-container {
    position: relative;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    transition: width 1s ease;
}

.bar-score {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: #333;
}

/* Cutoff Comparison */
.cutoff-chart {
    margin-bottom: 20px;
}

.cutoff-bar {
    position: relative;
    height: 40px;
    background: #e0e0e0;
    border-radius: 20px;
    overflow: visible;
    margin: 40px 0;
}

.cutoff-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    transition: width 1s ease;
}

.cutoff-marker,
.score-marker {
    position: absolute;
    top: -35px;
    transform: translateX(-50%);
}

.cutoff-marker {
    color: #ffc107;
}

.score-marker {
    color: #667eea;
}

.marker-label {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
    background: white;
    padding: 5px 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.cutoff-marker::after,
.score-marker::after {
    content: '▼';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5em;
}

.cutoff-status {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.cutoff-status.success {
    background: #d4edda;
    color: #155724;
}

.cutoff-status.warning {
    background: #fff3cd;
    color: #856404;
}

.cutoff-status h3 {
    margin: 0 0 10px 0;
}

.cutoff-message {
    color: #666;
    line-height: 1.6;
}

/* Recommendations */
.recommendations {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.recommendation-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: white;
    border-left: 4px solid #667eea;
    border-radius: 8px;
}

.recommendation-icon {
    font-size: 1.5em;
}

.recommendation-item p {
    flex: 1;
    margin: 0;
    line-height: 1.6;
    color: #333;
}

/* Solutions */
.solutions-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.solution-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.solution-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    font-weight: 600;
}

.solution-header.correct {
    background: #d4edda;
    color: #155724;
}

.solution-header.incorrect {
    background: #f8d7da;
    color: #721c24;
}

.solution-number {
    font-size: 1.1em;
}

.solution-status {
    font-size: 1em;
}

.solution-question {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.solution-question p {
    margin: 0;
    line-height: 1.6;
    color: #333;
}

.solution-options {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.solution-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    background: #f9f9f9;
}

.solution-option.correct-option {
    background: #d4edda;
    border: 2px solid #28a745;
}

.solution-option.incorrect-option {
    background: #f8d7da;
    border: 2px solid #dc3545;
}

.option-letter {
    font-weight: bold;
    min-width: 25px;
}

.option-text {
    flex: 1;
}

.option-badge {
    font-size: 0.85em;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.correct-option .option-badge {
    background: #28a745;
    color: white;
}

.incorrect-option .option-badge {
    background: #dc3545;
    color: white;
}

.solution-explanation {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}

.explanation-toggle {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background 0.3s ease;
}

.explanation-toggle:hover {
    background: #5568d3;
}

.explanation-content {
    margin-top: 15px;
    padding: 15px;
    background: #f0f7ff;
    border-left: 4px solid #667eea;
    border-radius: 8px;
}

.explanation-content p {
    margin: 0 0 10px 0;
    line-height: 1.6;
    color: #333;
}

.explanation-content p:last-child {
    margin-bottom: 0;
}

.no-data {
    text-align: center;
    color: #888;
    padding: 20px;
}

/* Responsive Design for Results */
@media (max-width: 768px) {
    .score-summary {
        grid-template-columns: 1fr;
    }
    
    .subject-bar {
        grid-template-columns: 1fr;
    }
    
    .subject-label {
        margin-bottom: 5px;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

/* Enhanced Results Interface Responsive Design - Task 8.2 */
@media (max-width: 768px) {
    .results-container {
        max-width: 100%;
    }
    
    .results-header h1 {
        font-size: 2em;
    }
    
    .score-summary {
        grid-template-columns: 1fr;
        padding: 25px;
        gap: 25px;
    }
    
    .score-circle {
        width: 180px;
        height: 180px;
    }
    
    .score-percentage {
        font-size: 2.5em;
    }
    
    .score-label {
        font-size: 1.1em;
    }
    
    .score-details {
        gap: 15px;
    }
    
    .score-item {
        padding: 12px;
    }
    
    .score-item-label {
        font-size: 1em;
    }
    
    .score-item-value {
        font-size: 1.3em;
    }
    
    .performance-section,
    .cutoff-section,
    .recommendations-section,
    .solutions-section {
        padding: 20px;
    }
    
    .subject-bar {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .subject-label {
        margin-bottom: 5px;
    }
    
    .cutoff-bar {
        margin: 50px 0;
    }
    
    .cutoff-marker,
    .score-marker {
        top: -40px;
    }
    
    .marker-label {
        font-size: 0.8em;
        padding: 4px 8px;
    }
    
    .recommendation-item {
        padding: 12px;
    }
    
    .recommendation-icon {
        font-size: 1.3em;
    }
    
    .solution-header {
        padding: 12px 15px;
    }
    
    .solution-question,
    .solution-options,
    .solution-explanation {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .results-header {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .results-header h1 {
        font-size: 1.6em;
    }
    
    .score-summary {
        padding: 20px;
        gap: 20px;
    }
    
    .score-circle {
        width: 150px;
        height: 150px;
    }
    
    .score-percentage {
        font-size: 2em;
    }
    
    .score-label {
        font-size: 1em;
    }
    
    .score-details {
        gap: 12px;
    }
    
    .score-item {
        padding: 10px;
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .score-item-label {
        font-size: 0.9em;
    }
    
    .score-item-value {
        font-size: 1.2em;
    }
    
    .performance-section,
    .cutoff-section,
    .recommendations-section,
    .solutions-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .performance-section h2,
    .cutoff-section h2,
    .recommendations-section h2,
    .solutions-section h2 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
    
    .subject-performance {
        gap: 12px;
    }
    
    .subject-bar {
        gap: 8px;
    }
    
    .subject-label {
        font-size: 0.9em;
    }
    
    .bar-container {
        height: 25px;
    }
    
    .bar-score {
        font-size: 0.85em;
        right: 8px;
    }
    
    .cutoff-bar {
        height: 35px;
        margin: 45px 0 35px 0;
    }
    
    .cutoff-marker,
    .score-marker {
        top: -38px;
    }
    
    .marker-label {
        font-size: 0.75em;
        padding: 3px 6px;
    }
    
    .cutoff-marker::after,
    .score-marker::after {
        bottom: -28px;
        font-size: 1.2em;
    }
    
    .cutoff-status {
        padding: 15px;
    }
    
    .cutoff-status h3 {
        font-size: 1.1em;
    }
    
    .cutoff-status p {
        font-size: 0.9em;
    }
    
    .cutoff-message {
        font-size: 0.9em;
    }
    
    .recommendations {
        gap: 12px;
    }
    
    .recommendation-item {
        padding: 10px;
        gap: 10px;
    }
    
    .recommendation-icon {
        font-size: 1.2em;
    }
    
    .recommendation-item p {
        font-size: 0.9em;
    }
    
    .solutions-container {
        gap: 15px;
    }
    
    .solution-header {
        padding: 10px 12px;
        font-size: 0.9em;
    }
    
    .solution-number {
        font-size: 1em;
    }
    
    .solution-status {
        font-size: 0.9em;
    }
    
    .solution-question,
    .solution-options,
    .solution-explanation {
        padding: 12px;
    }
    
    .solution-question p {
        font-size: 0.95em;
    }
    
    .solution-options {
        gap: 8px;
    }
    
    .solution-option {
        padding: 10px;
        font-size: 0.9em;
    }
    
    .option-letter {
        min-width: 22px;
        font-size: 0.9em;
    }
    
    .option-text {
        font-size: 0.9em;
    }
    
    .option-badge {
        font-size: 0.75em;
        padding: 2px 6px;
    }
    
    .explanation-toggle {
        padding: 10px;
        font-size: 0.9em;
    }
    
    .explanation-content {
        padding: 12px;
        font-size: 0.9em;
    }
    
    .no-data {
        font-size: 0.9em;
        padding: 15px;
    }
}

/* Landscape orientation for results on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .score-summary {
        grid-template-columns: 1fr 1.5fr;
        gap: 20px;
    }
    
    .score-circle {
        width: 140px;
        height: 140px;
    }
}
