/* Styling applied to all elements */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

strong {
    font-size: 115%;
}

/* Body styling */
body {
    background-color: #ffffff;
    color: #000000;
    line-height: 1.4;
}

/* Input box style */
input[type=number], input[type=text] {
    width: 80px;
    margin: 1px 3px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    -webkit-transition: border 0.3s ease-in-out, width 0.3s ease-in-out; /* Animation for Safari and Chrome */
    -moz-transition: border 0.3s ease-in-out, width 0.3s ease-in-out; /* Animation for FireFox */
    transition: border 0.3s ease-in-out, width 0.3s ease-in-out; /* Animation for other browsers */
}

/* Effects when the input box is focused */
input[type=number]:focus, input[type=text]:focus {
    border: 3px solid #ccc;
    width: 120px;
    outline: none;
}

/* Button styling */
button, input[type=button], input[type=reset], input[type=submit] {
    background-color: #26A69A;
    border: none;
    border-radius: 4px;
    color: white;
    padding: 6px 6px;
    text-decoration: none;
    margin: 0px 5px;
    cursor: pointer;
}

/* Button hover effect */
button:hover {
    background-color: #00897B;
}

/* Disabled button styling */
button:disabled {
    background-color: #e0e0e0;
    color: #9e9e9e;
    cursor: not-allowed;
}

/* Stop button styling */
.stop-button {
    background-color: #ef5350;
}

/* Stop button hover effect */
.stop-button:hover {
    background-color: #e53935;
}

/* Header styling */
.header {
    background-color: #26A69A;
    color: #ffffff;
    padding: 10px 5px;
    margin-bottom: 4px;
    text-align: center;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Header title spacing */
.header h1 {
    margin-bottom: 5px;
}

/* Subtitle text styling */
.subtitle {
    color: #ffffff;
    margin: 4px 0 5px;
}

/* Version number styling */
.version {
    font-size: 12px;
    color: #e0e0e0;
    font-style: italic;
    margin-bottom: 10px;
}

/* Tab container - holds the figure tab buttons */
.tab-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

/* Tab button styling */
.tab-button {
    font-size: 115%;
    width: 100%;
    padding: 6px 12px;
    background-color: #4DB6AC;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
}

/* Tab button hover effect */
.tab-button:hover {
    background-color: #26A69A;
}

/* Active tab button styling */
.tab-button.active {
    background-color: #00897B;
}

/* Tab content - hidden by default */
.tab-content {
    display: none;
}

/* Active tab content - shown when selected */
.tab-content.active {
    display: block;
}

/* Main container - holds left panel and right panel side by side */
.main-container {
    display: flex;
    padding: 4px;
}

/* Left panel - contains parameter controls */
.left-panel {
    width: 320px;
    padding: 4px;
}

/* Right panel - contains plots */
.right-panel {
    flex: 1;
    padding: 4px;
}

/* Section styling - groups of related parameters */
.section {
    margin: 8px 5px;
    padding: 8px;
    border: 2px solid #aaa;
    border-radius: 4px;
    background-color: #aaa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}

/* Section header styling */
.section h2 {
    font-size: 115%;
    font-weight: bold;
    margin-bottom: 8px;
    color: #000000;
}

/* Parameter row - label and input on the same line */
.param-row {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Parameter label styling */
.param-row label {
    color: #000000;
    flex: 1;
}

/* Italic text in parameter labels */
.param-row label em {
    font-style: italic;
}

/* Subscript text in parameter labels */
.param-row label sub {
    font-size: smaller;
}

/* Control buttons container */
.control-buttons {
    margin-bottom: 10px;
}

/* Simulation button styling */
.sim-button {
    font-size: 115%;
    display: block;
    width: 100%;
    margin-bottom: 6px;
    padding: 6px 6px;
    background-color: #26A69A;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    text-align: center;
}

/* Simulation button hover effect */
.sim-button:hover {
    background-color: #00897B;
}

/* Disabled simulation button styling */
.sim-button:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
}

/* Status area - shows simulation progress */
.status-area {
    text-align: center;
    margin-top: 10px;
}

/* Progress bar container */
.progress-container {
    width: 100%;
    height: 16px;
    background-color: #e0e0e0;
    border: 1px solid #999999;
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
}

/* Progress bar fill */
.progress-bar {
    width: 0%;
    height: 100%;
    background-color: #26A69A;
    transition: width 0.3s ease;
}

/* Status text styling */
.status {
    font-size: 12px;
    color: #333333;
}

/* Plot grid - 2x2 layout for figure plots */
.plot-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 4px;
    border: 2px solid #c7c7c7;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}

/* Alternate 2x2 plot grid */
.plot-grid-2x2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 4px;
    border: 2px solid #c7c7c7;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}

/* Individual plot item background */
.plot-item {
    background-color: #c7c7c7;
}

/* Plot sizing */
.plots {
    width: 100%;
    height: auto;
}

/* Footer styling */
.footer {
    background-color: #26A69A;
    color: #ffffff;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 24px;
    padding: 12px 18px;
    margin-top: 4px;
    font-size: 14px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.footer p {
    margin: 0;
    line-height: 1.5;
}

.footer nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 22px;
}

.footer a {
    color: inherit;
    text-underline-offset: 3px;
}

.footer a:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 4px;
}

@media (max-width: 480px) {
    .footer {
        justify-content: center;
    }
}

/* Responsive design - single column plots on smaller screens */
@media only screen and (max-width: 1080px) {
    .plot-grid, .plot-grid-2x2 {
        grid-template-columns: repeat(1, 1fr);
        grid-template-rows: repeat(4, 1fr);
    }
}

/* Responsive design - stack panels vertically on mobile */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }

    .left-panel {
        width: 100%;
    }

    .plot-grid, .plot-grid-2x2 {
        grid-template-columns: 1fr;
    }
}

/* Expandable teaching notes below the simulation. */
.simulation-help {
  clear: both;
  margin: 18px 4px 12px;
  padding: 18px 22px;
  background: #fff;
  color: #263238;
  border: 1px solid #d6dfe3;
  border-radius: 8px;
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.simulation-help summary { cursor: pointer; font-size: 20px; font-weight: bold; }
.simulation-help summary:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.simulation-help h3 { margin: 20px 0 8px; font-size: 18px; }
.simulation-help p {
  margin: 10px 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  line-height: 1.6;
}
.simulation-help ol { padding-left: 1.5em; }
.simulation-help li { margin: 8px 0; }
.simulation-help a { color: inherit; text-underline-offset: 3px; }

