/* ===========================================================================
   Projekt: AI basierte Softwareentwicklung – René Frutiger, Juli 2025
   Konsolidiertes Stylesheet
============================================================================ */

/* ===========================================================================
   MENÜ-BUTTON & DROPDOWN
============================================================================ */
#menuBtn {
  background: none;
  border: none;
  color: var(--header-text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
  z-index: 10;
}

#menuList {
  display: none;
  position: absolute;
  top: 100%;
  right: 1rem;
  margin-top: 4px;
  background: #ffffff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 9;
  min-width: 160px;
}

#menuList.open {
  display: block;
}

#menuList li + li {
  margin-top: 4px;
}

#menuList li a {
  display: block;
  padding: 6px 16px;
  color: var(--header-bg);
  text-decoration: none;
  font-size: 0.75rem;
}

#menuList li a:hover,
#menuList li a:focus {
  background: #f0f0f0;
}

#menuList li.feedback-box {
  color: #ffffff;
  border-top: 1px solid #ccc;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: rgba(0, 95, 115, 0.3);
  border-radius: 4px;
}

#menuList li.feedback-box a:hover {
  background: var(--hheader-bg-light);
}

/* ===================================================================
   MODAL / OVERLAY (Info & Webcam)
=================================================================== */
.modal,
.info-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, var(--overlay-bg-alpha));
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.modal.open,
.info-modal.open {
  display: flex;
}

/* Modal-Inhalt: Hintergrund jetzt header-bg-light */
.modal-content {
  position: relative;
  width: 90;
  height: 90;
  background: var(--header-bg-light);
  color: var(--header-text);
  border: 2px solid var(--header-bg-light);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Zusätzliche Styles fürs Info-Modal */
.info-modal .modal-content {
  padding: 1.5rem 2rem;
  max-width: 400px;
  text-align: center;
}

/* Schließen-Button in Modal */
.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255,255,255,0.9);
  border: none;
  font-size: 1.5rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  z-index: 2;
}

/* Modal-Body */
.modal-body {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
  overflow: auto;
}
.modal-body img,
.modal-body iframe {
  max-width: 100%;
  max-height: 100%;
  border: none;
}

/* Quellen-Hinweis im Webcam-Modal */
.modal-content .modal-source {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 0.6rem 1rem;
  margin-top: 0.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  text-align: center;
  font-size: 0.8em;
  font-weight: 300;
}

/* Link "Quelle:" im Modal */
.modal-source-link {
  color: var(--header-text);
  background: var(--header-bg);
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: background 0.3s ease;
}
.modal-source-link:hover {
  background: #0a4a57;
}

/* Modal-Body zeigt Texte jetzt blockweise an (nicht mehr als Flex-Row) */
.info-modal .modal-body {
  display: block;       /* normaler Fluss */
  max-height: 70vh;     /* wenn’s zu lang wird, scrollen */
  overflow-y: auto;
  padding: 1rem 2rem;
  color: var(--header-text);
}

/* Innerer Wrapper für typografische Anpassungen */
.info-text p {
  margin-bottom: 1rem;
  line-height: 1.5;
  white-space: normal;
}

.info-text ul {
  list-style: disc;
  margin: 0 0 1.5rem 1.5rem;
  padding: 0;
}

.info-text li {
  margin-bottom: 0.5rem;
}

/* Links im Modal-Body, falls vorhanden */
.info-text a {
  color: var(--header-text);
  text-decoration: underline;
}



/* ===================================================================
   REFRESH-BUTTON
=================================================================== */
#refreshBtn {
  background: var(--header-bg);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
  transition: transform 0.3s ease;
}
#refreshBtn:hover {
  transform: rotate(90deg);
}
#refreshBtn svg {
  stroke: var(--header-text);
  width: 24px;
  height: 24px;
}

/* ===================================================================
   WEBCAM-ICON
=================================================================== */
.webcam-link {
  color: var(--table-text);
  text-decoration: none;
}
.webcam-link svg {
  width: 1.2em;
  height: 1.2em;
  vertical-align: middle;
  stroke: currentColor;
  fill: currentColor;
  transition: fill 0.2s ease;
}

/* ===================================================================
   WINDGESCHWINDIGKEITSKLASSEN
=================================================================== */
tr.speed-0 { background-color: var(--speed-0-bg); }
tr.speed-1 { background-color: var(--speed-1-bg); }
tr.speed-2 {
  background-color: var(--speed-2-bg);
  color: var(--speed-2-txt);
}

/* ===================================================================
   WIND-TABELLE
=================================================================== */

main table {
  width: 90%;
  max-width: 800px;
  margin: 1rem auto;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
main table thead { background: var(--header-bg-light); }
main table thead th {
  color: var(--header-text);
  font-weight: normal;
  padding: 0.75rem 1rem;
  text-align: center;
  white-space: nowrap;
  font-size: 0.75rem;
}
main table tbody td {
  padding: 0.6rem 1rem;
  color: var(--table-text);
  border-bottom: 1px solid #e0e0e0;
  white-space: nowrap;
  font-size: 0.75rem;
}
main table tbody tr:last-child td { border-bottom: none; }
main table tbody td:nth-child(1),
main table tbody td:nth-child(2),
main table thead th:nth-child(1),
main table thead th:nth-child(2) {
  text-align: left;
}
main table tbody td:nth-child(n+3) { text-align: center; }


/* ===================================================================
   Info-Menü
=================================================================== */

/* 1) header-right zum Flex-Container machen */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;    /* Abstand zwischen den Buttons */
}

/* 2) Einheitliches Styling für Info- und Menü-Button */
#infoBtn,
#menuBtn {
  background: none;
  border: none;
  color: var(--header-text);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 1.25rem;  /* Menü-Button zieht •••, Info-Button ignoriert das */
}

/* 3) Menü-Button etwas kleiner, falls gewünscht */
#menuBtn {
  font-size: 1.5rem;
}

/* 4) Text im Info-Modal linksbündig */
.info-text {
  text-align: left !important;
  font-size: 0.75rem;
}

/* ===================================================================
   Legende
=================================================================== */
.table-wrapper {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 10px;
}

.data-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.data-table td:nth-child(2),
.data-table th:nth-child(2) {
  text-align: center;
}

.legend-table {
  margin-top: 10px;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.5em;
  background: linear-gradient(
    to right,
    #ffffff 0%,
    #e6ffe6 50%,
    #3cb371 100%
  );
}

.legend-table td i {
  font-size: 1.4em; /* Auch Icons verkleinern */
}

.legend-table td.icon-sad {
  padding-left: 80px; /* Abstand nach rechts */
}

/* Icon-Grundstyle */
.icon-sad i,
.icon-laugh i {
  color: rgba(0, 95, 115, 0.6);
  font-size: 1.8em;
  line-height: 1;
}

/* Sad-Icon: links ausrichten + Padding */
td.icon-sad {
  text-align: left;
  padding-left: 1em;
}

/* Laugh-Icon: rechts ausrichten + Padding */
td.icon-laugh {
  text-align: right;
  padding-right: 1em;
}
