:root {
    /* Flet Dark Theme Colors */
    --surface-bg: #1c1c1e;
    --card-bg: #2b2b2d;
    --text-main: #e3e3e3;
    --text-muted: #9e9e9e;
    --blue-200: #90caf9;
    --blue-400: #42a5f5;
    --green-400: #66bb6a;
    --orange-200: #ffcc80;
    --orange-400: #ffa726;
    --red-400: #ef5350;
    --border-radius: 10px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--surface-bg);
    color: var(--text-main);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 { color: var(--blue-200); font-size: 28px; }
.version { color: var(--text-muted); font-size: 12px; display: block; }

.controls-card {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

/* File Input Styling */
.file-upload-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.file-input {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 24px; /* Pill shape */
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
    text-transform: uppercase;
    font-size: 14px;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:hover:not(:disabled) { opacity: 0.9; }

.btn-primary {
    background-color: var(--blue-400);
    color: #000;
    flex-grow: 1;
}

.btn-secondary {
    background-color: #424242;
    color: var(--blue-200);
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 15px;
    background-color: var(--card-bg);
    color: var(--text-muted);
    border: 1px solid #424242;
}

.btn-small:hover {
    color: var(--blue-200);
    border-color: var(--blue-200);
}

.icon-small {
    margin-right: 4px;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.input-group input[type="number"] {
    background-color: #1e1e1e;
    border: 1px solid #424242;
    color: var(--text-main);
    padding: 10px;
    border-radius: 8px;
    font-size: 16px;
}

.input-group input[type="number"]:focus {
    outline: none;
    border-color: var(--blue-400);
}

/* Toggles */
.settings-toggles {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-group {
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 14px;
}

.switch-group {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

/* Switch (CSS Only) */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #424242;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider { background-color: var(--blue-400); }
input:checked + .slider:before { transform: translateX(20px); }
.slider.round { border-radius: 20px; }
.slider.round:before { border-radius: 50%; }

/* Status & Progress */
.status-msg {
    text-align: center;
    color: var(--blue-400);
    font-style: italic;
    margin-bottom: 10px;
    min-height: 24px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: #424242;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    width: 30%;
    height: 100%;
    background-color: var(--blue-400);
    animation: indeterminate 1.5s infinite linear;
    transform-origin: 0% 50%;
}

@keyframes indeterminate {
    0% { transform: translateX(0) scaleX(0); }
    40% { transform: translateX(0) scaleX(0.4); }
    100% { transform: translateX(100%) scaleX(0.5); }
}

.hidden { display: none !important; }

/* Results Layout */
.results-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.section-title {
    color: var(--blue-200);
    font-size: 18px;
    font-weight: bold;
    margin-top: 10px;
    margin-bottom: 5px;
}

.row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-box {
    background-color: var(--card-bg);
    padding: 12px;
    border-radius: var(--border-radius);
    text-align: center;
}

.stat-label { font-size: 14px; color: var(--text-main); }
.stat-value { font-size: 22px; font-weight: bold; margin: 4px 0; }
.stat-sub { font-size: 22px; font-weight: bold; color: var(--text-main); margin: 4px 0; }
.stat-sub-muted { font-size: 12px; color: var(--text-muted); }

.text-green { color: var(--green-400); }
.text-orange { color: var(--orange-400); }
.text-orange-muted { color: var(--orange-200); }
.text-red { color: var(--red-400); }

.list-item {
    padding: 10px 0;
    border-bottom: 1px solid #333;
}
.list-item:last-child { border-bottom: none; }
.list-title { font-size: 14px; font-weight: bold; }
.list-sub { font-size: 12px; color: var(--text-muted); }

/* Max Speeds Scroll */
.horizontal-scroll {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 10px;
}

.speed-box {
    min-width: 90px;
    background-color: var(--card-bg);
    padding: 10px;
    border-radius: var(--border-radius);
    text-align: center;
    flex-shrink: 0;
}

/* Histogram */
.hist-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    font-size: 11px;
}
.hist-label { width: 65px; font-weight: bold; }
.hist-bar-container { flex-grow: 1; height: 15px; }
.hist-bar { height: 100%; border-radius: 3px; }
.hist-val { width: 80px; text-align: right; }
