/* styles.css */
/* Reset and base layouttt */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: "Lato", "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #f1f4f8;
  color: #1f2a36;
  line-height: 1.5;
}

.page-shell {
  max-width: 1240px;
  margin: 20px auto;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 35, 52, 0.15);
  padding: 24px 28px 16px;
}

/* Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid #dde4ee;
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0050a0, #0093d1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 16px rgba(0, 80, 160, 0.35);
}

.brand-text h1 {
  font-size: 1.6rem;
  color: #0a2f57;
  margin-bottom: 4px;
}

.brand-text p {
  max-width: 640px;
  font-size: 0.95rem;
  color: #4c5b70;
}

.header-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  font-size: 0.8rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 600;
}

.badge-primary {
  background-color: #0050a0;
  color: #ffffff;
}

.badge-outline {
  border: 1px solid #0050a0;
  color: #0050a0;
}

/* Tabs navigation */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 12px 0 8px;
  border-bottom: 1px solid #dde4ee;
}

.tablink {
  border: none;
  background-color: transparent;
  padding: 8px 14px;
  border-radius: 8px 8px 0 0;
  font-size: 0.9rem;
  color: #42546a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tablink i {
  font-size: 0.85rem;
}

.tablink.active {
  background: linear-gradient(135deg, #0050a0, #0093d1);
  color: #ffffff;
}

.tablink:hover:not(.active) {
  background-color: #edf2fb;
}

/* Main content */
.main-container {
  margin-top: 8px;
}

.tabcontent {
  display: none;
  margin-top: 12px;
}

/* Cards and grid */
.card {
  background-color: #ffffff;
  border-radius: 10px;
  border: 1px solid #dde4ee;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.hero-card {
  border-left: 4px solid #0050a0;
}

.secondary-card {
  background-color: #f8fafc;
}

.card h2 {
  font-size: 1.3rem;
  color: #0f2941;
  margin-bottom: 10px;
}

.card h3 {
  font-size: 1.1rem;
  color: #153558;
  margin-bottom: 8px;
}

.card p {
  font-size: 0.95rem;
  color: #43536b;
  margin-bottom: 10px;
}

.grid-two {
  display: grid;
  grid-template-columns: 1.7fr 1.3fr;
  gap: 14px;
}

.info-band {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(0, 80, 160, 0.08), rgba(0, 147, 209, 0.06));
}

/* Lists */
.bullet-list {
  padding-left: 18px;
  margin-top: 6px;
}

.bullet-list li {
  margin-bottom: 4px;
  font-size: 0.93rem;
}

.ordered-list {
  padding-left: 18px;
}

.ordered-list li {
  margin-bottom: 6px;
  font-size: 0.95rem;
}

/* Text helpers */
.small-note {
  font-size: 0.82rem;
  color: #6a7a92;
}

.muted {
  font-size: 0.9rem;
  color: #7b8799;
}

/* Links and buttons */
.link-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: #0050a0;
  text-decoration: none;
}

.link-inline i {
  font-size: 0.8rem;
}

.link-inline:hover {
  text-decoration: underline;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #0050a0;
  background-color: #ffffff;
  color: #0050a0;
  font-size: 0.9rem;
  text-decoration: none;
}

.btn-link:hover {
  background-color: #0050a0;
  color: #ffffff;
}

.buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.buttons-row button {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  background: linear-gradient(135deg, #0050a0, #0093d1);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(0, 80, 160, 0.25);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.buttons-row button:hover {
  box-shadow: 0 6px 14px rgba(0, 80, 160, 0.35);
  transform: translateY(-1px);
}

/* Video */
.video-wrapper {
  margin-top: 8px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #dde4ee;
  background-color: #000000;
}

.video-wrapper video,
.video-wrapper iframe {
  display: block;
  width: 100%;
  max-height: 360px;
}

/* Script textarea */
.script-box {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #c6d0e2;
  padding: 10px;
  font-family: "Source Sans 3", monospace;
  font-size: 0.88rem;
  resize: vertical;
  background-color: #f9fbff;
}

/* Attributes */
.attributes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.attribute-card {
  flex: 1 1 240px;
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #dde4ee;
  background: radial-gradient(circle at top left, rgba(0, 147, 209, 0.08), #ffffff);
}

.attribute-icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background-color: rgba(0, 80, 160, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0050a0;
}

.attribute-content h4 {
  font-size: 0.98rem;
  margin-bottom: 3px;
  color: #153558;
}

.attribute-content p {
  font-size: 0.9rem;
}

/* Configuration */
.config-grid {
  display: grid;
  grid-template-columns: 1.5fr 1.1fr;
  gap: 14px;
}

.config-left,
.config-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-card {
  background-color: #f7fafc;
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid #dde4ee;
}

.input-card h3,
.input-card h4 {
  margin-bottom: 6px;
}

.input-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.input-level-card {
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid #dde4ee;
  padding: 10px 12px;
  flex: 1 1 260px;
}

.input-level-card h4 {
  font-size: 0.96rem;
  margin-bottom: 4px;
}

.reference {
  font-size: 0.78rem;
  color: #74839a;
}

.options label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 0.9rem;
  color: #44546a;
}

.options input[type="radio"],
.options input[type="checkbox"] {
  accent-color: #0050a0;
}

/* Slider */
.slider-option label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
}

#costSlider {
  width: 100%;
  margin-top: 6px;
}

/* Form items */
.form-item {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}

.form-item label {
  font-size: 0.86rem;
  font-weight: 600;
  color: #32435a;
  margin-bottom: 2px;
}

.form-item input[type="text"],
.form-item select,
.form-item textarea {
  border-radius: 6px;
  border: 1px solid #c6d0e2;
  padding: 6px 8px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
}

/* Toggle switch */
.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.toggle-switch input {
  display: none;
}

.toggle-slider {
  width: 34px;
  height: 18px;
  background-color: #c6d0e2;
  border-radius: 999px;
  position: relative;
  transition: background-color 0.2s ease;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #ffffff;
  top: 1px;
  left: 1px;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 4px rgba(15, 35, 52, 0.4);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #0093d1;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
}

.toggle-label {
  font-size: 0.9rem;
  color: #43536b;
}

/* Config summary */
.config-summary-card {
  min-height: 120px;
}

/* Textarea briefing */
#briefingText {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #c6d0e2;
  font-size: 0.9rem;
  font-family: inherit;
  background-color: #ffffff;
}

/* Charts */
.chart-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.chart-box {
  background-color: #ffffff;
  border-radius: 10px;
  border: 1px solid #dde4ee;
  padding: 10px 12px;
}

.chart-box h3 {
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: #153558;
}

.chart-box-large {
  min-height: 260px;
}

canvas {
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid #eef2f9;
}

/* Costs */
.calculation-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 12px;
}

.cost-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.cost-card {
  flex: 1 1 230px;
  background-color: #ffffff;
  border-radius: 10px;
  border: 1px solid #dde4ee;
  padding: 10px 12px;
}

.cost-card h4 {
  font-size: 0.94rem;
  color: #153558;
  margin-bottom: 4px;
}

/* Table */
.table-container {
  margin-top: 10px;
  overflow-x: auto;
}

#scenarioTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

#scenarioTable th,
#scenarioTable td {
  border: 1px solid #dde4ee;
  padding: 6px 8px;
  text-align: center;
}

#scenarioTable th {
  background-color: #0050a0;
  color: #ffffff;
  font-weight: 600;
}

#scenarioTable tr:nth-child(even) {
  background-color: #f6f8fc;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 80;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(8, 24, 48, 0.5);
}

.modal-content {
  background-color: #ffffff;
  margin: 60px auto;
  padding: 16px 18px;
  border-radius: 10px;
  max-width: 620px;
  position: relative;
  box-shadow: 0 10px 30px rgba(8, 24, 48, 0.4);
}

.close-button {
  border: none;
  background: none;
  position: absolute;
  top: 10px;
  right: 10px;
  color: #7b8799;
  cursor: pointer;
  font-size: 1.2rem;
}

/* Toast */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  min-width: 220px;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 10px;
  background-color: #0050a0;
  color: #ffffff;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 90;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Footer */
.footer {
  margin-top: 18px;
  border-top: 1px solid #dde4ee;
  padding-top: 10px;
  text-align: center;
  font-size: 0.8rem;
  color: #7b8799;
}

/* Responsive */
@media (max-width: 1024px) {
  .page-shell {
    margin: 8px;
    padding: 18px 16px 10px;
  }
  .top-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  .header-meta {
    align-items: flex-start;
  }
  .grid-two {
    grid-template-columns: 1fr;
  }
  .config-grid {
    grid-template-columns: 1fr;
  }
  .chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .tabs {
    overflow-x: auto;
  }
  .tablink {
    white-space: nowrap;
  }
}
