* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Arial, sans-serif; /* More modern font */
}

body {
    background-color: #f5f7fa; /* Light gray background for softer look */
    color: #333333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Modern, clean header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e4e8;
}

.title-section {
    display: flex;
    flex-direction: column;
}

h1 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.subtitle {
    color: #6c757d;
    font-size: 1rem;
}

.simulation-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
    height: 400px;
    position: relative;
}

#simulation-canvas {
    width: 100%;
    height: 100%;
}

/* Modern two-panel layout */
.all-content-wrapper {
    display: flex;
    gap: 20px;
    align-items: stretch;
    height: calc(100vh - 130px);
    min-height: 500px;
    max-height: 800px;
}

/* Left panel with simulation */
.left-panel {
    flex: 3;
    position: relative;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.simulation-viewport {
    width: 100%;
    height: 100%; /* Use full height of panel */
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f9f9f9;
    position: relative; /* For positioning the overlay */
}

#simulation-canvas {
    width: 100%;
    height: 100%;
    z-index: 1; /* Ensure canvas is below the data overlay */
}

/* Physics data overlay - displayed within the canvas */
.physics-data-overlay {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.85); /* Semi-transparent background */
    border-radius: 8px;
    margin: 0 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    z-index: 2; /* Position above the canvas */
}

.data-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
}

.data-icon {
    color: #3498db;
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.data-value {
    font-size: 1.2rem; /* Larger font size for values */
    font-weight: bold; /* Make values stand out */
    color: #2c3e50; /* Darker color for better contrast */
}

.data-label {
    font-size: 0.9rem; /* Slightly larger labels */
    color: #6c757d; /* Softer gray for labels */
}

/* Right panel with controls */
.right-panel {
    flex: 2;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Tabs for right panel */
.control-tabs {
    display: flex;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.tab {
    padding: 12px 20px;
    cursor: pointer;
    color: #495057;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.tab.active {
    background-color: #ffffff;
    color: #007bff;
    border-bottom: 2px solid #007bff;
}

.tab:hover:not(.active) {
    background-color: #e9ecef;
}

/* Tab content */
.tab-content {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.tab-content.hidden {
    display: none;
}

/* Control blocks */
.control-block {
    margin-bottom: 25px;
}

.control-block h3 {
    color: #343a40;
    font-size: 1rem;
    margin-bottom: 12px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eaeaea;
}

.radio-group, .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-group label, .checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Buttons and controls */
button {
    background-color: #007bff; /* Blue background */
    color: #ffffff; /* White text */
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s, transform 0.2s;
}

button:hover {
    background-color: #0056b3; /* Darker blue on hover */
    transform: scale(1.05); /* Slight zoom effect */
}

#ground-toggle.grounded {
    background-color: #27ae60;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, #3498db, white, #e74c3c);
    outline: none;
    margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 1px solid #0056b3;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 1px solid #0056b3;
}

/* Style for the slider track in Firefox */
input[type="range"]::-moz-range-track {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, #3498db, white, #e74c3c);
}

.charge-value {
    font-weight: bold;
    margin-top: 5px;
    text-align: center;
}

/* Color for negative charge display values */
.charge-value.negative {
    color: #3498db;
}

/* Color for positive charge display values */
.charge-value.positive {
    color: #e74c3c;
}

.information-panel {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
}

#physics-info {
    font-size: 14px;
    line-height: 1.8;
}

#physics-info p {
    margin-bottom: 5px;
}

#physics-info span {
    font-weight: bold;
}

.positive-charge {
    color: #e74c3c;
}

.negative-charge {
    color: #3498db;
}

.neutral-charge {
    color: #7f8c8d;
}

.instructions-container {
    margin-top: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.instructions-section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.instructions-section h3 {
    color: #3498db;
    margin: 20px 0 10px;
}

.instructions-section ul, 
.instructions-section ol {
    padding-left: 20px;
    margin-bottom: 15px;
}

.instructions-section li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.instructions-section p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.instructions-section strong {
    color: #2c3e50;
}

/* Explanation panel improvements */
.explanation-panel {
    background-color: #ffffff;
    color: #333333;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Modal version of explanation panel */
.explanation-panel.modal-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Darker, more opaque overlay */
    z-index: 1000;
    overflow-y: auto;
    padding: 0; /* Override the padding from explanation-panel */
}

.explanation-panel.modal-dialog.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.explanation-panel.modal-dialog .explanation-content {
    background-color: #ffffff; /* Solid white background */
    margin: 3% auto;
    width: 90%;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
}

.explanation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    background-color: #ffffff; /* Ensure header has solid background */
}

.explanation-header h3 {
    font-size: 18px;
    color: #007bff;
}

.explanation-content {
    margin-top: 20px;
    line-height: 1.6;
}

.explanation-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.explanation-nav-btn {
    background-color: #007bff;
    color: #ffffff;
    border: 1px solid #0056b3;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    opacity: 0.7;
}

.explanation-nav-btn.active {
    background-color: #007bff;
    color: #ffffff;
    opacity: 1;
}

/* Hide inactive tabs */
.explanation-section {
    display: none;
}

.explanation-section.active {
    display: block;
}

.explanation-nav-btn:hover {
    background-color: #0056b3;
    color: #ffffff;
    opacity: 1;
}

/* Add these styles for the detailed explanation section */

.detailed-explanation {
    margin: 40px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.detailed-explanation h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

/* Tab navigation */
.explanation-tab {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.explanation-tab button {
    background-color: #007bff;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 10px 20px;
    margin: 5px;
    transition: 0.3s;
    font-size: 16px;
    border-radius: 5px 5px 0 0;
    color: white;
    opacity: 0.7;
}

.explanation-tab button:hover {
    background-color: #0056b3;
    opacity: 0.9;
}

.explanation-tab button.active {
    background-color: #007bff;
    color: white;
    opacity: 1;
}

/* Tab content */
.tabcontent {
    display: none;
    padding: 20px;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    animation: fadeEffect 1s;
}

@keyframes fadeEffect {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* Scenario containers */
.scenario-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    margin: 20px 0;
}

.scenario {
    flex: 1;
    min-width: 300px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: white;
}

.scenario h4 {
    color: #3498db;
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.scenario-img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 15px auto;
    border: 1px solid #eee;
    border-radius: 4px;
}

/* Key points */
.key-point {
    background-color: #ebf5fb;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin: 20px 0;
}

.key-point p {
    margin: 0;
}

/* Summary table */
.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.summary-table th, .summary-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.summary-table th {
    background-color: #f2f2f2;
    color: #333;
}

.summary-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.summary-table tr:hover {
    background-color: #f1f1f1;
}

/* Key takeaways */
.takeaways {
    list-style-type: none;
    padding-left: 0;
}

.takeaways li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.takeaways li:last-child {
    border-bottom: none;
}

/* Experiment suggestion */
.experiment-suggestion {
    background-color: #e8f8f5;
    border: 1px solid #1abc9c;
    border-radius: 8px;
    padding: 15px;
    margin-top: 30px;
}

.experiment-suggestion h4 {
    color: #1abc9c;
    margin-top: 0;
}

.experiment-suggestion ol {
    padding-left: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .scenario-container {
        flex-direction: column;
    }
    
    .scenario {
        min-width: auto;
    }
    
    .explanation-tab button {
        flex-grow: 1;
        text-align: center;
    }
}

/* Modal Dialog for Advanced Explanation */
.modal-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    background-color: #ffffff;
    margin: 5% auto;
    width: 90%;
    max-width: 900px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    max-height: 90%;
    overflow-y: auto;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #2c3e50;
}

.modal-body {
    padding: 20px;
}

.close-button {
    background-color: transparent;
    border: none;
    color: #777;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
    padding: 0;
}

.close-button:hover {
    color: #333;
    transform: scale(1.1);
}

/* Advanced Link Button */
.advanced-link {
    text-align: center;
    margin-top: 20px;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Method buttons - Visual charging mode selection */
.method-buttons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.method-button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    border-radius: 8px;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    cursor: pointer;
    transition: all 0.3s ease;
}

.method-button:hover {
    border-color: #adb5bd;
    background-color: #e9ecef;
}

.method-button input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.method-button input[type="radio"]:checked + .method-icon {
    background-color: #007bff;
    color: white;
}

.method-button input[type="radio"]:checked ~ .method-name {
    color: #007bff;
    font-weight: 600;
}

.method-button input[type="radio"]:checked ~ .method-description {
    color: #495057;
}

.method-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 1.2rem;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.method-name {
    font-weight: 500;
    color: #495057;
    margin-bottom: 5px;
}

.method-description {
    font-size: 0.8rem;
    color: #6c757d;
    text-align: center;
}

/* Charge slider */
.charge-slider-container {
    padding: 10px 0;
}

.slider-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, #3498db, white, #e74c3c);
    outline: none;
    margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 1px solid #0056b3;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 1px solid #0056b3;
}

/* Style for the slider track in Firefox */
input[type="range"]::-moz-range-track {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, #3498db, white, #e74c3c);
}

.charge-value {
    font-weight: bold;
    margin-top: 5px;
    text-align: center;
}

/* Color for negative charge display values */
.charge-value.negative {
    color: #3498db;
}

/* Color for positive charge display values */
.charge-value.positive {
    color: #e74c3c;
}

.information-panel {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
}

#physics-info {
    font-size: 14px;
    line-height: 1.8;
}

#physics-info p {
    margin-bottom: 5px;
}

#physics-info span {
    font-weight: bold;
}

.positive-charge {
    color: #e74c3c;
}

.negative-charge {
    color: #3498db;
}

.neutral-charge {
    color: #7f8c8d;
}

.instructions-container {
    margin-top: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.instructions-section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.instructions-section h3 {
    color: #3498db;
    margin: 20px 0 10px;
}

.instructions-section ul, 
.instructions-section ol {
    padding-left: 20px;
    margin-bottom: 15px;
}

.instructions-section li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.instructions-section p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.instructions-section strong {
    color: #2c3e50;
}

/* Explanation panel improvements */
.explanation-panel {
    background-color: #ffffff;
    color: #333333;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Modal version of explanation panel */
.explanation-panel.modal-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Darker, more opaque overlay */
    z-index: 1000;
    overflow-y: auto;
    padding: 0; /* Override the padding from explanation-panel */
}

.explanation-panel.modal-dialog.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.explanation-panel.modal-dialog .explanation-content {
    background-color: #ffffff; /* Solid white background */
    margin: 3% auto;
    width: 90%;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
}

.explanation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    background-color: #ffffff; /* Ensure header has solid background */
}

.explanation-header h3 {
    font-size: 18px;
    color: #007bff;
}

.explanation-content {
    margin-top: 20px;
    line-height: 1.6;
}

.explanation-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.explanation-nav-btn {
    background-color: #007bff;
    color: #ffffff;
    border: 1px solid #0056b3;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    opacity: 0.7;
}

.explanation-nav-btn.active {
    background-color: #007bff;
    color: #ffffff;
    opacity: 1;
}

/* Hide inactive tabs */
.explanation-section {
    display: none;
}

.explanation-section.active {
    display: block;
}

.explanation-nav-btn:hover {
    background-color: #0056b3;
    color: #ffffff;
    opacity: 1;
}

/* Add these styles for the detailed explanation section */

.detailed-explanation {
    margin: 40px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.detailed-explanation h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

/* Tab navigation */
.explanation-tab {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.explanation-tab button {
    background-color: #007bff;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 10px 20px;
    margin: 5px;
    transition: 0.3s;
    font-size: 16px;
    border-radius: 5px 5px 0 0;
    color: white;
    opacity: 0.7;
}

.explanation-tab button:hover {
    background-color: #0056b3;
    opacity: 0.9;
}

.explanation-tab button.active {
    background-color: #007bff;
    color: white;
    opacity: 1;
}

/* Tab content */
.tabcontent {
    display: none;
    padding: 20px;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    animation: fadeEffect 1s;
}

@keyframes fadeEffect {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* Scenario containers */
.scenario-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    margin: 20px 0;
}

.scenario {
    flex: 1;
    min-width: 300px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: white;
}

.scenario h4 {
    color: #3498db;
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.scenario-img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 15px auto;
    border: 1px solid #eee;
    border-radius: 4px;
}

/* Key points */
.key-point {
    background-color: #ebf5fb;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin: 20px 0;
}

.key-point p {
    margin: 0;
}

/* Summary table */
.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.summary-table th, .summary-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.summary-table th {
    background-color: #f2f2f2;
    color: #333;
}

.summary-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.summary-table tr:hover {
    background-color: #f1f1f1;
}

/* Key takeaways */
.takeaways {
    list-style-type: none;
    padding-left: 0;
}

.takeaways li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.takeaways li:last-child {
    border-bottom: none;
}

/* Experiment suggestion */
.experiment-suggestion {
    background-color: #e8f8f5;
    border: 1px solid #1abc9c;
    border-radius: 8px;
    padding: 15px;
    margin-top: 30px;
}

.experiment-suggestion h4 {
    color: #1abc9c;
    margin-top: 0;
}

.experiment-suggestion ol {
    padding-left: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .scenario-container {
        flex-direction: column;
    }
    
    .scenario {
        min-width: auto;
    }
    
    .explanation-tab button {
        flex-grow: 1;
        text-align: center;
    }
}

/* Modal Dialog for Advanced Explanation */
.modal-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    background-color: #ffffff;
    margin: 5% auto;
    width: 90%;
    max-width: 900px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    max-height: 90%;
    overflow-y: auto;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #2c3e50;
}

.modal-body {
    padding: 20px;
}

.close-button {
    background-color: transparent;
    border: none;
    color: #777;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
    padding: 0;
}

.close-button:hover {
    color: #333;
    transform: scale(1.1);
}

/* Advanced Link Button */
.advanced-link {
    text-align: center;
    margin-top: 20px;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Method buttons - Visual charging mode selection */
.method-buttons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.method-button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    border-radius: 8px;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    cursor: pointer;
    transition: all 0.3s ease;
}

.method-button:hover {
    border-color: #adb5bd;
    background-color: #e9ecef;
}

.method-button input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.method-button input[type="radio"]:checked + .method-icon {
    background-color: #007bff;
    color: white;
}

.method-button input[type="radio"]:checked ~ .method-name {
    color: #007bff;
    font-weight: 600;
}

.method-button input[type="radio"]:checked ~ .method-description {
    color: #495057;
}

.method-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 1.2rem;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.method-name {
    font-weight: 500;
    color: #495057;
    margin-bottom: 5px;
}

.method-description {
    font-size: 0.8rem;
    color: #6c757d;
    text-align: center;
}

/* Charge slider */
.charge-slider-container {
    padding: 10px 0;
}

.slider-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, #3498db, white, #e74c3c);
    outline: none;
    margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 1px solid #0056b3;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 1px solid #0056b3;
}

/* Style for the slider track in Firefox */
input[type="range"]::-moz-range-track {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, #3498db, white, #e74c3c);
}

.charge-value {
    font-weight: bold;
    margin-top: 5px;
    text-align: center;
}

/* Color for negative charge display values */
.charge-value.negative {
    color: #3498db;
}

/* Color for positive charge display values */
.charge-value.positive {
    color: #e74c3c;
}

.information-panel {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
}

#physics-info {
    font-size: 14px;
    line-height: 1.8;
}

#physics-info p {
    margin-bottom: 5px;
}

#physics-info span {
    font-weight: bold;
}

.positive-charge {
    color: #e74c3c;
}

.negative-charge {
    color: #3498db;
}

.neutral-charge {
    color: #7f8c8d;
}

.instructions-container {
    margin-top: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.instructions-section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.instructions-section h3 {
    color: #3498db;
    margin: 20px 0 10px;
}

.instructions-section ul, 
.instructions-section ol {
    padding-left: 20px;
    margin-bottom: 15px;
}

.instructions-section li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.instructions-section p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.instructions-section strong {
    color: #2c3e50;
}

/* Explanation panel improvements */
.explanation-panel {
    background-color: #ffffff;
    color: #333333;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Modal version of explanation panel */
.explanation-panel.modal-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Darker, more opaque overlay */
    z-index: 1000;
    overflow-y: auto;
    padding: 0; /* Override the padding from explanation-panel */
}

.explanation-panel.modal-dialog.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.explanation-panel.modal-dialog .explanation-content {
    background-color: #ffffff; /* Solid white background */
    margin: 3% auto;
    width: 90%;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
}

.explanation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    background-color: #ffffff; /* Ensure header has solid background */
}

.explanation-header h3 {
    font-size: 18px;
    color: #007bff;
}

.explanation-content {
    margin-top: 20px;
    line-height: 1.6;
}

.explanation-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.explanation-nav-btn {
    background-color: #007bff;
    color: #ffffff;
    border: 1px solid #0056b3;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    opacity: 0.7;
}

.explanation-nav-btn.active {
    background-color: #007bff;
    color: #ffffff;
    opacity: 1;
}

/* Hide inactive tabs */
.explanation-section {
    display: none;
}

.explanation-section.active {
    display: block;
}

.explanation-nav-btn:hover {
    background-color: #0056b3;
    color: #ffffff;
    opacity: 1;
}

/* Add these styles for the detailed explanation section */

.detailed-explanation {
    margin: 40px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.detailed-explanation h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

/* Tab navigation */
.explanation-tab {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.explanation-tab button {
    background-color: #007bff;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 10px 20px;
    margin: 5px;
    transition: 0.3s;
    font-size: 16px;
    border-radius: 5px 5px 0 0;
    color: white;
    opacity: 0.7;
}

.explanation-tab button:hover {
    background-color: #0056b3;
    opacity: 0.9;
}

.explanation-tab button.active {
    background-color: #007bff;
    color: white;
    opacity: 1;
}

/* Tab content */
.tabcontent {
    display: none;
    padding: 20px;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    animation: fadeEffect 1s;
}

@keyframes fadeEffect {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* Scenario containers */
.scenario-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    margin: 20px 0;
}

.scenario {
    flex: 1;
    min-width: 300px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: white;
}

.scenario h4 {
    color: #3498db;
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.scenario-img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 15px auto;
    border: 1px solid #eee;
    border-radius: 4px;
}

/* Key points */
.key-point {
    background-color: #ebf5fb;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin: 20px 0;
}

.key-point p {
    margin: 0;
}

/* Summary table */
.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.summary-table th, .summary-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.summary-table th {
    background-color: #f2f2f2;
    color: #333;
}

.summary-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.summary-table tr:hover {
    background-color: #f1f1f1;
}

/* Key takeaways */
.takeaways {
    list-style-type: none;
    padding-left: 0;
}

.takeaways li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.takeaways li:last-child {
    border-bottom: none;
}

/* Experiment suggestion */
.experiment-suggestion {
    background-color: #e8f8f5;
    border: 1px solid #1abc9c;
    border-radius: 8px;
    padding: 15px;
    margin-top: 30px;
}

.experiment-suggestion h4 {
    color: #1abc9c;
    margin-top: 0;
}

.experiment-suggestion ol {
    padding-left: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .scenario-container {
        flex-direction: column;
    }
    
    .scenario {
        min-width: auto;
    }
    
    .explanation-tab button {
        flex-grow: 1;
        text-align: center;
    }
}

/* Modal Dialog for Advanced Explanation */
.modal-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    background-color: #ffffff;
    margin: 5% auto;
    width: 90%;
    max-width: 900px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    max-height: 90%;
    overflow-y: auto;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #2c3e50;
}

.modal-body {
    padding: 20px;
}

.close-button {
    background-color: transparent;
    border: none;
    color: #777;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
    padding: 0;
}

.close-button:hover {
    color: #333;
    transform: scale(1.1);
}

/* Advanced Link Button */
.advanced-link {
    text-align: center;
    margin-top: 20px;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Method buttons - Visual charging mode selection */
.method-buttons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.method-button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    border-radius: 8px;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    cursor: pointer;
    transition: all 0.3s ease;
}

.method-button:hover {
    border-color: #adb5bd;
    background-color: #e9ecef;
}

.method-button input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.method-button input[type="radio"]:checked + .method-icon {
    background-color: #007bff;
    color: white;
}

.method-button input[type="radio"]:checked ~ .method-name {
    color: #007bff;
    font-weight: 600;
}

.method-button input[type="radio"]:checked ~ .method-description {
    color: #495057;
}

.method-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 1.2rem;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.method-name {
    font-weight: 500;
    color: #495057;
    margin-bottom: 5px;
}

.method-description {
    font-size: 0.8rem;
    color: #6c757d;
    text-align: center;
}

/* Charge slider */
.charge-slider-container {
    padding: 10px 0;
}

.slider-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, #3498db, white, #e74c3c);
    outline: none;
    margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 1px solid #0056b3;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 1px solid #0056b3;
}

/* Style for the slider track in Firefox */
input[type="range"]::-moz-range-track {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, #3498db, white, #e74c3c);
}

.charge-value {
    font-weight: bold;
    margin-top: 5px;
    text-align: center;
}

/* Color for negative charge display values */
.charge-value.negative {
    color: #3498db;
}

/* Color for positive charge display values */
.charge-value.positive {
    color: #e74c3c;
}

.information-panel {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
}

#physics-info {
    font-size: 14px;
    line-height: 1.8;
}

#physics-info p {
    margin-bottom: 5px;
}

#physics-info span {
    font-weight: bold;
}

.positive-charge {
    color: #e74c3c;
}

.negative-charge {
    color: #3498db;
}

.neutral-charge {
    color: #7f8c8d;
}

.instructions-container {
    margin-top: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.instructions-section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.instructions-section h3 {
    color: #3498db;
    margin: 20px 0 10px;
}

.instructions-section ul, 
.instructions-section ol {
    padding-left: 20px;
    margin-bottom: 15px;
}

.instructions-section li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.instructions-section p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.instructions-section strong {
    color: #2c3e50;
}

/* Explanation panel improvements */
.explanation-panel {
    background-color: #ffffff;
    color: #333333;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Modal version of explanation panel */
.explanation-panel.modal-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Darker, more opaque overlay */
    z-index: 1000;
    overflow-y: auto;
    padding: 0; /* Override the padding from explanation-panel */
}

.explanation-panel.modal-dialog.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.explanation-panel.modal-dialog .explanation-content {
    background-color: #ffffff; /* Solid white background */
    margin: 3% auto;
    width: 90%;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
}

.explanation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    background-color: #ffffff; /* Ensure header has solid background */
}

.explanation-header h3 {
    font-size: 18px;
    color: #007bff;
}

.explanation-content {
    margin-top: 20px;
    line-height: 1.6;
}

.explanation-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.explanation-nav-btn {
    background-color: #007bff;
    color: #ffffff;
    border: 1px solid #0056b3;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    opacity: 0.7;
}

.explanation-nav-btn.active {
    background-color: #007bff;
    color: #ffffff;
    opacity: 1;
}

/* Hide inactive tabs */
.explanation-section {
    display: none;
}

.explanation-section.active {
    display: block;
}

.explanation-nav-btn:hover {
    background-color: #0056b3;
    color: #ffffff;
    opacity: 1;
}

/* Add these styles for the detailed explanation section */

.detailed-explanation {
    margin: 40px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.detailed-explanation h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

/* Tab navigation */
.explanation-tab {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.explanation-tab button {
    background-color: #007bff;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 10px 20px;
    margin: 5px;
    transition: 0.3s;
    font-size: 16px;
    border-radius: 5px 5px 0 0;
    color: white;
    opacity: 0.7;
}

.explanation-tab button:hover {
    background-color: #0056b3;
    opacity: 0.9;
}

.explanation-tab button.active {
    background-color: #007bff;
    color: white;
    opacity: 1;
}

/* Tab content */
.tabcontent {
    display: none;
    padding: 20px;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    animation: fadeEffect 1s;
}

@keyframes fadeEffect {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* Scenario containers */
.scenario-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    margin: 20px 0;
}

.scenario {
    flex: 1;
    min-width: 300px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: white;
}

.scenario h4 {
    color: #3498db;
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.scenario-img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 15px auto;
    border: 1px solid #eee;
    border-radius: 4px;
}

/* Key points */
.key-point {
    background-color: #ebf5fb;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin: 20px 0;
}

.key-point p {
    margin: 0;
}

/* Summary table */
.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.summary-table th, .summary-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.summary-table th {
    background-color: #f2f2f2;
    color: #333;
}

.summary-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.summary-table tr:hover {
    background-color: #f1f1f1;
}

/* Key takeaways */
.takeaways {
    list-style-type: none;
    padding-left: 0;
}

.takeaways li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.takeaways li:last-child {
    border-bottom: none;
}

/* Experiment suggestion */
.experiment-suggestion {
    background-color: #e8f8f5;
    border: 1px solid #1abc9c;
    border-radius: 8px;
    padding: 15px;
    margin-top: 30px;
}

.experiment-suggestion h4 {
    color: #1abc9c;
    margin-top: 0;
}

.experiment-suggestion ol {
    padding-left: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .scenario-container {
        flex-direction: column;
    }
    
    .scenario {
        min-width: auto;
    }
    
    .explanation-tab button {
        flex-grow: 1;
        text-align: center;
    }
}

/* Modal Dialog for Advanced Explanation */
.modal-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    background-color: #ffffff;
    margin: 5% auto;
    width: 90%;
    max-width: 900px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    max-height: 90%;
    overflow-y: auto;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #2c3e50;
}

.modal-body {
    padding: 20px;
}

.close-button {
    background-color: transparent;
    border: none;
    color: #777;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
    padding: 0;
}

.close-button:hover {
    color: #333;
    transform: scale(1.1);
}

/* Advanced Link Button */
.advanced-link {
    text-align: center;
    margin-top: 20px;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Method buttons - Visual charging mode selection */
.method-buttons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.method-button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    border-radius: 8px;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    cursor: pointer;
    transition: all 0.3s ease;
}

.method-button:hover {
    border-color: #adb5bd;
    background-color: #e9ecef;
}

.method-button input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.method-button input[type="radio"]:checked + .method-icon {
    background-color: #007bff;
    color: white;
}

.method-button input[type="radio"]:checked ~ .method-name {
    color: #007bff;
    font-weight: 600;
}

.method-button input[type="radio"]:checked ~ .method-description {
    color: #495057;
}

.method-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 1.2rem;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.method-name {
    font-weight: 500;
    color: #495057;
    margin-bottom: 5px;
}

.method-description {
    font-size: 0.8rem;
    color: #6c757d;
    text-align: center;
}

/* Charge slider */
.charge-slider-container {
    padding: 10px 0;
}

.slider-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, #3498db, white, #e74c3c);
    outline: none;
    margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 1px solid #0056b3;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 1px solid #0056b3;
}

/* Style for the slider track in Firefox */
input[type="range"]::-moz-range-track {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, #3498db, white, #e74c3c);
}

.charge-value {
    font-weight: bold;
    margin-top: 5px;
    text-align: center;
}

/* Color for negative charge display values */
.charge-value.negative {
    color: #3498db;
}

/* Color for positive charge display values */
.charge-value.positive {
    color: #e74c3c;
}

.information-panel {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
}

#physics-info {
    font-size: 14px;
    line-height: 1.8;
}

#physics-info p {
    margin-bottom: 5px;
}

#physics-info span {
    font-weight: bold;
}

.positive-charge {
    color: #e74c3c;
}

.negative-charge {
    color: #3498db;
}

.neutral-charge {
    color: #7f8c8d;
}

.instructions-container {
    margin-top: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.instructions-section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.instructions-section h3 {
    color: #3498db;
    margin: 20px 0 10px;
}

.instructions-section ul, 
.instructions-section ol {
    padding-left: 20px;
    margin-bottom: 15px;
}

.instructions-section li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.instructions-section p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.instructions-section strong {
    color: #2c3e50;
}

/* Explanation panel improvements */
.explanation-panel {
    background-color: #ffffff;
    color: #333333;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Modal version of explanation panel */
.explanation-panel.modal-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Darker, more opaque overlay */
    z-index: 1000;
    overflow-y: auto;
    padding: 0; /* Override the padding from explanation-panel */
}

.explanation-panel.modal-dialog.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.explanation-panel.modal-dialog .explanation-content {
    background-color: #ffffff; /* Solid white background */
    margin: 3% auto;
    width: 90%;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
}

.explanation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    background-color: #ffffff; /* Ensure header has solid background */
}

.explanation-header h3 {
    font-size: 18px;
    color: #007bff;
}

.explanation-content {
    margin-top: 20px;
    line-height: 1.6;
}

.explanation-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.explanation-nav-btn {
    background-color: #007bff;
    color: #ffffff;
    border: 1px solid #0056b3;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    opacity: 0.7;
}

.explanation-nav-btn.active {
    background-color: #007bff;
    color: #ffffff;
    opacity: 1;
}

/* Hide inactive tabs */
.explanation-section {
    display: none;
}

.explanation-section.active {
    display: block;
}

.explanation-nav-btn:hover {
    background-color: #0056b3;
    color: #ffffff;
    opacity: 1;
}

/* Add these styles for the detailed explanation section */

.detailed-explanation {
    margin: 40px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.detailed-explanation h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

/* Tab navigation */
.explanation-tab {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.explanation-tab button {
    background-color: #007bff;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 10px 20px;
    margin: 5px;
    transition: 0.3s;
    font-size: 16px;
    border-radius: 5px 5px 0 0;
    color: white;
    opacity: 0.7;
}

.explanation-tab button:hover {
    background-color: #0056b3;
    opacity: 0.9;
}

.explanation-tab button.active {
    background-color: #007bff;
    color: white;
    opacity: 1;
}

/* Tab content */
.tabcontent {
    display: none;
    padding: 20px;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    animation: fadeEffect 1s;
}

@keyframes fadeEffect {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* Scenario containers */
.scenario-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    margin: 20px 0;
}

.scenario {
    flex: 1;
    min-width: 300px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: white;
}

.scenario h4 {
    color: #3498db;
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.scenario-img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 15px auto;
    border: 1px solid #eee;
    border-radius: 4px;
}

/* Key points */
.key-point {
    background-color: #ebf5fb;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin: 20px 0;
}

.key-point p {
    margin: 0;
}

/* Summary table */
.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.summary-table th, .summary-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.summary-table th {
    background-color: #f2f2f2;
    color: #333;
}

.summary-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.summary-table tr:hover {
    background-color: #f1f1f1;
}

/* Key takeaways */
.takeaways {
    list-style-type: none;
    padding-left: 0;
}

.takeaways li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.takeaways li:last-child {
    border-bottom: none;
}

/* Experiment suggestion */
.experiment-suggestion {
    background-color: #e8f8f5;
    border: 1px solid #1abc9c;
    border-radius: 8px;
    padding: 15px;
    margin-top: 30px;
}

.experiment-suggestion h4 {
    color: #1abc9c;
    margin-top: 0;
}

.experiment-suggestion ol {
    padding-left: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .scenario-container {
        flex-direction: column;
    }
    
    .scenario {
        min-width: auto;
    }
    
    .explanation-tab button {
        flex-grow: 1;
        text-align: center;
    }
}

/* Modal Dialog for Advanced Explanation */
.modal-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    background-color: #ffffff;
    margin: 5% auto;
    width: 90%;
    max-width: 900px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    max-height: 90%;
    overflow-y: auto;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #2c3e50;
}

.modal-body {
    padding: 20px;
}

.close-button {
    background-color: transparent;
    border: none;
    color: #777;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
    padding: 0;
}

.close-button:hover {
    color: #333;
    transform: scale(1.1);
}

/* Advanced Link Button */
.advanced-link {
    text-align: center;
    margin-top: 20px;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Method buttons - Visual charging mode selection */
.method-buttons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.method-button {
   