//* Keep the whole UI phone-sized even on desktop */
body {
    max-width: 420px;
    margin: 0 auto;
    padding: 15px;
    background: #e9ecef;
    font-family: Arial, sans-serif;
}

/* Card layout */
.card {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    margin-bottom: 20px;
}

h2 {
    margin-top: 0;
    font-size: 20px;
    text-align: center;
}

/* Inputs */
label {
    font-weight: bold;
    display: block;
    margin-bottom: 6px;
}

/* Generic number inputs (leave as-is if used elsewhere) */
input[type="number"] {
    width: 100%;
    padding: 10px;
    font-size: 18px;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

button {
    padding: 12px;
    font-size: 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    background: #007bff;
    color: white;
}

button:active {
    opacity: 0.8;
}

button:disabled {
    opacity: 0.4;
	border-color: #222;
	cursor:not-allowed;
}

.direction-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.dir-btn {
    display: flex;
    align-items: center;   /* vertical centering */
    justify-content: center; /* horizontal centering */
    width: 40px;
    height: 40px;

    font-size: 2rem;
    background: #ccc;
    border: 1px solid #666;
    border-radius: 6px;
    cursor: pointer;
}


.dir-btn.active {
    background: #4caf50;
    color: red;
}

.dir-label {
    font-weight: bold;
	font-size: 1.5rem;
}


/* Direction buttons */
.direction-buttons {
    display: flex;
    gap: 10px;
}

.direction-buttons button {
    flex: 1;
    background: #6c757d;
}

.direction-buttons .active {
    background: #28a745;
}

.direction-buttons .activated {
    background: #28a745;
    color: red;

}

/* Switch buttons container */
.switch-buttons {
    display: flex;
    gap: 10px;
    align-items: center; /* vertical alignment */
}

/* Wrapper for the input (keeps alignment stable) */
.switch-input-wrap {
    display: flex;
    align-items: center;
}


/* Speed slider */
#speedValue {
    font-weight: bold;
    font-size: 22px;
    margin-top: 10px;
    display: block;
    text-align: center;
}

input[type="range"] {
    width: 100%;
    margin-top: 10px;


}

#speed:disabled {
    cursor: not-allowed;
}

/* Function buttons */
.functions-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    margin-top: 10px;
}

.functions-grid button {
    width: 48px;          /* smaller but still tappable */
    height: 40px;         /* consistent height */
    padding: 0;
    font-size: 0.9rem;      /* slightly smaller text */
    border-radius: 6px;
}


.functions-grid .active {
    background: #ffc107;
    color: black;
}

select {
    width: 100%;
    padding: 10px;
    font-size: 18px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background: white;
    box-sizing: border-box;
    appearance: none;          /* removes ugly default arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='gray' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
}

.btn-free {
    background-color: #4CAF50;   /* green */
    color: white;
}

.btn-inuse {
    background-color: #f44336;   /* red */
    color: white;
}

.btn-active {
    background-color: cyan;   /* Cyan */
    color: white;
}

.btn-idle {
    background-color: #ff9800;   /* orange */
    color: black;
}

.btn-consist {
    background-color: #2196F3;   /* blue */
    color: white;
}

.btn-unknown {
    background-color: #9E9E9E;   /* grey */
    color: white;
}

/* -----------------------------------------------------------
   Three-Column Layout (Modern Flexbox)
----------------------------------------------------------- */

.three-col {
  display: flex;
  gap: 20px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.three-col .col {
  flex: 1;
  min-width: 280px;
  background: #f1f1f1;
  padding: 20px;
  border-radius: 4px;
}

/* Switch buttons container */
.switch-buttons {
    display: flex;
    gap: 10px;
    align-items: center; /* vertical alignment */
}

/* FINAL switch input style — overrides generic input[type=number] */
.switch-buttons input.switch-Id {
    width: 70px;

    /* match button internal spacing */
    padding: 12px;
    font-size: 18px;
    line-height: 18px;

    /* match button shape */
    border-radius: 8px;
    border: none;

    /* match button box model */
    box-sizing: border-box;
    text-align: center;

    /* match button background */
    background: #6c757d;
    color: white;

    /* force identical vertical alignment */
    display: flex;
    align-items: center;
    justify-content: center;

    /* remove browser quirks */
    -moz-appearance: textfield;
}
.switch-buttons input.switch-Id::-webkit-inner-spin-button,
.switch-buttons input.switch-Id::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Switch buttons */
.switch-buttons button {
    flex: 1;
    background: #6c757d;
}

.switch-buttons .active {
    background: red;
}

.switch-buttons .activated {
    background: yellow;
    color: red;
}
