/* === TCW DASHBOARD – 1080p COMPACT OPTIMISED STYLESHEET === */

/* 🌐 Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* 🎛 Theme tokens */
:root{
  --navy:#001f3f;
  --white:#fff;
  --accent-blue:#007bff;
}

/* 🧭 Base */
html,body{
  height:100%;
  width:100%;
  font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color:var(--navy);
  color:var(--white);
  line-height:1.5;
  font-size:clamp(0.75rem,0.85vw + 0.2rem,1rem);
  overflow-x:hidden;
}

/* 🏷 Header (slim for 1080p) */
#headerSection{
  width:100%;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:0.4rem 1.2vw;
  min-height:65px;
  background:#012a55;
  border-bottom:1px solid rgba(255,255,255,0.2);
  box-shadow:0 2px 6px rgba(0,0,0,0.3);
  flex-wrap:wrap;
}
.headerItem{ flex:1; text-align:center; margin:0.25rem 0; }

h1{
  font-size:clamp(1.4rem,1.6vw + 0.6rem,2rem);
  font-weight:700;
  color:var(--white);
  text-shadow:2px 2px 6px rgba(0,0,0,0.5);
}
#lastUpdated{
  font-size:clamp(0.7rem,0.75vw + 0.1rem,0.9rem);
  font-weight:600;
  margin-top:0.2rem;
  color:#cce3ff;
}

/* ⏰ Clocks */
.clock,#ukClock,#franceClock{
  font-family:'Seven Segment', monospace;
  font-size: clamp(3rem, 2vw + 0.3rem, 2.2rem);
  padding: 0.4em 0.8em;
  color:#ff5555;
  text-align:center;
  background:black;
  border-radius:10px;
  min-width:8vw;
  text-shadow:-1px -1px 0 #fff,1px -1px 0 #fff,-1px 1px 0 #fff,1px 1px 0 #fff;
  box-shadow:inset 0 0 6px rgba(255,255,255,0.3);
}
#ukClock{ background-image:url("/assets/ukflg.gif"); background-size:cover; background-position:center; }
#franceClock{ background-image:url("/assets/FrenchFlg.webp"); background-size:cover; background-position:center; }

/* 🧱 Main layout (narrower left column) */
#mainSection{
  display:grid;
  grid-template-columns:32% 34% 32%;
  gap:8px;
  width:100vw;
  height:calc(100vh - 70px);
  padding:0 8px;
  overflow:hidden;
}

/* 📦 Columns */
#leftColumn,#middleColumn,#rightColumn{
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  align-items:stretch;
  background:rgba(15,30,60,0.35);
  border-radius:10px;
  padding:6px;
  height:100%;
}
#middleColumn{ background:rgba(10,25,45,0.6); }

/* 🔠 Section headings */
#data h3, #weatherData h3{
  font-size:clamp(1rem,0.9vw + 0.2rem,1.3rem);
  font-weight:600;
  text-align:center;
  margin:0.4rem 0 0.3rem;
  color:#e6f3ff;
}

/* 🌅 Sunrise/Sunset inline text */
.sun-times{ font-size:clamp(0.9rem,1.2vw,1.2rem); font-weight:bold; }

/* 🧾 Tables (compact in left column) */
#leftColumn table{
  width:100%;
  border-collapse:collapse;
  margin:0 0 4px 0;      /* no extra bottom gap */
  font-size:clamp(0.65rem,0.75vw,0.9rem);
}
#leftColumn th{
  background:linear-gradient(to bottom,#003366,#001f3f);
  color:#fff;
  padding:0.25rem 0.3rem;
  border:1px solid #335;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.3px;
  font-size:clamp(0.7rem,0.8vw,1rem);
}
#leftColumn td{
  background:rgba(0,17,34,0.9);
  color:#e8e8e8;
  padding:0.25rem 0.3rem;
  border:1px solid #223;
  font-weight:500;
  line-height:1.2;
  text-align:center;
}
tbody tr:hover{ background-color:rgba(0,102,204,0.25); transition:background-color 0.2s; }

/* 🗺 Widgets (right column smaller) */
#rightColumn,#aisWrapper{ position:relative; flex:1; min-height:340px; overflow:hidden; }
#windyWidgetContainer{ min-height:200px; }
#marineIframe{ width:100%; height:100%; border:0; border-radius:10px; flex:1; }

/* 📜 Left column can scroll if needed */
#leftColumn{ overflow-y:auto; scrollbar-width:thin; }

/* 🔧 Weather column: consistent tight stacking */
#weatherData{
  display:flex;
  flex-direction:column;
  gap:0.4rem;            /* single source of spacing */
}
#weatherData h3, #weatherData p{ margin:0; }
#weatherData table{ margin:0; }

/* 📈 Chart containers (tight, no ghost gaps) */
.chartBox,
.marineChartContainer,
.windChartContainer{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:stretch;
  margin:0; padding:0;
  height:auto;
}

/* Chart heights tuned for 1080p left column */
.windChartContainer{ height:clamp(200px,14vh,160px); }
.marineChartContainer{ height:clamp(200px,14vh,160px); }

/* Canvases: block to remove baseline whitespace; fill container */
.chartBox canvas,
.marineChartContainer canvas,
.windChartContainer canvas{
  display:block;
  width:100% !important;
  height:100% !important;
  margin:0; padding:0;
}

/* (Note) Chart text sizes are driven by your JS (scaleFont/titleFont).
   CSS font-size on <canvas> does not change Chart.js label fonts. */


/* ⚓ SHIPPING MOVEMENTS TABLE (1080p Optimised) */
#shippingMovements {
  background: rgba(15, 30, 60, 0.35);
  border-radius: 8px;
  padding: 6px;
  margin-bottom: 6px;
  overflow-x: auto;
}

#shippingMovements table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(0.7rem, 0.75vw, 0.9rem);
  line-height: 1.2;
  color: #e8e8e8;
}

#shippingMovements th {
  background: linear-gradient(to bottom, #003366, #001f3f);
  color: #fff;
  padding: 0.3rem 0.4rem;
  border: 1px solid #335;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

#shippingMovements td {
  background: rgba(0, 17, 34, 0.9);
  padding: 0.3rem 0.4rem;
  border: 1px solid #223;
  text-align: center;
}

#shippingMovements tbody tr:hover {
  background-color: rgba(0, 102, 204, 0.25);
  transition: background-color 0.2s ease-in-out;
}


#multiDayOutlook {
  margin-top: 6px;
  background: rgba(15, 30, 60, 0.35);
  border-radius: 8px;
  padding: 6px;
}

#multiDayOutlook h3 {
  margin-bottom: 4px;
  font-size: clamp(0.9rem, 0.9vw + 0.2rem, 1.1rem);
  color: #e6f3ff;
}

#multiDayOutlook table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(0.75rem, 0.8vw, 0.9rem);
}

#multiDayOutlook th, #multiDayOutlook td {
  border: 1px solid rgba(255,255,255,0.1);
  padding: 0.25rem;
  text-align: center;
  color: #fff;
}

#forecast {
  margin-top: 0.6rem;
  text-align: center;
}

#forecast h3 {
  margin-bottom: 0.4rem;
  color: #e6f3ff;
  font-size: clamp(1rem, 1vw + 0.2rem, 1.3rem);
}

#forecast table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

#forecast th {
  background: linear-gradient(to bottom, #003366, #001f3f);
  color: #fff;
  padding: 3px;
  border: 1px solid #335;
  text-transform: uppercase;
}

#forecast td {
  border: 1px solid #223;
  padding: 3px;
  text-align: center;
  background: rgba(0, 17, 34, 0.9);
  color: #e8e8e8;
}


/* ⚠️ Wind Warning Panel (middle column) */
.warning-panel{
  border: 2px solid red;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  background: rgba(255,0,0,0.08);
}

.warning-panel .warning-title{
  text-align: center;
  font-size: 1.4em;
  font-weight: 800;
  color: #ff6666;
  margin: 0 0 6px 0;
}

.warning-panel .warning-text{
  text-align: center;
  font-size: 1.05em;
  font-weight: 600;
  margin: 0;
}

/* Date shown in left-panel headings */
.data-date{
  font-size: 0.75em;
  font-weight: 500;
  color: #aaa;
  margin-left: 6px;
}

#leftColumn h3,
#leftColumn .weather-updated{
  text-align: center;
}

.weather-line i.fa-solid{
  width: 1.2em;
  text-align: center;
  margin-right: 6px;
  color: #9ad;
}

.health-bar {
  display: flex;
  justify-content: center;   /* 👈 centres horizontally */
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12px;
  opacity: 0.85;
  margin: 6px 0 10px 0;
}
.health-item{
  display:flex;
  align-items:center;
  gap:6px;
}
.dot{
  width:10px;
  height:10px;
  border-radius:50%;
  display:inline-block;
  border:1px solid rgba(0,0,0,0.2);
}
.dot.ok{ background:#2ecc71; }
.dot.warn{  background:#f39c12; /* amber */}
.dot.bad{ background:#e74c3c; }
.health-date{
  opacity:0.7;
  font-variant-numeric: tabular-nums;
}
