/* Base styles and responsive design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #edf7f2 0%, #d9ecf5 48%, #f5efe3 100%);
    color: #333;
    overflow-x: auto;
    padding: 10px 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Worksheet Header Styles */
.worksheet-header {
    margin: 0 10px 6px 10px;
    min-height: 32px;
    position: relative;
    z-index: 20;
}

.worksheet-info {
    position: relative;
    display: inline-block;
}

.worksheet-info-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 8px 14px;
    border: 1px solid #c9ddd6;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 1px 6px rgba(31, 79, 70, 0.12);
    color: #34495e;
    cursor: pointer;
    font: inherit;
}

.worksheet-info-button:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.worksheet-info-button:active {
    transform: scale(0.98);
    box-shadow: 0 0 0 4px rgba(40, 118, 107, 0.18);
}

.worksheet-title {
    color: #1f4f46;
    font-size: 14px;
    font-weight: 800;
}

.worksheet-subtitle {
    color: #34495e;
    font-size: 12px;
    font-weight: 700;
}

.info-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #28766b;
    color: white;
    font-size: 12px;
    font-weight: 800;
    font-family: Georgia, serif;
}

.worksheet-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: min(560px, calc(100vw - 28px));
    padding: 54px 14px 14px 14px;
    border: 1px solid #c9ddd6;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 24px rgba(31, 79, 70, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    pointer-events: none;
}

.worksheet-info.open .worksheet-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.tooltip-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    border: 1px solid #a8c8be;
    border-radius: 8px;
    background: #f7fbf9;
    color: #1f4f46;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
}

.tooltip-close:active,
.small-btn:active,
.btn:active,
.sum-checkboxes label:active,
.pause-control:active,
.tab-btn:active {
    transform: scale(0.98);
    filter: brightness(0.94);
}

.worksheet-tooltip h3 {
    color: #28766b;
    font-size: 13px;
    margin-bottom: 6px;
}

.worksheet-tooltip .learning-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.worksheet-tooltip .learning-grid ol,
.worksheet-tooltip .learning-grid ul {
    margin-left: 18px;
    color: #34495e;
    font-size: 13px;
    line-height: 1.35;
}

.info-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-field label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 50px;
}

.info-field input {
    padding: 8px 12px;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

.info-field input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* Container adapts to iframe vs full window */
.container {
    width: calc(100% - 20px);
    margin: 0 10px;
    height: 55vh;
    min-height: 450px;
    max-height: 550px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;
}

/* Activities Container */
.activities-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    margin: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background: #34495e;
    border-radius: 8px 8px 0 0;
}

.tab-btn {
    flex: 1;
    min-height: 48px;
    padding: 12px 10px;
    border: none;
    background: #34495e;
    color: #ecf0f1;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #2c3e50;
    color: white;
}

.tab-btn.active {
    background: #3498db;
    color: white;
    border-bottom-color: #e74c3c;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 15px;
    animation: fadeIn 0.3s ease-in;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

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

.tab-content h4 {
    color: #34495e;
    font-size: 14px;
    margin: 10px 0 8px 0;
}

.worksheet-panel {
    background: #ffffff;
    border: 1px solid #dbe6e2;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
    box-shadow: 0 1px 4px rgba(31, 79, 70, 0.08);
}

.worksheet-panel p {
    color: #34495e;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 8px;
}

.compact-list {
    margin-left: 18px;
    color: #34495e;
    font-size: 13px;
    line-height: 1.45;
}

.compact-list li {
    margin-bottom: 4px;
}

.activity-score {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    margin: 4px 0 8px 0;
    padding: 6px 12px;
    border-radius: 8px;
    background: #e9f5f1;
    color: #1f4f46;
    font-size: 14px;
    font-weight: 800;
}

.activity-checklist {
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.activity-checklist li {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 8px 10px;
    border: 1px solid #dbe6e2;
    border-radius: 8px;
    background: #f8fbfa;
    color: #34495e;
    font-size: 13px;
    line-height: 1.25;
}

.activity-checklist li.complete {
    border-color: #79b98c;
    background: #eef8f0;
}

.step-tick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    width: 18px;
    height: 18px;
    border: 1px solid #b7c9c2;
    border-radius: 50%;
    background: white;
    color: transparent;
    font-size: 12px;
    font-weight: 900;
}

.activity-checklist li.complete .step-tick {
    border-color: #218a3b;
    background: #218a3b;
    color: white;
}

.step-mark {
    min-width: 58px;
    padding: 5px 8px;
    border-radius: 999px;
    background: #edf2f7;
    color: #34495e;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
}

.activity-checklist li.complete .step-mark {
    background: #d8f0df;
    color: #17682c;
}

.pause-notice {
    margin-top: 10px;
    padding: 8px 10px;
    border-left: 4px solid #28766b;
    background: #e9f5f1;
    color: #1f4f46;
    font-size: 13px;
    font-weight: 600;
}

.prompt-block {
    display: block;
    color: #34495e;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    margin-top: 10px;
}

.prompt-block textarea,
.worksheet-panel textarea,
.reflection-question textarea {
    width: 100%;
    min-height: 72px;
    margin-top: 6px;
    padding: 8px;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    font: inherit;
    font-size: 13px;
    resize: vertical;
}

/* Activity Row Layout */
.activity-row {
    display: flex;
    gap: 15px;
    margin: 10px 0;
    flex: 1;
    min-height: 0;
}

.activity-row > div {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
}

/* Graph Container */
.graph-container {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.graph-container h4 {
    margin-bottom: 8px;
}

#infectionGraphCanvas {
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    background: white;
    flex: 1;
    max-height: 280px;
    min-height: 200px;
}

/* Outcomes Explanation */
.outcomes-explanation {
    margin-bottom: 10px;
}

.outcomes-explanation ul {
    list-style-type: disc;
    margin-left: 20px;
    color: #34495e;
    margin-bottom: 0;
}

.outcomes-explanation li {
    margin-bottom: 3px;
    line-height: 1.3;
    font-size: 13px;
}

/* Data Tables */
.data-table-container, .possibility-diagram-container, .probability-table-container {
    margin: 10px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.data-table-container {
    max-height: 250px;
    overflow-y: auto;
}

.possibility-diagram-container, .probability-table-container {
    overflow-y: auto;
}

.data-table, .possibility-table, .probability-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.data-table th, .possibility-table th, .probability-table th {
    background: #3498db;
    color: white;
    padding: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
}

.data-table td, .possibility-table td, .probability-table td {
    padding: 6px;
    text-align: center;
    border-bottom: 1px solid #ecf0f1;
    font-size: 12px;
}

.data-table tbody tr:hover, .probability-table tbody tr:hover {
    background: #f8f9fa;
}

.possibility-table td {
    background: #ecf0f1;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
}

.possibility-table td:hover {
    background: #cfe5ef;
}

.possibility-table td.contagious-sum,
.probability-table tr.contagious-row td {
    background: #fdecea;
    color: #8e2a20;
    font-weight: 700;
}

.possibility-table td.last-roll,
.probability-table tr.last-roll-row td {
    outline: 2px solid #f2b705;
    outline-offset: -2px;
}

.possibility-table th:first-child {
    background: #2c3e50;
}

.possibility-table tbody th {
    background: #2c3e50;
    color: white;
}

/* Graph Canvas */
.graph-instruction {
    margin: 10px 0;
    text-align: center;
}

/* Question Inputs */
.contagious-question, .reflection-question {
    margin: 10px 0;
}

.contagious-question {
    margin-top: 10px;
}

.contagious-question input,
.contagious-sum-entry input {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 10px;
}

.contagious-sum-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #34495e;
    font-size: 13px;
    font-weight: 700;
}

.contagious-sum-entry input {
    margin-top: 0;
    max-width: 180px;
}

.reflection-question textarea {
    width: 100%;
    padding: 8px;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    font-size: 13px;
    margin-top: 8px;
    resize: vertical;
    font-family: inherit;
    min-height: 72px;
    max-height: none;
}

.contagious-question input:focus, .reflection-question textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* Answer feedback styles */
.answer-feedback {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.answer-feedback.correct {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.answer-feedback.incorrect {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Input styling for correct/incorrect answers */
.contagious-question input.correct-answer {
    border-color: #28a745;
    background-color: #f8fff9;
    box-shadow: 0 0 5px rgba(40, 167, 69, 0.3);
}

.contagious-question input.incorrect-answer {
    border-color: #dc3545;
    background-color: #fff8f8;
    box-shadow: 0 0 5px rgba(220, 53, 69, 0.3);
}

/* Reflection feedback styles */
.reflection-feedback {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.reflection-feedback.good {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.reflection-feedback.needs-improvement {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Textarea styling for reflection answers */
.reflection-question textarea.good-answer {
    border-color: #28a745;
    background-color: #f8fff9;
    box-shadow: 0 0 5px rgba(40, 167, 69, 0.3);
}

.reflection-question textarea.needs-improvement-answer {
    border-color: #ffc107;
    background-color: #fffdf5;
    box-shadow: 0 0 5px rgba(255, 193, 7, 0.3);
}

/* Teacher analytics */
.analytics-panel {
    margin: 10px;
    border: 1px solid #c9ddd6;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 10px rgba(31, 79, 70, 0.1);
    overflow: hidden;
}

.analytics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: #e9f5f1;
    border-bottom: 1px solid #c9ddd6;
}

.analytics-header h4 {
    color: #1f4f46;
    font-size: 15px;
    margin-bottom: 2px;
}

.analytics-header p {
    color: #34495e;
    font-size: 12px;
    margin: 0;
}

.analytics-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.analytics-btn {
    min-width: 96px;
}

.analytics-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
}

.analytics-body.collapsed {
    display: none;
}

.analytics-column {
    min-width: 0;
}

.analytics-column h5 {
    color: #34495e;
    font-size: 13px;
    margin: 0 0 6px 0;
}

.analytics-list {
    height: 170px;
    overflow-y: auto;
    list-style: decimal;
    margin: 0;
    padding: 8px 8px 8px 28px;
    border: 1px solid #dbe6e2;
    border-radius: 8px;
    background: #f8fbfa;
}

.analytics-list li {
    margin-bottom: 8px;
    padding: 7px 8px;
    border-radius: 6px;
    background: white;
    color: #34495e;
    font-size: 12px;
    line-height: 1.35;
    box-shadow: 0 1px 3px rgba(31, 79, 70, 0.08);
}

.analytics-list .empty-log {
    list-style: none;
    margin-left: -18px;
    color: #667085;
    background: transparent;
    box-shadow: none;
}

.log-line {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.log-symbol {
    color: #1f4f46;
    font-weight: 900;
}

.log-details {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.log-details span {
    padding: 3px 6px;
    border-radius: 999px;
    background: #edf2f7;
    color: #34495e;
}

.log-state {
    margin-top: 5px;
    color: #667085;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 11px;
}

.log-question {
    margin-top: 5px;
    font-weight: 700;
}

.quiz-log li.correct {
    border-left: 4px solid #218a3b;
    background: #f1fbf3;
}

.quiz-log li.wrong {
    border-left: 4px solid #c2410c;
    background: #fff7ed;
}

/* Control Panel */
.control-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.button-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    white-space: nowrap;
}

.btn.primary {
    background: #4CAF50;
    color: white;
}

.btn.primary:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn.secondary {
    background: #f44336;
    color: white;
}

.btn.secondary:hover {
    background: #da190b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.btn.dice-btn {
    background: #FF9800;
    color: white;
}

.btn.dice-btn:hover {
    background: #F57C00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.population-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}

.population-controls label {
    font-size: 14px;
    font-weight: 600;
    min-width: 80px;
    white-space: nowrap;
}

.slider {
    flex: 1;
    min-width: 100px;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.pause-control {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid #bed6ce;
    border-radius: 6px;
    background: #f7fbf9;
    color: #1f4f46;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.contagious-controls {
    display: grid;
    grid-template-columns: auto minmax(280px, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
    padding: 8px;
    background: #f7fbf9;
    border: 1px solid #d6e5df;
    border-radius: 6px;
}

.control-label {
    color: #1f4f46;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.sum-checkboxes {
    display: grid;
    grid-template-columns: repeat(11, minmax(32px, 1fr));
    gap: 5px;
}

.sum-checkboxes label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 48px;
    border: 1px solid #bfd7cf;
    border-radius: 6px;
    background: white;
    color: #2c3e50;
    font-size: 12px;
    font-weight: 700;
}

.sum-checkboxes input {
    accent-color: #d94b3d;
}

.preset-controls {
    display: flex;
    gap: 6px;
}

.small-btn {
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid #90b7ab;
    border-radius: 6px;
    background: white;
    color: #1f4f46;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.small-btn:hover {
    background: #e9f5f1;
}

/* Main Simulation Area */
.simulation-container {
    display: flex;
    gap: 10px;
    flex: 1;
    min-height: 0;
}

#simulationCanvas {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex: 1;
    max-width: 60%;
    height: 100%;
}

/* Statistics Panel */
.stats-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 40%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stats-section h4 {
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 8px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 4px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
}

.stat-label {
    font-weight: 600;
    color: #555;
}

.stat-label.healthy {
    color: #4CAF50;
}

.stat-label.infected {
    color: #f44336;
}

.stat-label.recovered {
    color: #2196F3;
}

.stat-value {
    font-weight: bold;
    color: #2c3e50;
    background: rgba(52, 152, 219, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Dice Section */
.dice-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.dice-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 2px 0;
}

.dice {
    width: 32px;
    height: 32px;
    background: #fff;
    border: 2px solid #333;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.dice.rolling {
    animation: diceRoll 0.5s ease-in-out;
}

@keyframes diceRoll {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(1.1); }
    50% { transform: rotate(180deg) scale(1.2); }
    75% { transform: rotate(270deg) scale(1.1); }
}

.dice-face {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 2px;
    padding: 4px;
}

.dot {
    width: 4px;
    height: 4px;
    background: #333;
    border-radius: 50%;
}

.dice-sum {
    font-size: 12px;
    font-weight: bold;
    color: #2c3e50;
    margin-top: 2px;
}

/* Chart Container */
.chart-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 110px;
    flex-shrink: 0;
}

.chart-container h4 {
    color: #2c3e50;
    font-size: 13px;
    margin-bottom: 6px;
    text-align: center;
}

#chartCanvas {
    width: 100%;
    height: 80px;
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .worksheet-info {
        width: calc(100vw - 20px);
        flex-wrap: wrap;
    }

    .worksheet-tooltip {
        width: calc(100vw - 28px);
    }

    .worksheet-tooltip .learning-grid {
        grid-template-columns: 1fr;
    }

    .tab-navigation {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1 1 33%;
        min-width: 110px;
        font-size: 12px;
        padding: 10px 6px;
    }

    .contagious-controls {
        grid-template-columns: 1fr;
    }

    .sum-checkboxes {
        grid-template-columns: repeat(6, minmax(38px, 1fr));
    }

    .simulation-container {
        flex-direction: column;
    }
    
    #simulationCanvas {
        max-width: 100%;
        height: 200px;
    }
    
    .stats-panel {
        width: 100%;
        max-height: 150px;
    }
    
    .controls-row {
        justify-content: center;
    }
    
    .btn {
        flex: 1;
        min-width: 80px;
    }

    .activity-row {
        flex-direction: column;
    }

    .analytics-header,
    .analytics-body {
        grid-template-columns: 1fr;
    }

    .analytics-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .analytics-actions {
        width: 100%;
    }

    .analytics-btn {
        flex: 1;
    }
}

/* Tooltip styles */
[title] {
    cursor: help;
}

/* Animation for infected students */
.student-infected {
    animation: infectionPulse 0.5s ease-out;
}

@keyframes infectionPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Footer Styles */
.footer {
    background: rgba(52, 73, 94, 0.95);
    color: #ecf0f1;
    padding: 15px 20px;
    margin-top: 20px;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer .credits {
    font-size: 14px;
    margin-bottom: 8px;
    color: #bdc3c7;
}

.footer .credits strong {
    color: #3498db;
    font-weight: 600;
}

.footer .resources {
    font-size: 13px;
    margin: 0;
    color: #95a5a6;
}

.footer .resources a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer .resources a:hover {
    color: #5dade2;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .footer {
        padding: 12px 15px;
    }
    
    .footer .credits,
    .footer .resources {
        font-size: 12px;
    }
    
    .footer .resources a {
        word-break: break-all;
    }
}
