* {
    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;
}

html {
    background: var(--background);
}

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;
}

/* Nagłówek */

.topbar {
    padding: 28px 45px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(7, 17, 31, 0.92);
    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);
}

/* Główna treść */

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;
    gap: 20px;
    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;
}

.station-type {
    color: #9ab0c2;
    font-size: 15px;
    font-weight: normal;
}

.last-update {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.station-status {
    flex-shrink: 0;
    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, minmax(0, 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;
}

.sensor-content {
    min-width: 0;
    width: 100%;
}

.sensor-icon {
    flex-shrink: 0;
    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;
}

/* Światło */

.light-scale {
    margin-top: 11px;
}

.light-track {
    position: relative;
    width: 100%;
    height: 7px;
    overflow: hidden;
    background:
        rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.light-fill {
    width: 0%;
    height: 100%;
    background:
        linear-gradient(
            90deg,
            #6d7f95,
            #ffd45c
        );
    border-radius: inherit;
    transition:
        width 0.35s ease;
}

.light-description {
    display: block;
    margin-top: 7px;
    color: #d8c98a;
    font-family: "Courier New", monospace;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Informacje 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;
    gap: 20px;
    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:
        minmax(0, 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;
    font-size: 12px;
    letter-spacing: 1px;
}

/* Historia */

.history-panel {
    padding: 26px;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    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 !important;
}

/* Tablet */

@media (max-width: 1050px) {
    .stations-grid {
        grid-template-columns: 1fr;
    }
    .chart-area {
        grid-template-columns: 1fr;
    }
}

/* Telefon */

@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 {
        margin-top: 24px;
        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;
    }
    .station-status {
        width: 100%;
        margin-top: 14px;
    }
    .station-type {
        display: block;
        margin-top: 4px;
    }
    .chart-controls,
    .history-controls {
        margin-top: 18px;
        align-items: stretch;
        flex-direction: column;
    }
    .station-switch {
        width: 100%;
    }
    .station-chart-button,
    .history-station-button {
        flex: 1;
    }
    .about-panel {
        padding: 25px 18px;
    }
    .about-header h2 {
        font-size: 24px;
    }
    .chart-container {
        height: 350px;
    }
}

/* Ograniczenie animacji */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}
