/* C-IMMSim — classic aesthetic matching original kraken.iac.rm.cnr.it/C-IMMSIM */

body {
  font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
  font-size: 12px;
  background: #f8f8f8;
  margin: 0;
  padding: 0;
}

.wrapper {
  background-color: #EEE;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  border-left: 1px solid #ccc;
  border-right: 1px solid #ccc;
  min-height: 100vh;
}

/* Logo */
.logo-area {
  text-align: center;
  padding: 12px 0 8px;
}

.logo-img {
  width: 400px;
  height: 100px;
  object-fit: contain;
}

/* Tab nav */
.nav-table {
  width: 100%;
  margin: 0 auto 0;
  border-collapse: collapse;
}

.nav-table td {
  text-align: center;
  padding: 0;
  border-bottom: 2px solid #aaa;
}

.nav-table a {
  display: block;
  padding: 7px 16px;
  text-decoration: none;
  color: #333;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
}

.nav-table a:hover {
  background: #ccc;
}

.nav-table a.currentpage {
  background: #3d7eb5;
  color: #fff;
}

/* Content */
.content-wrap {
  padding: 14px 25px;
}

/* Section titles */
.section-title {
  font-weight: bold;
  font-size: 12px;
  margin: 0 0 4px;
}

/* Job tables */
.job-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-bottom: 12px;
}

.job-table th {
  background: #bbb;
  padding: 4px 8px;
  border: 1px solid #aaa;
  text-align: left;
  font-size: 11px;
}

.job-table td {
  padding: 3px 8px;
  border: 1px solid #ddd;
  vertical-align: middle;
}

.job-table tr:nth-child(even) td {
  background: #f5f5f5;
}

.status-running {
  color: #2980b9;
  font-weight: bold;
}

/* Simulation progress bar (ACTIVE PROCESSES) */
.progress-track {
  position: relative;
  width: 110px;
  height: 14px;
  background: #e6e6e6;
  border: 1px solid #ccc;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #bfbfbf;
  transition: width 0.4s ease;
}

.progress-label {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  text-align: center;
  line-height: 14px;
  font-size: 10px;
  color: #222;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff;
}

.status-completed {
  color: #27ae60;
  font-weight: bold;
}

.status-failed {
  color: #e74c3c;
  font-weight: bold;
}

/* FASTA sequence field: a highlight layer sits under the real textarea
   (whose own text/background are transparent) so invalid characters can be
   colored without losing native textarea editing/caret behavior. */
.fasta-wrap {
  position: relative;
}

.fasta-highlight,
.fasta-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 90px;
  margin: 0;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.4;
  padding: 4px 6px;
  border: 1px solid transparent;
  white-space: pre-wrap;
  word-break: break-all;
}

.fasta-highlight {
  position: absolute;
  inset: 0;
  overflow: auto;
  color: #111;
  pointer-events: none;
  z-index: 1;
}

.fasta-bad {
  background: #e74c3c;
  color: #fff;
  border-radius: 2px;
}

.fasta-input {
  position: relative;
  z-index: 2;
  background: transparent;
  color: transparent;
  caret-color: #111;
  border-color: #ccc;
  resize: vertical;
}

.fasta-input.fasta-input-error {
  border-color: #e74c3c;
  box-shadow: 0 0 0 1px #e74c3c;
}

.fasta-msg {
  font-size: 11px;
  color: #e74c3c;
  min-height: 14px;
  margin: 2px 0 6px;
}

/* Buttons (small, inline) */
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 0 3px;
}

.btn-del {
  color: #c0392b;
}

.btn-del:hover {
  color: #e74c3c;
}

.btn-copy {
  color: #2980b9;
}

/* Form styling */
.params-table {
  border-collapse: collapse;
  margin-bottom: 6px;
}

.params-table td {
  padding: 3px 10px 3px 0;
  vertical-align: top;
  font-size: 11px;
}

.params-table input[type="text"],
.params-table input[type="number"] {
  width: 140px;
  padding: 2px 5px;
  border: 1px solid #bbb;
  border-radius: 2px;
  font-size: 11px;
}

.params-table select {
  padding: 2px 5px;
  border: 1px solid #bbb;
  border-radius: 2px;
  font-size: 11px;
  min-width: 140px;
}

.params-table textarea {
  padding: 3px 5px;
  border: 1px solid #bbb;
  border-radius: 2px;
  font-family: monospace;
  font-size: 11px;
  width: 500px;
}

/* Injection blocks */
.injection-block {
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: #f9f9f9;
}

.injection-block strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
}

.protein-block {
  border: 1px dashed #bbb;
  border-radius: 3px;
  padding: 6px 8px;
  margin-bottom: 6px;
  background: #fff;
}

/* Submit button */
.submit-btn {
  background: #3d7eb5;
  color: #fff;
  border: none;
  padding: 8px 24px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 3px;
  letter-spacing: 1px;
  margin-top: 8px;
}

.submit-btn:hover {
  background: #2c6a9a;
}

.submit-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* Small action buttons */
.btn-sm {
  padding: 2px 8px;
  font-size: 11px;
  border: 1px solid #bbb;
  border-radius: 2px;
  background: #f0f0f0;
  cursor: pointer;
}

.btn-sm:hover {
  background: #ddd;
}

.btn-sm-danger {
  border-color: #c0392b;
  color: #c0392b;
}

.btn-sm-danger:hover {
  background: #fce;
}

.btn-sm-primary {
  border-color: #3d7eb5;
  color: #3d7eb5;
}

/* Login / Register */
.auth-table {
  border-collapse: collapse;
}

.auth-table td {
  padding: 4px 6px;
  font-size: 12px;
}

.auth-table input {
  padding: 3px 6px;
  border: 1px solid #bbb;
  border-radius: 2px;
  width: 200px;
  font-size: 12px;
}

.auth-btn {
  background: #3d7eb5;
  color: #fff;
  border: none;
  padding: 5px 16px;
  cursor: pointer;
  font-size: 12px;
  border-radius: 2px;
}

.auth-btn:hover {
  background: #2c6a9a;
}

.auth-toggle {
  color: #3d7eb5;
  cursor: pointer;
  font-size: 11px;
  text-decoration: underline;
}

.auth-error {
  color: #c0392b;
  font-size: 11px;
  margin-top: 4px;
}

/* Info box (status message) */
.info-box {
  background: #dff0d8;
  border: 1px solid #3c763d;
  border-radius: 3px;
  padding: 6px 12px;
  margin-bottom: 10px;
  font-size: 11px;
  color: #3c763d;
}

.info-box.error {
  background: #f2dede;
  border-color: #a94442;
  color: #a94442;
}

/* Charts */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.chart-card {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 10px;
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.chart-card h4 {
  margin: 0;
  font-size: 11px;
  color: #333;
}

.log-toggle {
  font-size: 10px;
  font-weight: normal;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
}

/* Admin */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.admin-table th {
  background: #999;
  color: #fff;
  padding: 3px 5px;
  text-align: left;
  border: 1px solid #888;
  white-space: nowrap;
}

.admin-table td {
  padding: 2px 5px;
  border: 1px solid #ddd;
  white-space: nowrap;
}

.admin-table tr:nth-child(even) td {
  background: #f5f5f5;
}

.admin-user-link {
  color: #3d7eb5;
  text-decoration: underline;
  cursor: pointer;
}
.admin-user-link:hover {
  color: #1a5a8a;
}
.admin-user-active {
  font-weight: bold;
  color: #1a5a8a;
}

/* Footer */
.footer {
  padding: 14px 25px;
  font-size: 11px;
  border-top: 2px solid #aaa;
  margin-top: 20px;
  color: #444;
}

.footer b {
  font-size: 12px;
}

.footer a {
  color: #3d7eb5;
}

/* User bar */
.user-bar {
  text-align: right;
  padding: 4px 25px;
  font-size: 11px;
  color: #555;
  background: #ddd;
  border-bottom: 1px solid #bbb;
}

.user-bar a {
  color: #3d7eb5;
  cursor: pointer;
  text-decoration: underline;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #ccc;
  border-top-color: #3d7eb5;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin-left: 6px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Generic modal (e.g. admin IP-info popup) */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: #fff;
  border: 1px solid #999;
  border-radius: 3px;
  min-width: 280px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #999;
  color: #fff;
}

.modal-header .modal-close {
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.modal-body {
  padding: 12px;
}
