/* General Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

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

header {
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
    border-radius: 5px;
}

.main-content {
    display: flex;
    gap: 20px;
}

/* Sidebar Styles */
.sidebar {
    width: 350px;
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 5px;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-info {
    background-color: #2ecc71;
    color: white;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn:hover {
    opacity: 0.8;
}

/* Tab Styles */
.tabs {
    margin-top: 20px;
}

.tab-buttons {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 15px;
}

.tab-button {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    position: relative;
}

.tab-button.active {
    color: #3498db;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #3498db;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Main Panel Styles */
.main-panel {
    flex: 1;
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#myPlot {
    width: 100%;
    height: 400px;
    margin: 20px 0;
}

.controls {
    margin-bottom: 20px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 80px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #3498db;
}

input:checked + .slider:before {
    transform: translateX(46px);
}

.slider-label {
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    transform: translateY(-50%);
    left: 10px;
    right: 10px;
    text-align: center;
}

.slider-label::before {
    content: attr(data-off);
}

input:checked + .slider .slider-label::before {
    content: attr(data-on);
}

/* Range Controls */
.range-controls {
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-controls input[type="range"] {
    flex: 1;
}

.range-controls input[type="number"] {
    width: 100px;
}

.hidden {
    display: none !important;
}

/* Current Parameters */
.current-params {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

/* Probability Display */
.probability-display {
    font-size: 16px;
    font-weight: bold;
    color: #3498db;
    margin-top: 10px;
}

/* Metadata */
.metadata {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 12px;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #666;
}

/* Highlighted Input */
.highlight {
    animation: highlight 1s ease-in-out;
}

@keyframes highlight {
    0% { background-color: #fff3cd; }
    100% { background-color: white; }
}

/* SD Control */
.sd-control {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sd-control label {
    font-size: 12px;
    margin: 0;
}

.sd-control input {
    width: 60px;
}

/* Model Summary */
#modelSummary, #gofMetrics {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
}

/* Export Section */
.export-section {
    padding: 20px;
}

.export-section h3 {
    margin-bottom: 10px;
}

.export-section p {
    margin-bottom: 20px;
    color: #666;
}

.code-section {
    margin-bottom: 30px;
}

.code-section h4 {
    margin-bottom: 10px;
    color: #333;
}

.code-export {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    white-space: pre-wrap;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    margin-bottom: 10px;
}

/* Hide elements based on calculator/modeler mode */
.calculator-mode #metrics-tab,
.calculator-mode #export-tab {
    display: none;
}