/* -------------------------------------------------
   MAIN LAYOUT
------------------------------------------------- */
#mainContainer {
  display: flex;
  justify-content: center;
  font-family: 'Times New Roman', Times, serif;
  width: 100%;
}

#container {
  width: min(1500px, 100%);
  min-height: 900px;
  height: auto;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

#header {
  width: 100%;
  text-align: center;
}

#simulation {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* -------------------------------------------------
   LEFT / MIDDLE / RIGHT PANES
------------------------------------------------- */
#leftPaneWrapper {
  display: flex;
  flex-direction: column;
  flex: 1.5;
  min-width: 0;
}

#leftPane {
  padding: 15px;

  background-color: white;
  font-size: medium;
  margin-top: 40px;
  margin-left: 10px;
  border: 1px solid black;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  box-sizing: border-box;
}

#complexity-info {
  margin-left: 10px;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.6;
}

#middlePane {
  flex: 2;
  padding: 10px;
  overflow-y: hidden;
  background-color: transparent;
  font-size: 16px;
  margin-top: 30px;
  display: flex;
  margin-left: 10px;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 15px;
  min-width: 0;

}

#rightPane {
  flex: 2;
  padding: 10px;
  overflow-y: auto;
  background-color: transparent;
  font-size: 16px;
  margin-top: 30px;
  margin-left: 10px;
  background-color: white;
  border: 1px solid black;
  border-radius: 6px;
  margin-right: 10px;
  min-width: 0;
  box-sizing: border-box;

}

/* -------------------------------------------------
   BUTTONS
------------------------------------------------- */
/* RUN BUTTON */
#run {
  height: 35px;
  padding: 0 15px;
  font-size: 0.95rem;
  font-weight: 500;
  background: linear-gradient(135deg, #0a68ff, #004ac2);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  margin-top: 20px;
}

#run:hover:not(:disabled) {
  background: linear-gradient(135deg, #004ac2, #003a99);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

#run:disabled {
  opacity: 1.0;
  cursor: not-allowed;
  background: #005de8;
  box-shadow: none;
}

#run-div{
  display: flex;
  align-items: center;
  justify-content: center;
}


/* CLEAR BUTTON */
#clear {
  margin-top: 5px;
  padding: 8px 12px;
  margin-left: auto;
  display: block;
  background: #d9534f;
  color: #fff;
  border: none;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

#clear:hover {
  background: #c9302c;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

#clear:active {
  transform: scale(0.97);
}

#clear:focus {
  outline: 2px solid #ffb6b6;
  outline-offset: 2px;
}

#lock-div{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-top: 15px;
}



/*  STEPS BUTTON */
#steps-div{
  display: flex;
  margin-top: 50px;
  gap: 75px;
  flex-wrap: wrap;
  justify-content: center;
}

#next-btn{
   background-color: white;
   color: black;
   border: none;
   padding: 8px 18px;
   font-size: 1rem;
   cursor: pointer;
   font-family:'Times New Roman', Times, serif;
   border-radius: 50px;
   font-weight: 500;
   border:solid blue  2px;
}

#prev-btn{
   background-color: #ffffff;  
   color: rgb(11, 1, 11);
   border: none;
   padding: 8px 18px;
   font-size: 1rem;
   cursor: pointer;
   font-family:'Times New Roman', Times, serif;
   border-radius: 50px;
   font-weight: 500;
   border-radius: 50px;
   border:solid rgb(241, 95, 5) 2px;
}



/* -------------------------------------------------
   ALGORITHM SELECTION
------------------------------------------------- */
#available-algorithms {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 100%;
}

#selected-algorithms {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 100%;
  border: 1px solid black;
  padding:5px;
  box-sizing: border-box;
}

#custom-div{
   display: flex;
   gap: 5px;
   flex-wrap: wrap;
}

/* -------------------------------------------------
   SETTINGS / INPUT FIELDS
------------------------------------------------- */
#n-selector {
  display: flex;
  flex-direction: column;
  max-width: 100%;
}

#max-time {
  margin-top: 20px;
}

#results {
  margin-top: 20px;
}

#radio-div{
  display: flex;
  flex-direction: column;
}

#graph-canvas {
  width: 100% !important;
  max-width: 100%;
  height: auto !important;
  display: block;
}

* {
  box-sizing: border-box;
}

/* -------------------------------------------------
   TABLE STYLING
------------------------------------------------- */
.table-container {
  width: 100%;
  overflow-x: auto;
  display: block;
  white-space: nowrap;
  border-radius: 6px;
}

/* Table */
table {
  border-collapse: collapse;
  width: 100%;
  background: #ffffff;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 16px;
}

/* Header Row */
th {
  background: #0A3D91; /* Dark Blue */
  color: white;
  font-weight: 600;
  padding: 12px;
  border: 1px solid #0A3D91;
}

/* Table Cells */
td {
  padding: 12px;
  border: 1px solid #d0d0d0;
}

/* Alternate row shading */
tr:nth-child(even) {
  background: #f5f7fa;
}

/* Hover effect */
tr:hover {
  background: #e6efff;
  transition: background 0.2s ease-in-out;
}

/* Make columns consistent */
th, td {
  min-width: 80px;
  text-align: center;
}

/* -------------------------------------------------
   STATUS INDICATOR
------------------------------------------------- */
#status {
  font-weight: 600;
  font-size: 18px;
}

#status::after {
  content: ' ';
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  background: #4a90e2;
  margin-left: 8px;
  animation: blink 0.7s infinite alternate;
}

@keyframes blink {
  0% { opacity: 0.2; }
  100% { opacity: 1; }
}

#info-text{
  text-align: center;
  font-size: 16px;
}


/* TIP */

.tip {
  position: relative;
  cursor: pointer;
}

/* Tooltip box */
.tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-25%);
  
  background: #051c67;           /* modern dark background */
  color: #f5f5f5;             /* soft white text */
  padding: 3px 8px;           /* small and compact */
  border-radius: 4px;         /* small rounded rectangle */
  font-size: 11px;            /* smaller, neat text */
  font-weight: 500;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);  /* clean subtle shadow */
  
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

/* Tooltip arrow */
.tip::before {
  content: "";
  position: absolute;
  bottom: 122%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #222 transparent transparent transparent;
  opacity: 0;
  transition: opacity 0.18s ease;
}

/* On Hover */
.tip:hover::after,
.tip:hover::before {
  opacity: 1;
}



/* -------------------------------------------------
   UTILITY
------------------------------------------------- */
[hidden] {
  display: none !important;
}

/* -------------------------------------------------
   RESPONSIVE LAYOUT (TABLETS / PHONES)
------------------------------------------------- */
@media (max-width: 1200px) {
  #container {
    min-height: auto;
    padding: 0 8px 12px;
  }

  #simulation {
    flex-direction: column;
    gap: 12px;
  }

  #leftPaneWrapper,
  #middlePane,
  #rightPane {
    width: 100%;
    flex: none;
    margin: 0;
  }

  #leftPane {
    margin: 0;
  }

  #complexity-info {
    margin-left: 0;
  }

  #middlePane {
    padding: 0;
    gap: 10px;
  }

  #rightPane {
    min-height: 320px;
  }

  #steps-div {
    margin-top: 20px;
    gap: 14px;
  }

  table {
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  #header h2 {
    font-size: 1.2rem;
    margin: 10px 0;
  }

  #leftPane,
  #rightPane {
    padding: 10px;
  }

  #available-algorithms button,
  #custom-div button {
    width: 100%;
    text-align: left;
  }

  #steps-div {
    width: 100%;
    gap: 10px;
  }

  #prev-btn,
  #next-btn,
  #run {
    width: 100%;
  }

  #radio-div {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 12px;
  }

  #radio-div label {
    min-width: 88px;
  }

  th,
  td {
    padding: 8px;
    min-width: 70px;
  }

  #status {
    font-size: 16px;
  }
}