body {
  background: #16171f; 
  color: #fff;
  font-family: Comfortaa, sans-serif;
  margin: 0px;
  height: 92vh;        /* γεμίζει όλο το viewport */
  overflow: hidden;     /* απενεργοποίηση global scroll */
  display: flex;
  flex-direction: column;
  padding: 0; /* pegos added: για να μην έχει τόσο πολύ κενό o header από πάνω.*/
}

h1 {
  text-align: center;
  margin-bottom: 20px;
}

h3 {
  text-align: left;
  margin-bottom: 20px;
  font-size: 20px;
  font-weight: bold;
  color: #0dada9;
}

.container {
  display: flex;
  gap: 20px;
  margin-left: 50px;
  margin-right: 50px;
  flex: 1;              /* πιάνει όλο το υπόλοιπο ύψος */
  min-height: 0;        /* fix για flexbox scroll */
  overflow-y: auto;
  height: auto;
}

.port-panel {
  background: #2f3038;  /**/
  border: 1px solid #0dada9;
  border-radius: 15px;
  padding: 15px;
  padding-top: 1px;
  flex: 9;
  display: flex;
  flex-direction: column;
  min-height: 0;        /* για flex fix */
  overflow: hidden;     /* ❌ no scroll εδώ */
}

.arrivals-panel {
  background: #2f3038;
  position: relative;
  border: 1px solid #0dada9;
  border-radius: 15px;
  padding: 15px;
  flex: 2;              /* 2/11 πλάτος */
  display: flex;
  flex-direction: column;
  overflow-y: auto;     /* scroll μόνο εδώ */
  min-height: 0;
}

.arrivals-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-left: 10px;
}

.info-btn {
  background: #2f3038;
  border: 1px solid #0dada9;
  color: #0dada9;
  font-weight: bold;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: 0.2s;
  margin-right: 15px;
  font-family: Comfortaa;
  font-size: 22px;
  font-weight: bold;
}

.info-btn:hover {
  background: #0dada9;
  color: #16171f;
}

.info-wrap {
  position: relative;
  display: inline-block;
}

/* tooltip (αρχικά κρυφό) */
.info-tooltip {
  display: block;
  position: absolute;
  right: 0;
  top: 80px;
  background: #2f3038;
  color: #ffffff;
  border: 1px solid #0dada9;
  border-radius: 12px;
  padding: 15px 20px;
  font-size: 20px;
  line-height: 1.6;
  margin-right:5%;
  margin-top: 5%;
  width:  40%;
  height: 40%; /*uto; */
  z-index: 9999;
  pointer-events: auto;
  opacity: 0;
  transform-origin: top right;
  transform: translate(-100000px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.55);
  visibility: hidden;
  text-align: left;
  overflow-wrap: break-word; /* τυλίγει λέξεις όταν χρειάζεται */
  overflow-y: auto;

}

/* visible state */
.info-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Γενικός κανόνας για τα panels με scroll */
.port-panel::-webkit-scrollbar,
.arrivals-panel::-webkit-scrollbar
{
  width: 15px;               /* πάχος scrollbar */
}

.port-panel::-webkit-scrollbar-track,
.arrivals-panel::-webkit-scrollbar-track
{
  background: #16171f;       /* background του track */
  border-radius: 15px;
}

.port-panel::-webkit-scrollbar-thumb,
.arrivals-panel::-webkit-scrollbar-thumb
{
  background: #0dada9;       /* χρώμα "σύρματος" scrollbar */
  border-radius: 15px;
  border: 3px solid #2f3038; /* δίνει λίγο padding/outline effect */
}

.port-panel::-webkit-scrollbar-thumb:hover,
.arrivals-panel::-webkit-scrollbar-thumb:hover
{
  background: #08c9c4;       /* ελαφρώς φωτεινότερο neon όταν hover */
}

/* Tooltip scrollbar */
.info-tooltip::-webkit-scrollbar {
  width: 4px; /* thinner than panels */
}

.info-tooltip::-webkit-scrollbar-track {
  background: #16171f;
  border-radius: 15px;
}

.info-tooltip::-webkit-scrollbar-thumb {
  background: #0dada9;
  border-radius: 10px;
}

.info-tooltip::-webkit-scrollbar-thumb:hover {
  background: #11cfcf;
}


.port-panel,
.arrivals-panel {
  scrollbar-width: thin;
  scrollbar-color: #0dada9 #16171f;
}

.toolbar {
  display: flex;
  justify-content: space-start; /* Left & right groups στις γωνίες */
  align-items: center;
  margin-bottom: 15px;
  border-radius: 12px;
  padding: 10px 15px;
  color: #e0e0e0;
  font-family: Comfortaa, sans-serif;

}

.toolbar-left,
.toolbar-right {
  display: flex;
  gap: 10px; /* spacing μεταξύ controls */
  font-size: 20px;
}

.toolbar-right{
  margin-left:40px;
}

.toolbar select,
.toolbar button {
  background: #2f3038;
  border: 1px solid #0dada9;
  border-radius: 8px;
  padding: 5px;/*8px 14px;  /* λίγο μεγαλύτερο */
  color: #e0e0e0;
  font-family: Comfortaa, sans-serif;
  font-size: 18px;
  cursor: pointer;
  transition: 0.2s;
}

.toolbar button:hover {
  background: #0dada9;
  color: #16171f;
}


#berths {
  display: flex;
  flex-direction: column;
  gap: 10px;

}

.berths-wrapper {
  flex: 1;
  overflow-y: auto;     /* ✅ scroll μόνο εδώ */
  overflow-x: hidden;
  min-height: 0;
}

.berth {
  position: relative;       /* important for absolute positioning of chips */
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #0dada9;
  border-radius: 25px;
  padding: 8px 16px;
  background-color: #16171f;
  color: #ffffff;
  font-family: Comfortaa, sans-serif;
}

.ship-chip {
  position: absolute;
  height: 40px;
  background-color: #0dada9;
  border-radius: 12px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  overflow: hidden;
  white-space: nowrap;
}

.berth-name {
  font-weight: bold;
  color: #0dada9;
  font-size: 1.1em;
}

.berth-size {
  font-size: 0.9em;
}

#ships {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ship {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #0dada9;
  border-radius: 25px;
  padding: 8px 16px;
  background-color: #2f3038;
  color: #e0e0e0;
  font-family: Comfortaa, sans-serif;
}

.ship-name {
  font-weight: bold;
  color: #0dada9;
  font-size: 1.1em;
}

.ship-size, .ship-eta, .ship-rtd {
  color: #ffffff;
  font-size: 1em;
}


.berth-gantt {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid #0dada9;
  border-radius: 25px;
  padding: 8px 16px;
  background-color: #2f3038;
  color: #ffffff;
  font-family: Comfortaa, sans-serif;
  height: 60px;
  margin-bottom: 10px;
  overflow: hidden;
}

.berth-gantt-name {
  font-weight: bold;
  color: #0dada9;
  margin-right: 12px;   /* space between name/size and track */
}

.berth-gantt-track {
  position: relative;
  flex: 1;               /* occupies remaining space */
  height: 100%;
  margin-left: 8px;
  margin-right: 8px;     /* leave some space at the right */
}

.ship-chip-gantt {
  position: absolute;
  height: 40px;
  border: 1px solid #0dada9;
  background-color: #0dada9;
  color: #16171f;
  font-weight: bold;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  white-space: nowrap;
  cursor: pointer;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

/* Tooltip style */
.ship-tooltip {
  position: absolute;
  border: 1px solid #0dada9;
  background-color: #16171f;
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 16px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 9999;
/*  overflow-x: auto;*/
}


/* Tooltip container */
.ship-chip-gantt .tooltip {
  visibility: hidden;
  width: max-content;
  border: 1px solid #0dada9;
  background-color: #16171f;
  color: #fff;
  text-align: center;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 16px;
  position: absolute;
  z-index: 10;
  bottom: 120%; /* position above the chip */
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}

/* Show tooltip on hover */
.ship-chip-gantt:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

.highlight-ship {
  outline: 2px solid #0dada9;
  background-color: rgba(13, 173, 169, 0.2);
  border-radius: 6px;
  transition: background-color 0.6s ease;
}

.highlight-new-ship {
  outline: 2px solid #ad5b0d;
  background-color: rgba(173, 91, 13, 0.2);
  border-radius: 6px;
  transition: background-color 0.6s ease;
}

.empty-berth {
  border: 2px dashed #a6024c;
  background-color: rgba(166, 2, 76, 0.1);
}

.empty-berth .berth-name {
  color: #a6024c;   /* cherry στα ονόματα */
}

.placeholder {
  text-align: left;
  color: #ffffff;
  font: Comfortaa;
  font-size: 20px;
  padding-left: 10px;
  padding-right:15px;
}



/*STYLES THE runBtn when disabled  */
#runBtn:disabled, #addVesselBtn:disabled{
  opacity: 0.5;         /* makes it look faded */
  cursor: not-allowed;  /* shows the "not allowed" cursor */
}

#time-axis {
  position: relative;
  height: 10px;
  margin-bottom: 10px;
  margin-left: 110px;
  margin-right: 25px;
  border-bottom: 1px solid #0dada9;
  font-size: 16px;
  font-weight: bold;
  font-family: Comfortaa, sans-serif;
  color: #0dada9;
}

.time-tick {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  text-align: center;
}

.time-tick::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  height: 10px;
  width: 1px;
  background-color: #0dada9;
}

#solver-info {
  display: flex;
  gap: 15px;
  align-items: flex-start;
}

.info-block-exact, .info-block-heuristic {
  display: flex;
  flex-direction: column;
  align-items: center;
  visibility: hidden;

}

.info-block-exact label, .info-block-heuristic label {
  font-size: 18px;
  color: #0dada9;
  font-family: Comfortaa, sans-serif;
  margin-bottom: 3px;
}


.info-value {
  display: block;
  padding: 4px 8px;
  /*border: 1px solid #0dada9;*/
  /*border-radius: 6px;*/
  background: #2f3038;
  color: #ffffff;
  font-family: Comfortaa, sans-serif;
  font-size: 18px;
  text-align: center;
  width: 50px;
}


.spinner {
    width: 40px;
    height: 40px;
    border: 5px solid #FFF;
    border-bottom-color: #448db8;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    }

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