/* ============================================================
   GLOBAL LAYOUT
   ============================================================ */

body {
    font-family: Arial, sans-serif;
    background-color: #f4f7fb;
    color: #333;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* ============================================================
   TOP NAVIGATION
   ============================================================ */

.top-nav {
    width: 100%;
    background-color: #fff;
    padding: 10px 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center; /* Center buttons */
    gap: 6px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-nav button {
    min-width: 90px;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    background-color: #3f51b5;
    color: white;
    transition: 0.2s;
}

.top-nav button:hover {
    background-color: #32429b;
}

/* ============================================================
   CONTAINER / CARD
   ============================================================ */

.container {
    background-color: #fff;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
    width: 90%;
    max-width: 900px;
    margin: 20px auto 40px auto;
}

/* ============================================================
   HEADINGS
   ============================================================ */

h1 {
    color: #3f51b5;
    font-size: 26px;
    margin-bottom: 20px;
    text-align: center;
}

/* ============================================================
   SWITCH LIST
   ============================================================ */

.switch-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #eef1fb;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.switch-label {
    font-size: 18px;
}

/* Toggle Switch UI */
.switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 30px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #bbb;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    border-radius: 50%;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #3f51b5;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.add-btn {
    background-color: #3f51b5;
    color: white;
    padding: 10px 14px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 18px;
    width: 100%;
}

.add-btn:hover {
    background-color: #32429b;
}

/* ============================================================
   TABLE (STORAGE / LOGS)
   ============================================================ */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    padding: 10px 12px;
    text-align: left;
}

th {
    background-color: #eef1fb;
    font-weight: bold;
    border-bottom: 2px solid #ddd;
}

td {
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

tr:hover td {
    background-color: #f6f8ff;
}

.no-data {
    text-align: center;
    color: #777;
    margin-top: 20px;
}

/* ============================================================
   LOG BOX (MQTT Live)
   ============================================================ */

.log-box {
    max-height: 60vh;
    overflow-y: auto;
    background-color: #111;
    color: #eee;
    padding: 10px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
}
