/* ==============================================
   Bongo Bins Simulator — Global Styles
   ============================================== */

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    background: #0d1117;
    color: #c9d1d9;
    height: 100%;
}

/* ---- App shell ---- */

.sim-app {
    display: flex;
    min-height: 100vh;
}

.sim-sidebar {
    width: 200px;
    background: #161b22;
    border-right: 1px solid #30363d;
    padding: 1rem 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sim-brand {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: #58a6ff;
    text-align: center;
    padding: 0.5rem 1rem 1rem;
    border-bottom: 1px solid #30363d;
    margin-bottom: 0.5rem;
}

.sim-nav-link {
    display: block;
    padding: 0.6rem 1.2rem;
    color: #8b949e;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.sim-nav-link:hover {
    color: #c9d1d9;
    background: #21262d;
}

.sim-nav-link.active {
    color: #58a6ff;
    background: #1c2128;
    border-left: 3px solid #58a6ff;
}

.sim-nav-icon {
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.sim-main {
    flex: 1;
    padding: 1.5rem 2rem;
    overflow-y: auto;
}

/* ---- Page headings ---- */

.page-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #e6edf3;
    letter-spacing: 1px;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #21262d;
}

/* ---- Cards ---- */

.sim-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.sim-card:hover {
    border-color: #484f58;
}

.sim-card-offline {
    opacity: 0.55;
    border-color: #f47067;
}

.sim-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #21262d;
}

.sim-card-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: #e6edf3;
}

/* ---- Status badges ---- */

.badge-connected {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    background: #1b4332;
    color: #6fdd8b;
    border: 1px solid #238636;
    letter-spacing: 0.5px;
}

.badge-disconnected {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    background: #4a1a1a;
    color: #f47067;
    border: 1px solid #da3633;
    letter-spacing: 0.5px;
}

/* ---- Toggle switch ---- */

.sim-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: #8b949e;
}

.sim-toggle input[type="checkbox"] {
    appearance: none;
    width: 36px;
    height: 20px;
    background: #30363d;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.sim-toggle input[type="checkbox"]::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #8b949e;
    top: 2px;
    left: 2px;
    transition: all 0.2s;
}

.sim-toggle input[type="checkbox"]:checked {
    background: #238636;
}

.sim-toggle input[type="checkbox"]:checked::after {
    background: #ffffff;
    left: 18px;
}

/* ---- Slider / range ---- */

.sim-slider-group {
    margin-bottom: 0.6rem;
}

.sim-slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #8b949e;
    margin-bottom: 0.2rem;
}

.sim-slider-value {
    font-family: 'Consolas', 'Courier New', monospace;
    font-weight: 700;
    color: #e6edf3;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    appearance: none;
    background: #30363d;
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #58a6ff;
    cursor: pointer;
    border: 2px solid #0d1117;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #58a6ff;
    cursor: pointer;
    border: 2px solid #0d1117;
}

input[type="range"].temp-slider::-webkit-slider-thumb { background: #f0883e; }
input[type="range"].temp-slider::-moz-range-thumb { background: #f0883e; }
input[type="range"].rh-slider::-webkit-slider-thumb { background: #58a6ff; }
input[type="range"].rh-slider::-moz-range-thumb { background: #58a6ff; }

/* ---- Select / dropdown ---- */

.sim-select {
    background: #21262d;
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.sim-select:focus {
    border-color: #58a6ff;
    outline: none;
}

/* ---- Number input ---- */

.sim-input {
    background: #21262d;
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    font-family: 'Consolas', monospace;
    width: 80px;
}

.sim-input:focus {
    border-color: #58a6ff;
    outline: none;
}

/* ---- Grid helpers ---- */

.sim-grid {
    display: grid;
    gap: 1rem;
}

.sim-grid-2 { grid-template-columns: repeat(2, 1fr); }
.sim-grid-3 { grid-template-columns: repeat(3, 1fr); }
.sim-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
    .sim-grid-3, .sim-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .sim-grid-2, .sim-grid-3, .sim-grid-4 { grid-template-columns: 1fr; }
    .sim-sidebar { width: 160px; }
}

/* ---- Section dividers ---- */

.sim-section {
    font-size: 0.75rem;
    font-weight: 700;
    color: #484f58;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #21262d;
}

/* ---- Overview stat ---- */

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'Consolas', monospace;
    color: #e6edf3;
}

.stat-label {
    font-size: 0.7rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---- Buttons ---- */

.sim-btn {
    background: #21262d;
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-radius: 6px;
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.sim-btn:hover {
    background: #30363d;
    border-color: #484f58;
    color: #e6edf3;
}
