/* 1) Global reset & base styling */
body {
  font-family: 'Poppins', sans-serif;
  background: #89A8B2; /* Glavna pozadina */
  margin: 0;
  padding: 0;
  color: #333; /* Osnovna boja teksta */
}

/* Dugme u gornjem desnom uglu ("Single rebar areas") */
.top-right-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  background: #608BC1;
  color: #fff;
  padding: 8px 14px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: opacity 0.2s ease;
}
.top-right-btn:hover {
  opacity: 0.9;
}

/* Kontejner */
.container {
  max-width: 640px;
  margin: 30px auto;
  padding: 20px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  position: relative;
}

/* Naslov */
h1 {
  margin-top: 0;
  font-size: 1.6rem;
  font-weight: 600;
  color: #333;
  text-align: center;
}

/* Područje gde smestamo calc-blockove */
#calcContainer {
  margin-top: 20px;
}

/* Donji row za Add i Reset itd. */
.bottom-btns-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

/* 2) Kalkulator (calc-block) sa fadeIn */
.calc-block {
  margin-bottom: 20px;
  background: #fcfcfc; /* lagano bela/siva za blok */
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  animation: fadeIn 0.3s ease-out forwards; /* fadeIn efekat */
  position: relative;
}

/* KEYFRAMES FOR FADE-IN/FADE-OUT */
@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(-5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeOut {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-5px);
  }
}
.fade-out {
  animation: fadeOut 0.3s ease-in forwards;
}

/* Naslov u kalkulatoru */
.calc-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #89A8B2;
}

/* Ova klasa se koristi za dugme "Save" */
.save {
  background-color: #ee5253 !important;
}

/* Collapsed row */
.collapsed-row {
  background: #fff;
  border-radius: 5px;
  padding: 8px;
  margin-top: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.collapsed-row .btn {
  margin-left: 8px;
}

/* First iteration + findBtn */
.first-iteration label {
  display: block;
  font-weight: 600;
  margin: 10px 0 5px;
  color: #555;
}
.first-iteration input {
  width: 30%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Originalni stil za #findBtn (zadržan netaknut) */
#findBtn {
  display: inline-block;
  padding: 7px 10px;
  background-color: #608BC1;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}
#findBtn:hover {
  background-color: #4a6fa5;
}

/* 3) Dugmad (generalno) */
.btn {
  display: inline-block;
  padding: 8px 14px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  border-radius: 5px;
  transition: background 0.2s ease, opacity 0.2s ease;
  margin-right: 10px;
  color: #fff;
}
.btn:hover {
  opacity: 0.9;
}
.red-btn {
  background-color: #608BC1;
}
.light-blue-btn {
  background: #cce5ff;
  color: #333;
  border: 1px solid #99ccff;
}

/* result items */
.result-item {
  background: #ececec;
  margin: 6px 0;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  color: #333;
}
.result-item:hover {
  background: #ddd;
}
.result-item.selected {
  background: #fae4e4;
}
.result-item.selected .series-code {
  color: #d21f3c;
  font-weight: bold;
}

/* Collapsible "Adjust search" */
.refine-header {
  cursor: pointer;
  margin: 10px 0;
  font-weight: 600;
  color: #155E95;
}
.refine-header span.arrow {
  margin-left: 5px;
}
.refine-body.hidden {
  display: none;
}

/* Select + clear dugme */
.select-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  margin-bottom: 10px;
}
.select-wrapper select {
  width: 100%;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
}
.clear-btn {
  position: absolute;
  right: 5px;
  top: 8px;
  background: #ee5253;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 0.8rem;
  line-height: 1;
  display: none;
}
.clear-btn:hover {
  background: #c0392b;
}

/* Helper klasa za skrivanje */
.hidden {
  display: none !important;
}

/* Uklanjanje bullet-tačaka iz UL listi */
ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

/* *******************
   MODAL i OVERLAY
   ******************* */
.modal-overlay {
  position: fixed;
  top: 0; 
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.4);

  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999; /* da bude iznad svega */
}

.modal {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  /* Dovoljno široko da tabela uvek stane */
  width: 550px;
  max-width: 95%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.modal h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.2rem;
  color: #333;
  text-align: center;
}

.modal input[type="text"] {
  width: 100%;
  padding: 8px;
  margin-bottom: 15px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
}
.modal-buttons button {
  margin-left: 8px;
}

/* **** Tabela za Single Rebar Areas modal **** */
/* Ključ: margin: 0 auto za centralno poravnanje */
.rebar-table {
  width: auto;
  border-collapse: collapse;
  margin: 0 auto 20px; 
}

.rebar-table th,
.rebar-table td {
  border: 1px solid #ddd;
  padding: 6px 8px;
  text-align: center;
  white-space: nowrap;
}

.rebar-table thead {
  background: #f1f1f1;
  font-weight: 600;
}
