/* Basic reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  background-color: #f3f3f3;
  color: #333;
  line-height: 1.4;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header */
header {
  position: relative;
  padding: 20px;
  background: #4a90e2;
  color: white;
  text-align: center;
}
header .subtitle {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-top: 5px;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 0.9rem;
}
.dark-mode-toggle input {
  margin-right: 5px;
}

/* Container layout */
.container {
  display: flex;
  flex-direction: row;
  max-width: 1200px;
  margin: 20px auto;
  gap: 20px;
}

/* Data Panel (left panel) */
.data-panel {
  flex: 0 0 300px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
  height: calc(100vh - 120px);
  overflow-y: auto;
}
.data-panel h2 {
  margin-bottom: 10px;
  font-size: 1.2rem;
  color: #4a4a4a;
}
.data-panel textarea {
  width: 100%;
  padding: 5px;
  font-size: 0.9rem;
  margin-bottom: 10px;
  resize: vertical;
}
.data-panel button {
  width: 100%;
  padding: 8px;
  font-size: 1rem;
  border: none;
  background: #4a90e2;
  color: white;
  border-radius: 4px;
  cursor: pointer;
}
.data-panel button:hover {
  background: #3f7ec4;
}

/* Main content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Chart wrapper and containers */
#chartWrapper {
  position: relative;
  width: 800px;
  height: 500px;
}
#chartContainer,
#chartContainerLambert {
  width: 800px;
  height: 500px;
  border: 1px solid #ccc;
  background: #fff;
}
#chartContainerLambert {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
}

/* Points Table Section */
.points-table-section {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
}
.points-table-section h3 {
  margin-bottom: 10px;
}
.table-container {
  margin-bottom: 15px;
}
.table-container h4 {
  margin-bottom: 5px;
  font-size: 1rem;
  color: #333;
}
.points-list {
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
}
.points-list table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.points-list th,
.points-list td {
  border: 1px solid #ddd;
  padding: 6px 8px;
  text-align: center;
}
.points-list th {
  background: #f2f2f2;
}
.points-list tr:nth-child(even) {
  background: #fafafa;
}

/* Buttons & inputs */
.btn,
.btn-file,
.btn-select {
  cursor: pointer;
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #f7f7f7;
  transition: background 0.2s ease;
}
.btn:hover,
.btn-file:hover,
.btn-select:hover {
  background: #e2e2e2;
}
.btn:active,
.btn-file:active,
.btn-select:active {
  background: #ddd;
}
.primary-btn {
  background: #4a90e2;
  color: white;
  border: 1px solid #4a90e2;
}
.primary-btn:hover {
  background: #3f7ec4;
}

/* Interpolation Options */
.interpolation-options {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.interpolation-options label {
  font-size: 0.9rem;
}
.interpolation-options input[type="number"] {
  width: 80px;
  padding: 5px;
  font-size: 0.9rem;
}
.interpolation-options input[type="checkbox"] {
  transform: scale(1.2);
}
.interpolation-options button {
  padding: 5px 10px;
  font-size: 0.9rem;
}

/* Professional Help Icons */
.help {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  color: #333;
  background: transparent;
  border: 1px solid #333;
  border-radius: 50%;
  margin-right: 6px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}
.help:hover {
  background: rgba(0, 0, 0, 0.1);
}
.help::after {
  content: attr(data-help);
  position: absolute;
  left: 110%;
  top: 50%;
  transform: translate(8px, -50%);
  white-space: pre-wrap;
  background: #333;
  color: #fff;
  padding: 8px;
  border: 1px solid #222;
  border-radius: 4px;
  width: 220px;
  box-shadow: 0px 2px 6px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 100;
}
.help:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Dark Mode Overrides */
body.dark-mode {
  background-color: #121212;
  color: #ccc;
}
body.dark-mode header {
  background: #222;
  color: #ccc;
}
body.dark-mode .data-panel {
  background: #1a1a1a;
  border-color: #333;
  color: #ccc;
}
body.dark-mode .data-panel h2 {
  color: #ccc;
}
body.dark-mode .main-content {
  background: #121212;
  color: #ccc;
}
body.dark-mode .points-table-section {
  background: #1a1a1a;
  border-color: #333;
  color: #ccc;
}
body.dark-mode .table-container {
  background: #1a1a1a;
  border: 1px solid #333;
  color: #ccc;
}
body.dark-mode input,
body.dark-mode select,
body.dark-mode button {
  background: #222;
  color: #ccc;
  border-color: #444;
}
body.dark-mode button,
body.dark-mode .btn {
  border: 1px solid #4a90e2 !important;
}
body.dark-mode table,
body.dark-mode th,
body.dark-mode td {
  background: #1a1a1a;
  color: #ccc;
  border-color: #333;
}
body.dark-mode #chartContainer,
body.dark-mode #chartContainerLambert {
  background: #000;
}
.dark-mode-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 0.9rem;
}

/* Dark mode for Manual IV Data textarea */
body.dark-mode textarea#manualDataInput {
  background-color: #333;
  color: #ccc;
  border: 1px solid #444;
}
