/* style.css */
body {
    font-family: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
    background-color: #fff;
    color: #333;
    padding: 0;
    margin: 0;
}

h1 {
    text-align: center;
    color: #555;
    margin-bottom: 40px;
}

.card-container {
    display: grid;
    /* Erstellt so viele 320px breite Spalten wie möglich und verteilt den Restplatz */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px; /* Abstand zwischen den Karten */
    max-width: 1200px;
    margin: 0 auto;
}

.data-card {
    cursor: pointer;
    background-color: #ffffff;
    border: 0px;
    border-radius: 0px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.2s ease-in-out;
}

.data-card:hover {
    transform: translateY(-5px);
}

.data-card img {
    width: 100%;
    height: 180px;
    object-fit: cover; /* Stellt sicher, dass das Bild die Fläche füllt, ohne sich zu verzerren */
    display: block;
}

.card-content {
    padding: 20px;
}

.card-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 1.1rem;
}

.data-row .label {
    color: #666;
}

.data-row .value {
    font-weight: bold;
    padding: 5px 12px;
    border-radius: 20px;
    min-width: 70px;
    text-align: center;
    background-color: transparent;
    border: 2px solid;
}

/* --- Farbklassen für die Temperaturen --- */
.temp-green, .humi-green {
    border-color: #66cc00 !important; /* Grün */
    color: #000000;
}

.temp-yellow, .humi-yellow {
    border-color: #ffa100 !important; /* Gelb */
    color: #000000;
}

.temp-red, .humi-red {
    border-color: #e2000d !important; /* Rot */
    color: #000000;
}

.temp-black, .humi-black {
    border-color: #000000; /* Schwarz */
    color: #000000;
}

/* === NEU: STILE FÜR DAS MODAL === */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none; /* Standardmäßig versteckt */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Klasse, die per JS hinzugefügt wird, um das Modal zu zeigen */
.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 0px;
    width: 90%;
    max-width: 1100px;
    height: 80%;
    max-height: 700px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    color: #888;
    line-height: 1;
}

.modal-body {
    display: flex;
    flex-direction: row;
    gap: 30px;
    flex-grow: 1;
    overflow-y: auto;
}

.modal-left {
    width:33%;
}
.modal-right {
    width: 67%;
}

.modal-left img {
    width: 100%;
    border-radius: 0px;
    margin-bottom: 20px;
    height: 250px;
    object-fit: cover;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 70%;
}

@media (max-width: 768px) {

  .modal-content {
    /* Erlaubt dem Modal, fast die gesamte Bildschirmhöhe zu nutzen */
    height: auto;
    max-height: 90vh; /* 90% der sichtbaren Höhe */
  }

  .modal-body {
    /* Ändert die Richtung von nebeneinander (row) zu untereinander (column) */
    flex-direction: column;
    /* Erlaubt internes Scrollen, falls der Inhalt zu lang wird */
    overflow-y: auto;
  }

  .modal-left,
  .modal-right {
    /* Lässt jede Spalte die volle Breite des Modals einnehmen */
    width: 100%;
  }

  .modal-left img {
    /* Optional: Bild auf kleineren Screens nicht ganz so hoch machen */
    height: 200px;
  }
  
  .chart-container {
    /* Dem Chart eine feste Mindesthöhe geben, damit er nicht zu klein wird */
    min-height: 300px;
    height: 300px; /* Feste Höhe kann hier besser sein als prozentual */
  }
}

.time-range-selector {
    display: flex;
    justify-content: flex-end; /* Positioniert es rechtsbündig */
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.time-range-selector label {
    font-size: 0.9rem;
    color: #555;
}

.time-range-selector select {
    padding: 5px 8px;
    border-radius: 0px;
    border: 1px solid #ccc;
    font-size: 0.9rem;
    background-color: #f9f9f9;
}

/* === Außentemperatur Sektion === */
.outdoor-temp-box {
    max-width: 1200px;
    margin: 40px auto 20px;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    font-size: 1.35rem;
}

.outdoor-temp-value-wrapper {
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.outdoor-temp-box .outdoor-temp-label {
    color: #666;
    font-size: 1rem;
}

.outdoor-temp-box .value {                   /* re-uses your coloured “value” pill */
    font-size: 1.5rem;
    min-width: 90px;
}

.thermo-icon {
  margin-left: 6px;
  font-size: 1.2em;
  vertical-align: -0.1em; /* Fine-tune if needed */
}

/* Dashboard loading screen */

#dashboard-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  font-size: 1.2rem;
  color: #333;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #ccc;
  border-top: 4px solid #2a7ae2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
