:root {
    --home-bg: #000000;
    --home-card: #1c1c1e;
    --home-text: #ffffff;
    --home-subtext: rgba(255, 255, 255, 0.7);
    --home-blue: #0a84ff;
    --home-green: #30d158;
    --home-yellow: #ffd60a;
    --home-red: #ff453a;
    --home-border-radius: 16px;
    --home-orange: rgba(140, 119, 16, 0.96);        /* typisches home-Orange */
    --home-lightgreen: #90ee90;    /* LightGreen */
    --home-lightblue: #add8e6;     /* LightBlue */
    --home-purple: #8e44ad;        /* schönes Purple */
    --home-teal: #30b0c7;          /* Teal für die Gesamtbewertung */

    /* Optional - neutrale Farben für Fehler/Fallbacks */
    --home-grey: #d1d1d6;          /* typisches helles Grau */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -home-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
}


body {
    background-color: var(--home-bg);
    color: var(--home-text);
    min-height: 100vh;
    padding: 10px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 0 12px;
}

.logo {
    font-size: 24px;
    font-weight: 600;
    background: linear-gradient(to right, #0a84ff, #30d158, #bf5af2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.date {
    font-size: 15px;
    color: var(--home-subtext);
    letter-spacing: -0.3px;
}

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



.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--home-text);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--home-blue);
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.card {
    background-color: var(--home-card);
    border-radius: var(--home-border-radius);
    padding: 25px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 100%;
}

.card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    opacity: 0.1;
    transition: opacity 0.3s ease;
    border-radius: var(--home-border-radius);
}

.card:hover .card-gradient {
    opacity: 0.2;
}

/* Neue Gradient für die Gesamtbewertung-Box */
.overall-gradient {
    background: radial-gradient(circle at top right, var(--home-teal), transparent 70%);
}

.temp-gradient {
    background: radial-gradient(circle at top right, var(--home-orange), transparent 70%);
}

.humidity-gradient {
    background: radial-gradient(circle at top right, var(--home-blue), transparent 70%);
}

.co2-gradient {
    background: radial-gradient(circle at top right, var(--home-green), transparent 70%);
}

.dust-gradient {
    background: radial-gradient(circle at top right, var(--home-purple), transparent 70%);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.card-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Neues Icon für die Gesamtbewertung-Box */
.overall-icon {
    background: linear-gradient(135deg, #30b0c7, #4cc2d9);
    box-shadow: 0 5px 15px rgba(48, 176, 199, 0.3);
}

.temp-icon {
    background: linear-gradient(135deg, #ff9f0a, #ff3b30);
    box-shadow: 0 5px 15px rgba(255, 159, 10, 0.3);
}

.clock-icon {
    background: linear-gradient(135deg, #ffd60a, #ff9f0a);
    box-shadow: 0 5px 15px rgba(255, 214, 10, 0.3);
}



.humidity-icon {
    background: linear-gradient(135deg, #0a84ff, #5ac8fa);
    box-shadow: 0 5px 15px rgba(10, 132, 255, 0.3);
}

.co2-icon {
    background: linear-gradient(135deg, #30d158, #34c759);
    box-shadow: 0 5px 15px rgba(48, 209, 88, 0.3);
}

.dust-icon {
    background: linear-gradient(135deg, #bf5af2, #5e5ce6);
    box-shadow: 0 5px 15px rgba(191, 90, 242, 0.3);
}

.card-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--home-subtext);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.card-value {
    font-size: 48px;
    font-weight: 700;
    margin: 10px 0 15px;
    letter-spacing: -1px;
    background: linear-gradient(to right, var(--home-text), rgba(255, 255, 255, 0.7));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    padding-bottom: 18px;
}

.card-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-green .status-indicator {
    background-color: var(--home-green);
    box-shadow: 0 0 10px rgba(48, 209, 88, 0.5);
}

.status-yellow .status-indicator {
    background-color: var(--home-yellow);
    box-shadow: 0 0 10px rgba(255, 214, 10, 0.5);
}

.status-red .status-indicator {
    background-color: var(--home-red);
    box-shadow: 0 0 10px rgba(255, 69, 58, 0.5);
}


.status-lightorange .status-indicator {
    background-color: #FFD580; /* heller Orangeton */
    box-shadow: 0 0 10px rgba(255, 181, 71, 0.6); /* passend leicht leuchtender Schein */
}


.status-orange .status-indicator {
    background-color: var(--home-orange);
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.5);
}

.status-lightgreen .status-indicator {
    background-color: var(--home-lightgreen);
    box-shadow: 0 0 10px rgba(144, 238, 144, 0.5);
}

.status-lightblue .status-indicator {
    background-color: var(--home-lightblue);
    box-shadow: 0 0 10px rgba(173, 216, 230, 0.5);
}

.status-purple .status-indicator {
    background-color: var(--home-purple);
    box-shadow: 0 0 10px rgba(128, 0, 128, 0.5);
}

/* Neuer Status-Indikator für Teal (Gesamtbewertung) */
.status-teal .status-indicator {
    background-color: var(--home-teal);
    box-shadow: 0 0 10px rgba(48, 176, 199, 0.5);
}

.status-text {
    color: var(--home-subtext);
}

.chart-container {
    background-color: var(--home-card);
    border-radius: var(--home-border-radius);
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.chart-tabs {
    display: flex;
    gap: 15px;
}

.chart-tab {
    font-size: 14px;
    color: var(--home-subtext);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.chart-tab.active {
    background-color: var(--home-blue);
    color: var(--home-text);
}

.chart {
    position: relative;
    height: 300px;
    margin-top: 20px;
}

.chart-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 130px;
    background: linear-gradient(to top,
    rgba(10, 132, 255, 0.1) 0%,
    rgba(10, 132, 255, 0) 100%);
    clip-path: polygon(
            0% 100%,
            5% 80%,
            10% 85%,
            15% 70%,
            20% 80%,
            25% 60%,
            30% 70%,
            35% 50%,
            40% 60%,
            45% 45%,
            50% 55%,
            55% 40%,
            60% 50%,
            65% 30%,
            70% 42%,
            75% 30%,
            80% 55%,
            85% 35%,
            90% 45%,
            95% 25%,
            100% 40%,
            100% 100%
    );
}

.chart-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: var(--home-blue);
    stroke-width: 3;
    stroke-linecap: round;
    filter: drop-shadow(0 0 8px rgba(10, 132, 255, 0.4));
}

.chart-dots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.chart-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--home-text);
    border: 2px solid var(--home-blue);
    box-shadow: 0 0 10px rgba(10, 132, 255, 0.5);
    transform: translate(-50%, -50%);
}

.chart-dot::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--home-blue);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(10, 132, 255, 0.5);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(10, 132, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(10, 132, 255, 0);
    }
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.chart-label {
    font-size: 12px;
    color: var(--home-subtext);
}

.summary {
    background-color: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--home-border-radius);
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 30px;
}

.summary-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-title::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--home-green);
}

.summary-content {
    font-size: 15px;
    line-height: 1.6;
    color: var(--home-subtext);
}

.summary-highlight {
    color: var(--home-text);
    font-weight: 500;
}

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    color: var(--home-subtext);
    font-size: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 40px;
}

.powered-by {
    display: flex;
    align-items: center;
    gap: 8px;
}

.home-logo {
    width: 16px;
    height: 16px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background-color: var(--home-blue);
    border-radius: 20px;
    color: var(--home-text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(10, 132, 255, 0.4);
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .chart {
        height: 200px;
    }
}

.card-value-container {
    display: flex;
    align-items: baseline;
    margin: 10px 0 15px;
}

.card-value {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -1px;
    background: linear-gradient(to right, var(--home-text), rgba(255, 255, 255, 0.7));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 0;
    margin-right: 5px;
}

.card-max-value {
    font-size: 24px;
    font-weight: 500;
    color: var(--home-subtext);
    opacity: 0.8;
}

.score-bar-container {
    width: 100%;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: 15px;
    overflow: hidden;
}

.score-bar {
    height: 100%;
    background: linear-gradient(to right, var(--home-teal), var(--home-blue));
    border-radius: 4px;
    transition: width 0.5s ease;
}

@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 16px;
    }

    .chart {
        height: 250px;
    }

    .card-value {
        font-size: 36px;
    }

    .card-max-value {
        font-size: 20px;
    }

    .card-title {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .card {
        padding: 18px;
    }

    .card-content {
        padding: 0; /* Innere Abstände sparen Platz */
    }

    .card-header {
        margin-bottom: 16px;
    }

    .card-title {
        font-size: 11px;
    }

    .card-value {
        font-size: 30px;
    }

    .card-max-value {
        font-size: 16px;
    }

    .chart {
        height: 180px;
    }

    .summary {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .dashboard {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .card-value {
        font-size: 26px;
    }

    .card-max-value {
        font-size: 14px;
    }

    .section-title {
        font-size: 16px;
    }

    .chart {
        height: 150px;
    }

    .footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        font-size: 12px;
    }
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 14px;
}

/* Querformat Smartphones */
@media (min-width: 600px) {
    .dashboard {
        grid-template-columns: repeat(3, 1fr);
    }

    .card {
        padding: 25px;
    }

    .card-header {
        margin-bottom: 0;    }

    .card-title {
        font-size: 12px;
    }

    .card-value {
        font-size: 25px;
    }

    .card-max-value {
        font-size: 14px;
    }

    .card-status {
        font-size: 12px;
        padding-top: 10px;
    }

    .status-text {
        font-size: 12px;
    }
}

/* Tablets und große Smartphones */
@media (min-width: 900px) {
    .dashboard {
        grid-template-columns: repeat(5, 1fr);
    }

    .card {
        padding: 18px;
    }

    .card-title {
        font-size: 12px;
    }

    .card-value {
        font-size: 30px;
    }

    .card-max-value {
        font-size: 16px;
    }

    .card-status {
        font-size: 13px;
        padding-top: 12px;
    }
}

.fullscreen-button {
    position: fixed;
    bottom: 30px;
    right: 10px;
    z-index: 1000;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--home-blue), var(--home-teal));
    color: var(--home-text);
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--home-border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(10, 132, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.fullscreen-button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px rgba(10, 132, 255, 0.6);
}

.fullscreen-button:active {
    transform: scale(0.98);
}

.chartsContainer {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Exactly 2 charts per row */
    grid-template-rows: 1fr 1fr; /* 2 rows of charts */
    gap: 1rem;
    width: 100%;
    height: calc(100vh - 150px); /* Adjusted to make room for range buttons */
    min-height: 500px; /* Minimum height to ensure charts are visible */
}

.chart-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.chart-wrapper h2 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.chart-container {
    flex-grow: 1;
    position: relative;
}

canvas {
    width: 100% !important;
    height: 100% !important;
    position: absolute;
}

.time-range-selector {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.time-range-button {
    padding: 0.5rem 1rem;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-range-button:hover {
    background-color: #e0e0e0;
}

.time-range-button.active {
    background-color: #4a69bd;
    color: white;
    border-color: #4a69bd;
}

@media (max-width: 768px) {
    .chartsContainer {
        min-height: 400px;
    }

    .chart-wrapper h2 {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }

    .time-range-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}
