/* Simulator page styles */

.simulator-panel {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: #1e1e2e;
    border-radius: 12px;
    border: 1px solid #333;
}

/* 080: guidance box in the empty space left of the centred simulator form. Three columns keep
   the form centred; below 1100px the box stacks above the form instead. */
.sim-info {
    max-width: 600px;
    margin: 2rem auto 0;
    background: rgba(255, 193, 7, 0.10);
    border: 1px solid rgba(255, 193, 7, 0.45);
    border-left: 5px solid #FFC107;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    color: #e0e0e0;
    font-size: 1.05rem;
}
@media (min-width: 1100px) {
    body.sim-page .main-content {
        display: grid;
        grid-template-columns: 1fr minmax(0, 600px) 1fr;
        column-gap: 2rem;
        align-items: start;
    }
    .sim-info { grid-column: 1; justify-self: end; max-width: 380px; margin: 2rem 0 0; }
    .simulator-panel { grid-column: 2; width: 100%; box-sizing: border-box; }
}
.sim-info summary {
    cursor: pointer;
    color: #FFC107;
    font-weight: 700;
    font-size: 1.2rem;
}
.sim-info ul {
    margin: 0.75rem 0 0;
    padding-left: 1.2rem;
    line-height: 1.6;
}
.sim-info li + li { margin-top: 0.5rem; }
.sim-info-warn { color: #ff8a65; }

.simulator-panel h2 {
    margin-top: 0;
    color: #e0e0e0;
}

.simulator-status {
    margin-bottom: 1.5rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1rem;
}

.status-badge.running {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.status-badge.stopped {
    background: rgba(244, 67, 54, 0.15);
    color: #F44336;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.running { background: #4CAF50; }
.status-dot.stopped { background: #F44336; }

.status-details {
    margin-top: 1rem;
    color: #aaa;
}

.status-details p { margin: 4px 0; }
.status-details strong { color: #e0e0e0; }

.simulator-controls {
    display: flex;
    /* Without wrap, the full-width sensor-names group cannot take a row of its own and is
       squashed into the same line as the count dropdown — the count label ends up beside the
       name boxes instead of above them. */
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
    margin-top: 1.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-group label {
    color: #aaa;
    font-size: 0.85rem;
    font-weight: 500;
}

.sensor-dropdown {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #555;
    background: #2a2a3e;
    color: #e0e0e0;
    font-size: 1rem;
    cursor: pointer;
}

.sensor-dropdown:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.simulator-btn {
    padding: 10px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.simulator-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.start-btn { background: #4CAF50; color: white; }
.start-btn:hover:not(:disabled) { background: #43A047; }

.stop-btn { background: #F44336; color: white; }
.stop-btn:hover:not(:disabled) { background: #E53935; }

.local-mode-notice {
    margin-top: 1rem;
    padding: 12px;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    color: #FFC107;
    font-size: 0.9rem;
}

.simulator-message {
    margin-top: 1rem;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.simulator-message.success {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.simulator-message.error {
    background: rgba(244, 67, 54, 0.15);
    color: #F44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

/* Work in progress — an interval change waits on both pipeline services restarting, which can take
   up to a minute. Deliberately not auto-hidden (see showMessage): a blank panel mid-wait reads as
   a hang. Blue rather than green or red, because the outcome is not known yet. */
.simulator-message.info {
    background: rgba(108, 140, 255, 0.15);
    color: #6c8cff;
    border: 1px solid rgba(108, 140, 255, 0.3);
}

/* Sensor name fields (one per sensor, up to the API's MAX_SENSORS). */
.sensor-names-group {
    flex: 1 1 100%;
    min-width: 0;
}

.control-group label .hint {
    color: #777;
    font-weight: 400;
    font-size: 0.78rem;
}

#sensor-names {
    display: grid;
    /* Wraps to as many columns as fit, so ten fields stay readable on a laptop and collapse
       to one column on a phone without a breakpoint. */
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 8px;
    margin-top: 6px;
}

.sensor-name-input {
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid #555;
    background: #2a2a3e;
    color: #e0e0e0;
    font-size: 0.92rem;
    min-width: 0;
}

.sensor-name-input::placeholder {
    color: #6a6a7a;
}

.sensor-name-input:focus {
    outline: none;
    border-color: #6c8cff;
}

.sensor-name-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
