:root {
    --primary: #0056b3;
    --primary-hover: #004494;
    --bg-color: #f8f9fa;
    --panel-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #6c757d;
    --border: #dee2e6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.top-nav {
    background: var(--panel-bg);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-link {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
}

.logo-text {
    font-weight: bold;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.app-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 320px;
    background: var(--panel-bg);
    border-right: 1px solid var(--border);
    padding: 20px;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.02);
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

input[type="text"], input[type="number"], select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
}

.flex-row {
    display: flex;
    gap: 10px;
}

.hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.error-text {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 10px;
    font-weight: bold;
}

.primary-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.primary-btn:hover {
    background: var(--primary-hover);
}

.plot-area {
    flex: 1;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#plotContainer {
    width: 100%;
    height: 100%;
    background: var(--panel-bg);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: 40%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .plot-area {
        height: 60%;
    }
}


/* Footer */
footer {
    text-align: center;
    margin-top: 10px;
    padding: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-top: 0.5px solid #ddd;
    background-color: white;
}
footer a {
    color: var(--border-color);
    text-decoration: none;
    font-weight: bold;
}
footer a:hover {
    color: var(--accent-blue);
}
