/* Base Styles */
* {
  margin: 0;
  box-sizing: border-box;
  padding: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

:root {
  --primary-blue: #0d47a1;
  --secondary-blue: #2196f3;
  --light-blue: #e3f2fd;
  --accent-blue: #1976d2;
  --disabled: #98aec4;
  --text-dark: #263238;
  --text-light: #ffffff;
  --border-color: #90caf9;
  --background-light: #f5f9ff;
  --background-white: #ffffff;
  --error-red: #f44336;
  --summary-bg: #1565c0;
  --summary-hover: #0d47a1;
  --invalid-bg: #ffebee;
  --notification-bg: rgb(196, 235, 196);
  --notification-color: green;
  --alert-bg: #ffe8e8;
  --alert-color: red;
  --error-bg: #ffe8e8;
  --error-color: red;
  --label-color: #1976d2;
  --btn-hover: #0d47a1;
  --btn-hover-text: #ffffff;
}
.dark {
  color-scheme: dark;
}
.dark {
  --background-light: #0e1117;
  --background-white: #161c27;
  --light-blue: #1a2236;

  --primary-blue: #4a8fd4;
  --secondary-blue: #3a7bbf;
  --accent-blue: #6aaee8;
  --label-color: #89b8e8;

  --text-dark: #c8d3e0;
  --text-light: #eef3f8;

  --border-color: #2a3547;
  --disabled: #3d4d60;

  --summary-bg: #1d2840;
  --summary-hover: #253252;

  --notification-bg: #1a3028;
  --notification-color: #5cc98a;
  --alert-bg: #2e1f1f;
  --alert-color: #e07070;
  --error-bg: #281818;
  --error-color: #e07070;
  --invalid-bg: #2a1515;

  /* Button Hovers */
  --btn-hover: #5aa0d8;
  --btn-hover-text: #ffffff;
}

body {
  min-height: 100vh;
  padding: 2em;
  padding-bottom: calc(8vh + 2em);
  background-color: var(--background-light);
  color: var(--text-dark);
  line-height: 1.6;
  position: relative;
}

header {
  display: flex;
  justify-content: space-between;
  background-color: var(--primary-blue);
  margin: -2em -2em 0 -2em;
  padding: 1em 2em;
  color: var(--text-light);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  height: 8vh;
}

header a {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 900;
}

header a:hover {
  text-decoration: underline;
}
.navButtons {
  display: flex;
  gap: 20px;
}
/* ── Patch-glow animation ───────────────────────────────────── */
@keyframes badge-pop {
  0% {
    transform: scale(0) rotate(-15deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.2) rotate(5deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes badge-fade {
  0% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.glow-new {
  position: relative;
  box-shadow: 0 0 8px 3px rgba(255, 77, 77, 0.5);
}

/* "NEW" badge */
.glow-new::after {
  content: "ΝΕΟ";
  position: absolute;
  top: -10px;
  right: -10px;
  background: #ff4d4d;
  color: #fff;
  font-size: 0.55em;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 5px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(255, 77, 77, 0.5);
  animation:
    badge-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
    badge-fade 15s linear forwards;
  pointer-events: none;
}
footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background-color: var(--primary-blue);
  margin: 0 -2em -2em -2em;
  padding: 1em 2em;
  color: var(--text-light);
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
  min-height: 8vh;
  position: absolute;
  width: 100%;
  bottom: 0;
}
footer span {
  font-weight: 800;
}
footer a {
  text-decoration: none;
  background-color: var(--secondary-blue);
  color: var(--text-light);
  padding-left: 3px;
  padding-right: 3px;
  border-radius: 3px;
}
/* File Uploader Section */
.fileUploader {
  margin: 2em 0;
  padding: 1.5em;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--background-white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fileUploader label {
  display: block;
  margin-top: 0.5em;
  color: var(--label-color);
}

.fileUploader a {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 900;
}

.fileUploader a:hover {
  text-decoration: underline;
}
/* Notifications styles */
#notifications {
  position: fixed;
  left: 40%;
  top: 5%;
  z-index: 2112121;
}
.notification {
  border-radius: 5px;
  padding: 1em 0.5em;
  width: 100%;
  text-align: center;
  background-color: var(--notification-bg);
  color: var(--notification-color);
}
.alert {
  background-color: var(--alert-bg);
  color: var(--alert-color);
}
.error {
  border: 1px dashed var(--error-color);
  color: var(--error-color);
  background-color: var(--error-bg);
  outline: none;
}

/* Top Section with Anakritikoi */
.top {
  background-color: var(--background-white);
  padding: 1.5em;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 2em;
}

#initial {
  margin-top: 1em;
}
#initial,
.output {
  font-family: "Calibri", sans-serif;
  background-color: var(--background-light);
  color: var(--text-dark);
  padding: 1em;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

#copy-initial {
  align-self: flex-end;
  margin-top: 1em;
}

.anakritikoi {
  display: flex;
  width: 100%;
  gap: 5%;
  justify-content: space-around;
  margin-bottom: 1.5em;
}

.anakritikoi div {
  display: flex;
  flex-direction: column;
  width: 45%;
}

.anakritikoi label,
.selectLabel {
  margin-bottom: 0.5em;
  color: var(--label-color);
  font-weight: 500;
}

.anakritikoi select,
select {
  padding: 0.5em;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--background-white);
  color: var(--text-dark);
}
.ektheseisTab > .anakritikoi {
  justify-content: end;
}
.ektheseisTab > .anakritikoi input[type="file"] {
  padding: 0.5em;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--background-white);
  color: var(--text-dark);
}
.customDocs {
  display: flex;
  gap: 20px;
}
/* Data Containers */
.flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.data {
  gap: 2em;
  padding: 1.5em;
  background-color: var(--background-white);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5em;
}

.input,
.output {
  width: 40%;
  height: 25vh;
  padding: 1em;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  resize: vertical;
  max-height: 40vh;
  background-color: var(--background-white);
  color: var(--text-dark);
}

.input:focus,
.output:focus {
  outline: none;
  border-color: var(--secondary-blue);
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

input[type="text"],
input[type="date"],
input[type="number"],
input[type="email"],
textarea {
  background-color: var(--background-white);
  color: var(--text-dark);
  border: 1px solid var(--border-color);
  padding: 0.5em;
  border-radius: 4px;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--secondary-blue);
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

/* Tabs/Tab Content  */

.tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 1.5em 1em 0 1em;
  border-bottom: 2px solid var(--border-color);
  background-color: var(--background-light);
  position: relative;
}
.tab {
  cursor: pointer;
  padding: 0.8em 1.2em;
  background-color: var(--summary-bg);
  color: var(--text-light);
  font-weight: 600;
  border: 1px solid var(--secondary-blue);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  position: relative;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  min-width: 250px;
  text-align: center;
  z-index: 1;
}
.tab:hover {
  background-color: var(--summary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.clicked {
  cursor: default;
  padding: 0.8em 1.2em;
  /* background: var(--light-blue); */
  background: linear-gradient(
    to left,
    var(--light-blue),
    var(--background-white)
  );
  color: var(--text-dark);
  font-weight: 700;
  border: 2px solid var(--secondary-blue);
  border-bottom: 2px solid var(--background-light);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  position: relative;
  top: -2px;
  min-width: 250px;
  text-align: center;
  z-index: 2;
  transition: all 0.3s ease;
}
.tab h2,
.clicked h2 {
  margin: 0;
  padding: 0;
  color: inherit;
  border: none;
  font-size: 1.2em;
}

.tab::marker,
.tab::-webkit-details-marker,
.clicked::marker,
.clicked::-webkit-details-marker {
  color: var(--text-light);
  font-size: 1.2em;
}

.tabContent {
  height: fit-content;
  padding-bottom: 1.5em;
}
.tabContent > div {
  animation: fadeIn 0.3s ease;
}
.tabTitle {
  display: flex;
  gap: 40px;
}
.tabTitle .anakritikoi {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Format Controls */
.format {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1em;
}

.arrow {
  color: var(--secondary-blue);
  font-size: 1.5em;
  font-weight: bold;
}

/* Buttons */
button,
.button,
input[type="file"]::file-selector-button {
  padding: 0.6em 1.2em;
  background-color: var(--secondary-blue);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition:
    background-color 0.2s,
    transform 0.1s;
}

button:hover,
.button:hover,
input[type="file"]::file-selector-button:hover {
  background-color: var(--accent-blue);
}

button:active,
.button:active,
input[type="file"]::file-selector-button:active {
  transform: scale(0.98);
}
button:disabled,
.button:disabled {
  background-color: var(--disabled);
  &:active {
    transform: none;
  }
}

.helpBtn {
  background-color: var(--accent-blue);
  color: #ffffff;
  border-radius: 5px;
  width: 1.5em;
  height: 1.5em;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  transition:
    background-color 0.2s,
    transform 0.1s;
}

.large {
  width: fit-content;
  max-width: 200px;
  padding: 0.6em 1.2em;
  height: 50px;
}

.helpBtn:hover {
  background-color: var(--btn-hover);
  color: var(--btn-hover-text);
}
.large:hover {
  background-color: var(--light-blue);
  color: var(--primary-blue);
}
.helpBtn:active {
  transform: scale(0.95);
}

/* Button Grid */
.buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));

  gap: 1em;
  padding: 1em 1.5em;
}

.buttons .helpBtn {
  width: 100%;
  text-align: center;
}

.format button {
  min-width: 120px;
}
/* Dialog Styles */
dialog {
  top: 10%;
  left: 10%;
  width: 80%;
  height: 80%;
  padding: 2em;
  border-radius: 8px;
  box-shadow: 0 0 2em rgba(0, 0, 0, 0.3);
  border: none;
  background-color: var(--background-white);
  color: var(--text-dark);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

dialog:focus {
  outline: none;
}

dialog a {
  color: var(--accent-blue);
  text-decoration: underline;
  cursor: pointer;
}

dialog table {
  width: 90%;
  border-collapse: collapse;
  margin-bottom: 1em;
}

dialog th,
dialog td {
  border: 1px solid var(--border-color);
  padding: 8px;
  text-align: left;
}

dialog th {
  background-color: var(--accent-blue);
  color: white;
}

dialog h3 {
  margin-top: 1em;
  margin-bottom: 0.5em;
}

.container {
  display: flex;
  flex-direction: column;
  gap: 2em;
  position: relative;
  height: 100%;
  overflow-y: auto;
}

.container img {
  width: 70%;
  max-width: 800px;
  height: auto;
  align-self: center;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.closeModal {
  border: none;
  background-color: var(--error-red);
  color: #ffffff;
  align-self: flex-end;
  width: 1.5em;
  height: 1.5em;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: x-large;
  position: sticky;
  top: 0;
  right: 0;
  cursor: pointer;
  border-radius: 50%;
  z-index: 10;
  margin-right: 15px;
}

.closeModal:hover {
  background-color: #d32f2f;
}

/* Lists */
ol,
ul {
  padding-left: 1.5em;
  margin-bottom: 1em;
}

ol li,
ul li {
  margin-bottom: 0.5em;
}

/* Form Styles */
.dataForm {
  display: flex;
  gap: 3em;
  background-color: var(--background-white);
  padding: 2em;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#anakritikoiList {
  display: flex;
  flex-direction: column;
  gap: 1em;
  width: 100%;
}

.anakritikoi-row {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  padding: 1em;
  background-color: var(--background-light, #f5f5f5);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.anakritikoi-row .row-label {
  font-weight: 600;
  color: var(--label-color);
  font-size: 0.95em;
}

.anakritikoi-row .row-fields {
  display: flex;
  gap: 1em;
  flex-wrap: wrap;
  align-items: center;
}

.anakritikoi-row .row-fields select {
  width: 7em;
}

.anakritikoi-row .row-fields input {
  flex: 1;
  min-width: 200px;
}

@media (max-width: 600px) {
  .anakritikoi-row .row-fields {
    flex-direction: column;
    align-items: stretch;
  }
  .anakritikoi-row .row-fields select,
  .anakritikoi-row .row-fields input {
    width: 100%;
    min-width: unset;
  }
}

.dataForm input,
.dataForm select {
  width: 20em;
  padding: 0.6em;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 0.5em;
  background-color: var(--background-white);
  color: var(--text-dark);
}

.dataForm input:focus,
select:focus {
  outline: none;
  border-color: var(--secondary-blue);
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}
.smallForm {
  width: 40%;
}
.smallForm input,
.smallForm select {
  width: 12em;
}

.dataForm label {
  color: var(--label-color);
  font-weight: 500;
  margin-bottom: 0.3em;
  display: inline-block;
}
.fields {
  flex: 1;
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 4px;
  grid-template-columns: repeat(auto-fit, minmax(267px, 1fr));
}
.fields div {
  display: flex;
  flex-direction: column;
  justify-self: end;
}
.smallForm .fields div {
  justify-self: center;
}
.fields button.helpBtn {
  grid-column: 1 / -1;
  justify-self: end;
}

.anakritikoiBtns {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 1.5em;
  padding-top: 1.5em;
}

#addAnakritikoi {
  background-color: #4caf50;
}

#addAnakritikoi:hover {
  background-color: #388e3c;
}

#removeAnakritikoi,
.deleteBtn {
  background-color: #f44336;
}

#removeAnakritikoi:hover,
.deleteBtn:hover {
  background-color: #d32f2f;
}

input:invalid {
  background-color: var(--invalid-bg);
  border: 2px solid var(--error-red);
}

/* Protocol Container */
.protokolo-container {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 1em;
}

.protokolo-container input {
  width: 10em !important;
}

/* Endooikogeniaki radio buttons*/
fieldset {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1em;
  margin-bottom: 1.5em;
  background-color: var(--background-white);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5em;
}

legend {
  font-weight: bold;
  color: var(--label-color);
  padding: 0 0.5em;
  font-size: 0.95em;
}

/* Aligning radio buttons and labels */
fieldset div {
  display: flex;
  align-items: center;
  gap: 0.4em;
  cursor: pointer;
}

fieldset input[type="radio"] {
  accent-color: var(--primary-blue);
  width: 1.2em;
  height: 1.2em;
  cursor: pointer;
}

/* Horizontal Rules */
hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 1em 0;
}

@media (max-width: 1100px) {
  .tabs {
    flex-direction: column;
    gap: 4px;
  }
}

/* Media Queries - minimal mobile support */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: center;
    gap: 5px;
    height: fit-content;
  }
  .navButtons {
    width: 100%;
    justify-content: space-between;
  }
  .theme-toggle {
    align-self: flex-end;
    margin-top: 5px;
  }
  .anakritikoi {
    flex-direction: column;
    align-items: center;
  }
  .person,
  .flex {
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: flex-start;
  }
  .tabs {
    flex-direction: column;
    gap: 4px;
  }
  .tab,
  .clicked {
    min-width: 100%;
  }
  .customDocs {
    flex-direction: column;
  }

  .top {
    height: fit-content;
    gap: 1em;
  }
  .fileUploader {
    flex-direction: column;
    align-items: start;
  }

  .data {
    flex-direction: column;
    height: fit-content;
    align-items: center;
    padding: 1em;
  }

  .input,
  .output {
    width: 100%;
    height: 20vh;
  }

  .arrow {
    transform: rotate(90deg);
  }

  .dataForm {
    flex-direction: column;
    width: 100%;
    padding: 1em;
  }

  .dataForm input,
  .fields input {
    width: 100%;
  }
  .fields div {
    justify-self: center;
    width: 100%;
  }
  .smallForm input {
    width: 10em;
  }
}
.hidden {
  display: none;
}

.theme-toggle {
  /* pill track */
  position: relative;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  width: 64px;
  height: 32px;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.3s ease,
    border-color 0.3s ease;
  overflow: visible;
}

/* the sliding knob */
.theme-toggle::before {
  content: "☀️";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75em;
  line-height: 24px;
  text-align: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.6);
  transform: none;
}

/* dark mode state: knob slides right, shows moon */
.dark .theme-toggle {
  background: rgba(70, 102, 147, 0.25);
  border-color: rgba(35, 45, 63, 0.5);
}

.dark .theme-toggle::before {
  content: "🌙";
  transform: translateX(32px);
  background: #161c27;
}

.dark .theme-toggle:hover {
  background: rgba(44, 67, 100, 0.25);
  border-color: rgba(18, 24, 34, 0.5);
}
@media (max-width: 480px) {
  body {
    padding-left: 0.5em;
    padding-right: 0.5em;
  }
  .navButtons {
    gap: 8px;
  }
  footer {
    margin: 0;
  }
}
