body {
    background-color: #000000;
    color: #00FF00;
    font-family: 'Courier New', monospace;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header, .footer {
    background-color: #111;
    color: #00FF00;
    padding: 15px;
    text-align: center;
    font-size: 18px;
}

/* ====== МЕНЮ ====== */
.menu {
    display: flex;
    justify-content: center;      /* центрируем */
    gap: 40px;                    /* расстояние между пунктами */
    background-color: #111;
    padding: 10px 0;
    border-radius: 5px;
    margin-bottom: 20px;
    white-space: nowrap;          /* чтобы пункты не переносились */
}

.menu-item {
    font-size: 16px;
    cursor: pointer;
}

/* ссылки в меню */
.menu-item a {
    font-family: 'Courier New', monospace;
    padding: 5px 10px;
}

/* ====== ГЛОБАЛЬНЫЕ ССЫЛКИ ====== */
a {
    color: #00aa00 !important;        /* тёмно-зелёный по умолчанию */
    text-decoration: none !important;
}

a:visited {
    color: #008800 !important;        /* немного темнее для посещённых */
}

a:hover {
    color: #00ff00 !important;        /* ярко-зелёный при наведении */
    text-decoration: underline;
}

a:active {
    color: #00ff00 !important;
}

/* ====== ТЕРМИНАЛ ====== */

.terminal {
    background-color: #111;
    border: 2px solid #00FF00;
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
}

.terminal-header {
    color: #00FF00;
    font-size: 20px;
    font-weight: bold;
}

.terminal-body {
    margin-top: 10px;
    font-size: 16px;
}

.code-block {
    background-color: #222;
    padding: 15px;
    border: 1px solid #00FF00;
    margin-top: 10px;
    font-size: 14px;
    color: #00FF00;
    white-space: pre-wrap;
    border-radius: 5px;
}

.console-line {
    margin: 5px 0;
}

.input {
    color: #00FF00;
    border: none;
    background: transparent;
    width: 100%;
    padding: 5px;
    font-size: 16px;
}

.input:focus {
    outline: none;
}

/* Кнопки */

.button {
    background-color: #00FF00;
    color: black;
    padding: 10px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    margin-top: 20px;
}

.button:hover {
    background-color: #00CC00;
}

/* Блок авторизации */

.auth-block {
    margin-top: 30px;
    background-color: #111;
    padding: 20px;
    border-radius: 10px;
}

.auth-header {
    font-size: 18px;
    color: #00FF00;
    font-weight: bold;
    margin-bottom: 10px;
}

.auth-input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #00FF00;
    background-color: #222;
    color: #00FF00;
    font-size: 16px;
    border-radius: 5px;
}

.auth-button {
    background-color: #00FF00;
    color: black;
    padding: 10px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    width: 100%;
}

.auth-button:hover {
    background-color: #00CC00;
}

.sensor-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.sensor-table th,
.sensor-table td {
    border: 1px solid #00FF00;
    padding: 4px 6px;
    text-align: center;
}

.sensor-table th {
    background-color: #111;
    font-weight: bold;
}

.sensor-table tr:nth-child(even) {
    background-color: #151515;
}

.sensor-table tr:nth-child(odd) {
    background-color: #000000;
}

/* Размер графика */
#sensorChart {
    max-width: 100%;
    height: 260px;
}

/* ===== АДАПТАЦИЯ ДЛЯ ПЛАНШЕТОВ (до 768px) ===== */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header, .footer {
        font-size: 16px;
        padding: 10px;
    }

    .menu {
        gap: 15px;              /* поменьше расстояние между пунктами */
        padding: 8px 0;
        flex-wrap: wrap;        /* разрешаем перенос меню */
    }

    .menu-item a {
        font-size: 14px;
        padding: 4px 8px;
    }

    .terminal {
        padding: 15px;
        margin: 15px 0;
    }

    .code-block {
        font-size: 13px;
        padding: 10px;
    }

    .auth-block {
        margin-top: 20px;
        padding: 15px;
    }

    .auth-input,
    .auth-button {
        font-size: 14px;
        padding: 8px;
    }

    /* Чтобы таблица с датчиками не ломала страницу */
    .sensor-table {
        font-size: 12px;
    }

    /* делаем код-блок прокручиваемым по горизонтали, если не влазит */
    .code-block {
        overflow-x: auto;
    }

    #sensorChart {
        height: 220px;
    }
}



        .tabs {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin-top: 20px;
        }

        .tab-button {
            background-color: #111;
            color: #00FF00;
            border: 2px solid #00FF00;
            padding: 10px 20px;
            font-size: 16px;
            font-family: 'Courier New', monospace;
            cursor: pointer;
            transition: background-color 0.3s, color 0.3s;
            border-radius: 5px;
        }

        .tab-button:hover {
            background-color: #00FF00;
            color: #111;
        }

        .tab-button:focus {
            outline: none;
            background-color: #00FF00;
            color: #111;
        }



        .tab-buttons {
            background-color: #111;
            color: #00FF00;
            border: 2px solid #00FF00;
            padding: 8px 10px;

            font-family: 'Courier New', monospace;
            cursor: pointer;
            transition: background-color 0.3s, color 0.3s;
            border-radius: 6px;
        }

        .tab-buttons:hover {
            background-color: #00FF00;
            color: #111;
        }

        .tab-buttons:focus {
            outline: none;
            background-color: #00FF00;
            color: #111;
        }


        /* Стили для скрытия блока авторизации */
        .auth-block {
            display: <?php echo isset($_SESSION['user_id']) ? 'none' : 'block'; ?>;
        }

        .auth-header {
            color: #00FF00;
            font-family: 'Courier New', monospace;
            font-size: 24px;
            text-align: center;
        }

        .auth-input {
            width: 100%;
            padding: 10px;
            margin: 10px 0;
            font-family: 'Courier New', monospace;
            border: 2px solid #00FF00;
            background-color: #111;
            color: #00FF00;
        }

        .auth-button {
            background-color: #00FF00;
            color: #111;
            padding: 10px 20px;
            border: none;
            font-family: 'Courier New', monospace;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        .auth-button:hover {
            background-color: #00cc00;
        }


/* ===== АДАПТАЦИЯ ДЛЯ ТЕЛЕФОНОВ (до 480px) ===== */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 8px;
    }

    .header, .footer {
        font-size: 14px;
    }

    .menu {
        flex-direction: column;   /* меню в колонку */
        align-items: center;
        gap: 8px;
    }

    .menu-item a {
        display: block;
        font-size: 14px;
    }

    .terminal-header {
        font-size: 16px;
    }

    .console-line {
        font-size: 13px;
    }

    .sensor-table th,
    .sensor-table td {
        padding: 3px 4px;
    }

    .auth-block {
        margin-top: 15px;
    }

    .auth-input,
    .auth-button {
        font-size: 13px;
        padding: 7px;
    }

    #sensorChart {
        height: 200px;
    }
}
