/* =============================================
   Panel principal
   ============================================= */

#forecast-panel {
  flex: 0 0 var(--panel-height);
  height: var(--panel-height);
  width: 100vw;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-sizing: border-box;
  overflow: hidden;
}

#forecast-panel.is-collapsed {
  flex-basis: var(--panel-collapsed-height);
  height: var(--panel-collapsed-height);
  min-height: var(--panel-collapsed-height);
  max-height: var(--panel-collapsed-height);
}

#forecast-panel.is-collapsed #forecast-table-container {
  display: none;
}

#forecast-panel.is-collapsed #panel-toggle {
  transform: rotate(180deg);
}


/* =============================================
   Header du panel
   ============================================= */

#panel-header {
  height: var(--panel-collapsed-height);
  padding: 6px 12px;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--color-brand-dark);
  font-size: 14px;
  background: var(--color-brand-dark);
  color: #ffffff;
}

#panel-info {
  display: flex;
  gap: 24px;
  align-items: center;
  min-width: 0;
}

#panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}


/* =============================================
   Boutons du header
   ============================================= */

#panel-toggle,
#display-mode-toggle {
  border: none;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

#panel-toggle:hover,
#display-mode-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
}

#panel-toggle {
  padding: 3px 8px;
  font-size: 15px;
}

#display-mode-toggle {
  padding: 3px 10px;
  font-size: 13px;
  line-height: 1.2;
}


/* =============================================
   Conteneur et tableau
   ============================================= */

#forecast-table-container {
  height: calc(var(--panel-height) - var(--panel-collapsed-height));
  overflow: auto;
}

#forecast-table {
  border-collapse: collapse;
  font-size: 12px;
  min-width: 1200px;
  color: var(--color-text);
}


/* =============================================
   Cellules du tableau
   ============================================= */

#forecast-table th,
#forecast-table td {
  border: 1px solid var(--color-border);
  padding: 3px 5px;
  text-align: center;
  white-space: nowrap;
}

#forecast-table td {
  background-color: var(--bg-color, #ffffff);
}

#forecast-table th:first-child,
#forecast-table td:first-child {
  position: sticky;
  left: 0;
  background: var(--color-surface-soft);
  color: var(--color-text);
  font-weight: 600;
  text-align: left;
  z-index: 2;
  border-right: none;
  box-shadow: inset -1px 0 0 var(--color-brand-dark);
}

#forecast-table td.day-start,
#forecast-table td.forecast-day-cell {
  border-left: none;
  box-shadow: inset 1px 0 0 var(--color-brand-dark);
}

#forecast-table td:first-child + td.day-start,
#forecast-table td:first-child + td.forecast-day-cell {
  box-shadow: none;
}

.forecast-day-cell {
  text-align: center;
  font-weight: 600;
  background: var(--color-surface-soft);
  color: var(--color-text);
}

.text-white {
  color: #ffffff !important;
}


/* =============================================
   Ligne Météo
   ============================================= */

#forecast-table .weather-row td:not(:first-child) {
  font-size: 20px;
  line-height: 1;
  padding: 2px 2px;
}

.weather-icon {
  display: block;
  width: 24px;
  height: 24px;
  margin: 0 auto;
}


/* =============================================
   Ligne courbe marée
   ============================================= */

#forecast-table .tide-curve-row td:not(:first-child) {
  padding: 0;
  height: 54px;
  background-color: var(--color-surface-soft);
  border-top: 1px solid var(--color-border);
  border-bottom: 0;
  box-shadow: none;
}

#forecast-table .tide-curve-row td {
  border-bottom: 0;
}

.tide-curve-svg {
  display: block;
  width: 100%;
  height: 54px;
}

#forecast-table .tide-curve-row + .tide-values-row td {
  border-top: 0;
}

#forecast-table .tide-values-row td {
  border-top: 0;
}
