/* Global dark theme */
body {
  background-color: #1e1e1e;   /* deep dark gray */
  color: #e0e0e0;              /* soft light gray text */
  font-family: Arial, sans-serif;
  margin: 40px;
}

/* Headings */
h2 {
  color: #ffffff;
  margin-top: 20px;
  border-bottom: 1px solid #444;
  padding-bottom: 6px;
}

/* Tables */
table {
  border-collapse: collapse;
	idth: 100%;
  margin-bottom: 16px;
  background-color: #2a2a2a;   /* slightly lighter than background */
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
}

th, td {
  padding: 6px 10px;
  border-bottom: 1px solid #3a3a3a;
}

th {
  background-color: #333333;
  color: #ffffff;
  text-align: left;
  font-weight: bold;
}

td {
  color: #d0d0d0;
}

/* Remove last row border */
table tr:last-child td {
  border-bottom: none;
}

.current-block table,
.cheapest-block table,
.daily-block table,
.daily-block-tomorrow table {
  width: 100%;
  table-layout: fixed;   /* forces cells to shrink */
  word-wrap: break-word;
}

.price-table {
  margin-top: 10px;
  overflow-x: auto;
}

.price-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px; /*teksto dydis*/
  color: #ddd;
}

.price-table th,
.price-table td {
  border: 1px solid #444;
  padding: 3px 4px;
  text-align: center;
}

.price-table th {
  background-color: #222;
  font-weight: bold;
}

/* "Duomenų šaltinis: ..." under each price table. Zero layout height: the text
   sits in space that is already there (today: the flex gap + divider margin,
   tomorrow: the block's bottom padding), so the 1920x1080 kiosk does not scroll. */
.data-source {
  position: relative;
  top: 2px;
  height: 0;
  overflow: visible;
  font-size: 12px;
  line-height: 14px;
  color: #888;
  text-align: right;
  white-space: nowrap;
}

#todaySource {
  margin-top: -16px; /* cancels .sparkline-block's gap */
}

.data-source.fallback {
  color: #d9a441;
}

.current-interval {
  outline: 2px solid #fff;
  outline-offset: -2px;
  font-weight: bold;
}

/* Gauge container */
#gaugeContainer {
  margin-top: 10px;
  padding: 12px;
  background-color: #2a2a2a;
  border-radius: 6px;
  max-width: 100%;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
	box-sizing: border-box;
}

/* Center the gauge canvas */
#priceGauge {
  display: block;
  height: auto !important;
  width: 100% !important;
  margin: 0 auto;
}

/* Layout container */
.container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Blocks */
.current-block,
.cheapest-block,
.daily-block,
.sparkline-block {
  background-color: #2a2a2a;
  padding: 14px;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
	box-sizing: border-box;
}

.current-block,
.cheapest-block,
.daily-block {
  min-width: 0;   /* allows shrinking */
  overflow: hidden;
}

.daily-block-tomorrow {
  background-color: #2a2a2a;
  padding: 14px;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}

/* ------------------------------------------
   LANDSCAPE MODE (wider screens)
   ------------------------------------------ */
@media (min-width: 700px) and (orientation: landscape) {
  .container {
    display: grid;
    grid-template-columns: 75% 25%;
    grid-template-rows: auto auto auto auto;
    gap: 5px 5px;
    align-items: start;
  }
	
  .sparkline-block {
    order: 1;
    grid-column: 1;
    grid-row: 1 / span 4;
    min-width: 0;
  }
	
  .current-block {
    order: 2;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }
	
  .cheapest-block {
    order: 3;
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
  }

  .daily-block {
    order: 4;
    grid-column: 2;
    grid-row: 3;
    min-width: 0;
  }
	
  .daily-block-tomorrow {
    order: 5;
    grid-column: 2;
    grid-row: 4;
    min-width: 0;
  }

  /* The right column has to hold one more block within 1080 px: tighter
     headings and a smaller gauge there. The left column is unchanged. */
  .current-block h2,
  .cheapest-block h2,
  .daily-block h2,
  .daily-block-tomorrow h2 {
    margin-top: 6px;
    margin-bottom: 10px;
  }
  .cheapest-block th,
  .cheapest-block td {
    padding: 4px 10px;
  }
  #priceGauge {
    width: 62% !important;
  }
}
/* ------------------------------------------
   PORTRAIT MODE (mobile)
   ------------------------------------------ */
@media (max-width: 699px), (orientation: portrait) {
  .container {
    flex-direction: column;
  }
	
  .sparkline-block { order: 1; }
  .current-block { order: 2; }
  .cheapest-block { order: 3; }
  .daily-block   { order: 4; }
  .daily-block-tomorrow { order: 5; }
}

.update-info {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #bbbbbb;
  text-align: right;
  opacity: 0.8;
}

.update-progress {
  width: 100%;
  height: 6px;
  background-color: #444;
  border-radius: 3px;
  margin-top: 10px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: #6FADCF;
  width: 100%; /* starts full */
  transition: width 1s linear;
}

.sparkline-block h2 {
  margin-bottom: 10px;
}

.sparkline-block {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 20px;
  background-color: #2a2a2a;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
  gap: 16px;
}

/* Chart.js sizes the canvas to this box (maintainAspectRatio: false); never
   size the canvas itself in CSS, or the drawing gets stretched and the
   axis text squashed. */
.chart-box {
  position: relative;
  width: 100%;
  height: 200px;
  margin-bottom: 10px;
}

#tomorrowChartContainer {
  display: block;
  width: 100%;
}

#todayChartContainer {
  min-height: 260px; /* nereaguoja */
}


.sparkline-divider {
  width: 100%;
  height: 1px;
  background-color: #444;
  margin: 10px 0 20px 0;
  opacity: 0.6;
}

/* Generic spinner */
.loader {
  border: 4px solid #444;
  border-top: 4px solid #6FADCF;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  animation: spin 0.9s linear infinite;
  margin: 10px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Centered loader wrapper */
.loader-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 0;
}

/* "Service unavailable" modal (#apiDownModal) */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.75);
}

.modal-box {
  max-width: 640px;
  margin: 18vh auto 0;
  padding: 24px 32px;
  background-color: #2a2a2a;
  border: 2px solid #d9534f;
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
  font-size: 1.3em;
}

.modal-box h2 {
  margin-top: 0;
  color: #ff6b6b;
}

.modal-status {
  color: #aaaaaa;
  font-size: 0.85em;
}
