/* styles.css (Hermes2) */
/* Style update: typography + colors + layout consistency (no field/selector changes). 
*/

:root{
  --bg: #121212;
  --panel: #1a1a1a;
  --panel2: #1e1e1e;
  --border: #2b2b2b;

  --text: #ffffff;
  --muted: #cfcfcf;

  --font: Arial, sans-serif;

  /* Typography scale */
  --fs-body: 15px;
  --fs-label: 13px;
  --fs-h1: 34px;
  --fs-h2: 18px;
  --fs-section: 22px;
  --fs-subsection: 16px;

  --fw-regular: 400;
  --fw-medium: 600;
  --fw-bold: 800;

  /* Inputs */
  --input-bg: #ffffff;
  --input-text: #111;
  --input-border: #3a3a3a;

  /* Buttons */
  --btn: #1db954;
  --btn-hover: #1aa34a;
  --danger: #ff4d4d;
  --danger-hover: #d93434;

  /* Traffic */
  --green: #00c853;
  --yellow: #ffeb3b;
  --orange: #ff9800;
  --red: #ff1744;
}

*{ box-sizing: border-box; }

body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  margin: 0;
  min-height: 100vh;
}

/* Main container */
.container{
  text-align: center;
  padding: 20px;
  width: 95%;
  max-width: 1100px;
  margin: 0 auto 18px auto;
}

/* Headings */
h1{
  margin: 18px 0 8px 0;
  font-size: var(--fs-h1);
  font-weight: var(--fw-bold);
  letter-spacing: 0.6px;
}

h2{
  margin: 10px 0 18px 0;
  font-size: var(--fs-h2);
  font-weight: var(--fw-medium);
  color: #eaeaea;
}

h3{
  margin: 0;
  font-size: var(--fs-subsection);
  font-weight: var(--fw-bold);
}

/* Labels (smaller than inputs) */
label{
  display: block;
  margin: 0 0 4px 0;
  font-size: var(--fs-label);
  font-weight: var(--fw-medium);
  color: var(--muted);
}

/* Buttons */
.btn{
  background: var(--btn);
  color: #fff;
  border: none;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: var(--fw-medium);
  border-radius: 6px;
  transition: background-color 0.2s ease;
}
.btn:hover{ background: var(--btn-hover); }

.btn-ghost{
  background: transparent;
  border: 1px solid #444;
  color: #ddd;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn-ghost:hover{ border-color: #777; color: #fff; }

.btn-small{
  padding: 6px 10px;
  font-size: 13px;
}

/* Logo */
.logo{
  width: 200px;
  margin: 12px auto 4px auto;
  display: block;
}

/* Logout */
.logout-container{
  text-align: right;
  margin: 10px 20px;
  position: absolute;
  top: 0;
  right: 0;
}
.btn-logout{
  background: var(--danger);
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: var(--fw-medium);
}
.btn-logout:hover{ background: #ff1a1a; }

/* Tables (planning) */
.plan-table{
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: var(--panel2);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
.plan-table th,
.plan-table td{
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: center;
  vertical-align: middle;
  font-size: 14px;
}
.plan-table thead th{
  position: sticky;
  top: 0;
  background: #242424;
  z-index: 1;
}
.plan-table tfoot td{
  background: #181818;
  border-top: 1px solid var(--border);
}

/* Inputs (all white) */
select,
input[type="number"],
input[type="date"]{
  width: 100%;
  padding: 7px 10px;
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--input-text);
  box-sizing: border-box;
}
input[type="number"]{ text-align: center; }

/* Actions row */
.row-actions{
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* Delete button */
.btn-delete{
  background: var(--danger);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-weight: var(--fw-bold);
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-delete:hover{ background: var(--danger-hover); }

/* Output / results block (kept as #output to match Hermes2) */
#output{
  margin-top: 20px;
  padding: 15px;
  background: var(--panel2);
  color: var(--text);
  font-family: monospace;
  white-space: pre-wrap;
  border-radius: 12px;
  text-align: left;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid rgba(255,255,255,0.10);
}

#output h2{
  margin-top: 0;
  margin-bottom: 0.8rem;
  text-align: center;
  font-weight: var(--fw-medium);
  line-height: 1.2;
  color: #eaeaea;
}

/* Login page */
body.login-page{
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
}
.login-container{
  margin: 0 auto;
  width: 100%;
  max-width: 400px;
  padding: 30px;
  background: var(--panel2);
  border-radius: 12px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.10);
}
.login-container h1{
  margin-bottom: 20px;
  font-size: 26px;
  font-weight: var(--fw-bold);
  color: var(--text);
}
.login-container input[type="email"],
.login-container input[type="password"]{
  width: calc(100% - 20px);
  padding: 10px;
  margin: 10px auto;
  display: block;
  border: 1px solid #444;
  border-radius: 6px;
  background: #2b2b2b;
  color: #fff;
  font-size: 14px;
  box-sizing: border-box;
}
.login-container .btn{
  width: calc(100% - 20px);
  padding: 10px;
  margin-top: 10px;
}

/* Receivers block */
#receivers-section{
  margin-top: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.receivers-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.receivers-header h3{
  font-size: var(--fs-subsection);
  font-weight: var(--fw-bold);
}

.receivers-actions{
  display: flex;
  gap: 10px;
}

#receivers-grid{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.receiver-chip{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid #2f2f2f;
  background: #141414;
  color: #fff;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: var(--fw-medium);
}

.receiver-chip input[type="checkbox"]{
  width: 16px;
  height: 16px;
}

/* Static machines layout */
#static-machines-wrapper{
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 30px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* Left panel: keep controls at top-left */
#static-machines-controls{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  min-width: 260px;
}

#static-machines-controls label{
  font-weight: var(--fw-bold);
  color: var(--muted);
}

/* Make this select white like the others */
#static-machines-controls select{
  background: var(--input-bg);
  color: var(--input-text);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  padding: 7px 10px;
  width: 100%;
}

#selected-points{
  margin-top: 6px;
  text-align: left;
  font-size: 13px;
  color: var(--muted);
}

#selected-points button{
  margin-left: 6px;
  background: #333;
  border: none;
  color: #eee;
  cursor: pointer;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
}

#simulate-button-container{
  display: flex;
  justify-content: center;
  margin-top: 18px;
  width: 100%;
}
#simulate-button-container .btn{
  width: 100%;
  max-width: 180px;
}

/* Map */
#mine-map-container{
  position: relative;
  display: inline-block;
  border: 2px solid #444;
  border-radius: 8px;
  overflow: hidden;
}
#mine-map{
  width: 600px;
  height: auto;
  cursor: crosshair;
}

/* Markers */
.marker{
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1px solid #fff;
  pointer-events: none;
  z-index: 10;
  transform-origin: center;
}
.marker.pala{
  background: orange;
  border-radius: 50%;
}
.marker.perfo{
  background: red;
  transform: rotate(45deg);
  border-radius: 2px;
}

/* Legend icons */
.legend-icon{
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  vertical-align: middle;
}
.legend-icon.pala{
  background: orange;
  border-radius: 50%;
  border: 1px solid #fff;
}
.legend-icon.perfo{
  background: red;
  transform: rotate(45deg);
  border: 1px solid #fff;
  border-radius: 2px;
}

/* Spinner */
#spinner{
  display: none;
  text-align: center;
  margin-top: 15px;
}
.css-spinner{
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top: 4px solid #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin{
  0%{ transform: rotate(0deg); }
  100%{ transform: rotate(360deg); }
}
#simulando-text{
  display: inline-block;
  vertical-align: middle;
  font-weight: var(--fw-medium);
  color: #fff;
  font-size: 14px;
  white-space: nowrap;
  position: relative;
}
#simulando-text::after{
  content: "...";
  position: absolute;
  left: 100%;
  width: 1.5em;
  overflow: hidden;
  animation: dotsSlide 1.4s steps(4, end) infinite;
  text-align: left;
}
@keyframes dotsSlide{
  0%{ width: 0em; }
  25%{ width: 0.5em; }
  50%{ width: 1em; }
  75%,100%{ width: 1.5em; }
}

/* Multiple NPC tables (if used elsewhere) */
.npc-table-block{
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.npc-table-title{
  margin: 0 0 10px 0;
  font-family: var(--font);
  font-size: 16px;
  font-weight: var(--fw-bold);
  text-align: left;
}
.npc-table-container{
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  background: var(--panel2);
}
.npc-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 16px;
  background: var(--panel2);
  border: none;
  margin: 0;
}
.npc-table th,
.npc-table td{
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: center;
  min-width: 90px;
}
.npc-table th:last-child,
.npc-table td:last-child{
  border-right: 0;
}
.npc-table tbody tr:last-child td{
  border-bottom: 0;
}
.npc-table th{
  background: #242424;
  color: #fff;
  font-weight: var(--fw-medium);
}
.npc-table td{
  color: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.npc-table td:hover{
  transform: scale(1.05);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.2);
}
.npc-table td[style*="background:orange"],
.npc-table td[style*="background:yellow"]{
  color: #000 !important;
  font-weight: var(--fw-medium);
}

/* Optional: if you use a generic output box somewhere */
.output-box{
  margin-top: 20px;
  text-align: left;
  background: var(--panel2);
  padding: 15px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  white-space: pre-wrap;
  font-family: monospace;
  font-size: 13px;
}
/* Results history */
#error-box{
  display: block;
  margin: 12px auto 0 auto;
  max-width: 1100px;
  color: var(--danger);
  font-family: var(--font);
  font-size: 14px;
  font-weight: var(--fw-medium);
  text-align: left;
}

.result-box{
  font-family: var(--font) !important;
  white-space: normal !important;
}

.results-toolbar{
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.btn-export-action:hover{
  background: var(--btn);
  border-color: var(--btn);
  color: #fff;
}

.btn-danger-action:hover{
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.output-status{
  margin: 8px 0 12px 0;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  background: #171717;
  color: var(--muted);
  font-family: var(--font);
  font-size: 14px;
}

.results-history{
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.result-card{
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  background: #181818;
  box-shadow: 0 4px 14px rgba(0,0,0,0.20);
}

.result-card-header{
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.result-title-input{
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #fff;
  font-size: 18px;
  font-weight: var(--fw-bold);
  padding: 6px 8px;
  border-radius: 8px;
}

.result-title-input:focus{
  outline: none;
  border-color: #444;
  background: #111;
}

.result-card-meta{
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.settings-summary{
  margin: 8px 0 14px 0;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  background: #151515;
}

.settings-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  color: #f0f0f0;
  font-size: 13px;
  margin-bottom: 10px;
}

.settings-subtitle{
  margin: 12px 0 6px 0;
  color: #fff;
  font-size: 13px;
  font-weight: var(--fw-bold);
}

.settings-table-wrap{
  width: 100%;
  overflow-x: auto;
  border: 1px solid #303030;
  border-radius: 12px;
  background: #1d1d1d;
}

.settings-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  background: #1d1d1d;
  border: none;
  margin: 0;
}

.settings-table th,
.settings-table td{
  border: 0;
  border-right: 1px solid #303030;
  border-bottom: 1px solid #303030;
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.settings-table th:last-child,
.settings-table td:last-child{
  border-right: 0;
}

.settings-table tbody tr:last-child td{
  border-bottom: 0;
}

.settings-table th{
  background: #242424;
  color: #fff;
  font-weight: var(--fw-medium);
}

.settings-table td{
  color: #e8e8e8;
}

.settings-table-small{
  max-width: 520px;
}

@media (max-width: 760px){
  .result-card-header{
    grid-template-columns: 1fr;
  }

  .settings-grid{
    grid-template-columns: 1fr;
  }

  .results-toolbar{
    justify-content: stretch;
    flex-direction: column;
    align-items: stretch;
  }
}
