:root {
    --primary: #ff7300;
    --primary-hover: #d88d1d;
    --bg-color: #ffffff;
    --card-bg: #2c3e50;
    --border: #e2e8f0;
    --text-main: #ffffff;
    --text-muted: #e5e5e5;
    --success: #1aa34d;
    --danger: #ff0303;
    --chart-fill: #3675db;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0px;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 900px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 0px solid var(--border);
    background: #3c556e;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: rgba(0, 0, 0, 0.2);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--card-bg);
}

/* Content Sections */
.tab-content {
    display: none;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Configuration Window */
.config-window {
    background: #507191;
    border: 0px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.config-title {
    margin-top: 0;
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 5px;
    display: inline-block;
}

.input-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.input-group label {
    font-weight: 500;
    margin-right: 10px;
}

.input-group input {
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 120px;
    font-size: 1rem;
    background-color: #ffffff; /* This changes the background color */
    color: #000000;            /* This ensures the text color is readable */
}

.error-msg {
    color: var(--danger);
    font-size: 1.00rem;
    margin-top: 5px;
    display: none;
    text-align: center;
    font-weight: bold;
}

/* Results Window */
.result-window {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
}

.result-stats {
    margin-bottom: 20px;
    padding: 15px;
    background: #507191;
    border-radius: 6px;
    border-left: 0px solid var(--primary);
}

.stat-line {
    margin: 5px 0;
    font-size: 1.3rem;
    text-align: center;
}

.stat-value {
    font-weight: 700;
    color: var(--primary);
}

/* Result Buttons Grid */
.result-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.res-btn {
    padding: 10px;
    background: #507191;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-size: 0.9rem;
}

.res-btn:hover {
    border-color: var(--primary);
    background: #3c556e;
}

.res-btn.active {
    background: var(--primary);
    color: rgb(255, 255, 255);
    border-color: var(--primary);
}

/* Diagram Area */
.diagram-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: rgb(0, 0, 0);
}

.legend {
    margin-top: 10px;
    font-size: 0.9rem;
    display: flex;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
}

.color-box {
    width: 15px;
    height: 15px;
    margin-right: 5px;
    border-radius: 3px;
    border: 1px solid var(--border);
}