* {
    box-sizing: border-box;
}

:root {
    --background: #07111f;
    --panel: #101f32;
    --panel-light: #152941;
    --border: #27435e;

    --text: #eef7ff;
    --muted: #8197aa;

    --accent: #00e5ff;

    --green: #36e29a;
    --red: #ff6677;

    --temperature: #ff735c;
    --humidity: #4cb4ff;
    --pressure: #b990ff;
    --light: #ffd45c;
    --gas: #55e0a3;
}

body {
    margin: 0;
    min-height: 100vh;

    background:
        radial-gradient(
            circle at top,
            #12304b 0%,
            #07111f 48%
        );

    color: var(--text);

    font-family:
        Arial,
        Helvetica,
        sans-serif;
}


/* HEADER */

.topbar {
    padding: 28px 45px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background:
        rgba(7, 17, 31, 0.9);

    border-bottom:
        1px solid var(--border);
}

.pixel-title {
    margin: 0;

    color: var(--accent);

    font-family:
        "Courier New",
        monospace;

    font-size: 29px;
    letter-spacing: 4px;

    text-shadow:
        0 0 8px
        rgba(0, 229, 255, 0.65);
}

.pixel-subtitle {
    margin: 9px 0 0;

    color: #9bdde8;

    font-family:
        "Courier New",
        monospace;

    font-size: 12px;
    font-weight: bold;

    letter-spacing: 2px;

    text-shadow:
        0 0 5px
        rgba(0, 229, 255, 0.25);
}

.system-badge {
    padding: 10px 15px;

    color: var(--green);

    background:
        rgba(54, 226, 154, 0.08);

    border:
        1px solid
        rgba(54, 226, 154, 0.4);

    border-radius: 8px;

    font-family:
        "Courier New",
        monospace;

    font-size: 12px;
    font-weight: bold;

    letter-spacing: 1px;
}

.system-dot {
    display: inline-block;

    width: 8px;
    height: 8px;

    margin-right: 7px;

    background: var(--green);

    border-radius: 50%;

    box-shadow:
        0 0 9px var(--green);
}


/* MENU */

.tabs {
    display: flex;

    padding: 0 45px;

    background:
        rgba(7, 17, 31, 0.92);

    border-bottom:
        1px solid var(--border);
}

.tab-button {
    padding: 17px 22px;

    color: var(--muted);

    background: transparent;

    border: none;
    border-bottom:
        3px solid transparent;

    font-size: 14px;
    font-weight: bold;

    cursor: pointer;
}

.tab-button:hover {
    color: white;
}

.tab-button.active {
    color: var(--accent);

    border-bottom-color:
        var(--accent);
}


/* MAIN */

main {
    max-width: 1500px;

    margin: 35px auto;

    padding: 0 28px 40px;
}


/* PANELE */

.station-panel,
.chart-panel,
.history-panel,
.about-panel {
    background:
        linear-gradient(
            145deg,
            var(--panel),
            #0b1929
        );

    border:
        1px solid var(--border);

    border-radius: 16px;

    box-shadow:
        0 12px 30px
        rgba(0, 0, 0, 0.22);
}


/* STACJE */

.stations-grid {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 24px;

    margin-bottom: 26px;
}

.station-panel {
    padding: 24px;
}

.station-top {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    margin-bottom: 22px;
}

.station-small,
.section-small {
    margin: 0 0 6px;

    color: var(--accent);

    font-family:
        "Courier New",
        monospace;

    font-size: 11px;

    letter-spacing: 2px;
}

.station-top h2 {
    margin: 0;

    font-size: 25px;
}

.last-update {
    margin: 7px 0 0;

    color: var(--muted);

    font-size: 12px;
}

.station-status {
    padding: 7px 10px;

    border-radius: 7px;

    font-family:
        "Courier New",
        monospace;

    font-size: 12px;
    font-weight: bold;
}

.station-status.online {
    color: var(--green);

    background:
        rgba(54, 226, 154, 0.10);

    border:
        1px solid
        rgba(54, 226, 154, 0.35);
}

.station-status.offline {
    color: var(--red);

    background:
        rgba(255, 102, 119, 0.10);

    border:
        1px solid
        rgba(255, 102, 119, 0.35);
}


/* KAFELKI */

.sensor-grid {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 13px;
}

.sensor-card {
    min-height: 105px;

    display: flex;
    align-items: center;

    gap: 15px;

    padding: 17px;

    background:
        var(--panel-light);

    border:
        1px solid var(--border);

    border-radius: 12px;

    transition:
        transform 0.2s;
}

.sensor-card:hover {
    transform:
        translateY(-2px);
}

.sensor-icon {
    min-width: 48px;
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 25px;

    background:
        rgba(255,255,255,0.05);

    border-radius: 10px;
}

.sensor-name {
    display: block;

    margin-bottom: 7px;

    color: var(--muted);

    font-size: 11px;

    text-transform: uppercase;

    letter-spacing: 0.6px;
}

.sensor-value {
    display: block;

    font-size: 22px;

    font-weight: bold;
}

.temperature-card {
    border-left:
        3px solid var(--temperature);
}

.humidity-card {
    border-left:
        3px solid var(--humidity);
}

.pressure-card {
    border-left:
        3px solid var(--pressure);
}

.light-card {
    border-left:
        3px solid var(--light);
}

.gas-card {
    border-left:
        3px solid var(--gas);
}

.sensor-card:last-child {
    grid-column: 1 / -1;
}


/* LIVE */

.auto-info {
    margin: 8px 0 0;

    color: var(--green);

    font-family:
        "Courier New",
        monospace;

    font-size: 11px;
}


/* WYKRES */

.chart-panel {
    padding: 24px;
}

.chart-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 20px;
}

.chart-header h2 {
    margin: 0;
}

.chart-controls {
    display: flex;

    align-items: center;

    gap: 15px;
}

.station-switch {
    display: flex;

    padding: 4px;

    background: #091726;

    border:
        1px solid var(--border);

    border-radius: 9px;
}

.station-chart-button,
.history-station-button {
    padding: 9px 14px;

    color: var(--muted);

    background: transparent;

    border: none;

    border-radius: 6px;

    font-weight: bold;

    cursor: pointer;
}

.station-chart-button:hover,
.history-station-button:hover {
    color: white;
}

.station-chart-button.active,
.history-station-button.active {
    color: #00141a;

    background:
        var(--accent);
}

#rangeSelect {
    padding: 10px 13px;

    color: var(--text);

    background:
        var(--panel-light);

    border:
        1px solid var(--border);

    border-radius: 8px;
}

.chart-area {
    display: grid;

    grid-template-columns:
        1fr 220px;

    gap: 22px;
}

.chart-container {
    height: 440px;

    padding: 15px;

    background: #091726;

    border:
        1px solid var(--border);

    border-radius: 12px;
}

.legend-box {
    padding: 18px;

    background: #091726;

    border:
        1px solid var(--border);

    border-radius: 12px;
}

.legend-box h3 {
    margin: 0 0 18px;
}

.legend-item {
    display: flex;

    align-items: center;

    gap: 10px;

    margin-bottom: 14px;

    color: #cbd9e5;

    font-size: 14px;
}

.legend-color {
    width: 22px;
    height: 4px;

    border-radius: 4px;
}

.temperature-color {
    background: var(--temperature);
}

.humidity-color {
    background: var(--humidity);
}

.pressure-color {
    background: var(--pressure);
}

.light-color {
    background: var(--light);
}

.gas-color {
    background: var(--gas);
}

.legend-station {
    margin-top: 30px;

    padding-top: 18px;

    border-top:
        1px solid var(--border);
}

.legend-station span {
    display: block;

    margin-bottom: 8px;

    color: var(--muted);

    font-family:
        "Courier New",
        monospace;

    font-size: 10px;

    letter-spacing: 1px;
}

.legend-station strong {
    color: var(--accent);

    font-family:
        "Courier New",
        monospace;

    letter-spacing: 1px;
}


/* HISTORIA */

.history-panel {
    padding: 26px;
}

.history-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 18px;
}

.history-header h2 {
    margin: 0;
}

.history-controls {
    display: flex;

    align-items: center;

    gap: 15px;
}

.history-export {
    padding: 10px 14px;

    color: #00141a;

    background:
        var(--accent);

    border-radius: 7px;

    text-decoration: none;

    font-size: 13px;
    font-weight: bold;
}

.history-current {
    margin-bottom: 20px;

    padding: 11px 14px;

    color: var(--muted);

    background: #091726;

    border:
        1px solid var(--border);

    border-radius: 8px;

    font-family:
        "Courier New",
        monospace;

    font-size: 11px;
}

.history-current strong {
    margin-left: 5px;

    color: var(--accent);
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;

    border-collapse: collapse;
}

th,
td {
    padding: 13px 12px;

    text-align: left;

    border-bottom:
        1px solid var(--border);
}

th {
    color: var(--accent);

    background: #0b1929;

    font-family:
        "Courier New",
        monospace;

    font-size: 12px;
}

td {
    color: #d0dce7;

    font-size: 13px;
}

tbody tr:hover {
    background:
        rgba(0,229,255,0.04);
}


/* O PROJEKCIE */

.about-panel {
    max-width: 1050px;

    margin: 0 auto;

    padding: 45px;
}

.about-header {
    max-width: 780px;

    margin: 0 auto 40px;

    text-align: center;
}

.about-header .section-small {
    margin-bottom: 12px;
}

.about-header h2 {
    margin: 0;

    color: var(--text);

    font-family:
        "Courier New",
        monospace;

    font-size: 32px;

    line-height: 1.35;

    letter-spacing: 1px;
}

.about-intro {
    max-width: 700px;

    margin: 20px auto 0;

    color: #b9cddd;

    font-size: 16px;

    line-height: 1.8;
}

.about-grid {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 16px;
}

.about-card {
    padding: 23px;

    text-align: center;

    background:
        var(--panel-light);

    border:
        1px solid var(--border);

    border-radius: 12px;
}

.about-icon {
    margin-bottom: 12px;

    font-size: 29px;
}

.about-card h3 {
    margin: 0 0 8px;

    color: var(--accent);
}

.about-card p {
    margin: 0;

    color: #a9bece;

    line-height: 1.65;

    font-size: 14px;
}

.architecture-box {
    margin-top: 28px;

    padding: 25px;

    text-align: center;

    background: #091726;

    border:
        1px solid var(--border);

    border-radius: 12px;
}

.architecture {
    display: flex;

    align-items: center;
    justify-content: center;

    flex-wrap: wrap;

    gap: 12px;

    margin-top: 15px;
}

.architecture span {
    padding: 10px 14px;

    color: var(--text);

    background:
        var(--panel-light);

    border:
        1px solid var(--border);

    border-radius: 7px;

    font-family:
        "Courier New",
        monospace;

    font-weight: bold;
}

.architecture strong {
    color: var(--accent);

    font-size: 20px;
}

.project-footer {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 15px;

    margin-top: 28px;

    padding-top: 28px;

    border-top:
        1px solid var(--border);
}

.project-footer div {
    text-align: center;
}

.project-footer span {
    display: block;

    margin-bottom: 7px;

    color: var(--muted);

    font-family:
        "Courier New",
        monospace;

    font-size: 10px;

    letter-spacing: 1px;
}

.project-footer strong {
    color: #e6f6ff;

    font-size: 15px;
}

.hidden {
    display: none;
}


/* TELEFON */

@media (max-width: 1050px) {

    .stations-grid {
        grid-template-columns: 1fr;
    }

    .chart-area {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 700px) {

    .topbar {
        display: block;

        padding: 22px;
    }

    .system-badge {
        display: inline-block;

        margin-top: 18px;
    }

    .tabs {
        padding: 0 8px;
    }

    .tab-button {
        padding: 15px 12px;
    }

    main {
        padding: 0 14px 30px;
    }

    .pixel-title {
        font-size: 21px;

        letter-spacing: 2px;
    }

    .pixel-subtitle {
        line-height: 1.6;
    }

    .sensor-grid,
    .about-grid,
    .project-footer {
        grid-template-columns: 1fr;
    }

    .sensor-card:last-child {
        grid-column: auto;
    }

    .station-top,
    .chart-header,
    .history-header {
        display: block;
    }

    .chart-controls,
    .history-controls {
        margin-top: 18px;

        align-items: stretch;

        flex-direction: column;
    }

    .station-switch {
        width: fit-content;
    }

    .about-panel {
        padding: 25px 18px;
    }

    .about-header h2 {
        font-size: 24px;
    }
}