* {  
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #f5f5f5;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    width: 95%;
    max-width: 1200px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Styling for the theme switch */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.theme-switch .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 2px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.theme-switch input:checked + .slider {
    background-color: #4CAF50;
}

.theme-switch input:checked + .slider:before {
    transform: translateX(26px);
}

.main-content {
    display: flex;
    gap: 20px;
}

.settings-panel {
    width: 25%;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: inherit;
}

input, select, button {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-size: 1em;
}

button {
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #45a049;
}

.plot-container {
    width: 70%; /* Give more space to the plot */
    display: flex;
    justify-content: center;
    align-items: center;
}

.plot-area {
    width: 100%;
    height: 600px; /* Increase height for a more prominent display */
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fafafa;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* Add shadow for emphasis */
}

.error-message {
    color: red;
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
}

.result-display {
    margin-top: 10px;
    font-weight: bold;
    text-align: center;
}

/* Dark Mode */
body.dark-mode {
    background: #2c2c2c;
    color: #f1f1f1;
}

body.dark-mode .container {
    background: #333;
    color: #f1f1f1;
}

body.dark-mode .settings-panel {
    background: #3c3c3c;
}

body.dark-mode input, 
body.dark-mode select, 
body.dark-mode button {
    background: #444;
    color: #f1f1f1;
    border: 1px solid #555;
}

body.dark-mode .plot-area {
    background-color: #444;
    border-color: #555;
}

body.dark-mode .input-group label,
body.dark-mode .theme-toggle {
    color: #f1f1f1;
}

body.dark-mode .error-message {
    color: #ff6666;
}

/* Modal Popup Styling */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4); /* Black with opacity */
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin-top: 0;
    font-size: 1.2em;
    font-weight: bold;
}

.modal-content ul {
    padding-left: 20px;
    list-style-type: disc;
}

.modal-content code {
    background-color: #eee;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.95em;
    color: #333;
}

.close {
    color: #aaa;
    float: right;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
}

.close:hover, .close:focus {
    color: #000;
    text-decoration: none;
}

/* Additional Styling for Detailed Calculation Display */
.modal-content .calculation-steps {
    font-family: 'Courier New', monospace;
    font-size: 1em;
    color: #444;
    line-height: 1.6;
}

.modal-content .calculation-steps h4 {
    font-size: 1.1em;
    font-weight: bold;
    margin-top: 10px;
}

.modal-content .calculation-steps p,
.modal-content .calculation-steps ul {
    margin: 10px 0;
}

.modal-content .calculation-steps code {
    display: block;
    background-color: #f4f4f4;
    padding: 10px;
    border-radius: 5px;
    margin: 5px 0;
    font-size: 0.9em;
    color: #333;
}

/* Improved Tips Modal Styling */
.modal-content .calculation-steps {
    font-family: 'Courier New', monospace;
    font-size: 1em;
    color: #444;
    line-height: 1.6;
}

.modal-content h3 {
    font-size: 1.4em;
    font-weight: bold;
    color: #333;
}

.modal-content ul, .modal-content p {
    margin: 10px 0;
}

.modal-content ul li {
    margin: 5px 0;
}

body.dark-mode .modal-content {
    background-color: #2c2c2c;
    color: #f1f1f1;
}
