/* ========================================
   Calculator Styles
   ======================================== */

/* Top Controls */
.top-controls {
  margin-bottom: 1rem;
  text-align: left;
  padding-left: 70px;
}

.top-controls label {
  font-weight: bold;
}

.top-controls input[type="number"],
.top-controls select {
  padding: 0.25rem 0.4rem;
  width: 120px;
  margin-left: 0.25rem;
  box-sizing: border-box;
}

.top-controls button {
  margin-left: 0.5rem;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
}

/* Layout */
.layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.table-container {
  overflow-x: auto;
  min-width: 0;
  flex: 1;
}

/* Calculator Boxes */
.calculator-box {
  background: #ffffff;
  border-radius: 6px;
  padding: 1rem;
  width: 260px;
  margin-bottom: 1rem;
}

.calculator-box label {
  font-weight: bold;
  display: block;
  margin-bottom: 0.25rem;
}

.calculator-box select,
.calculator-box input[type="number"] {
  width: 100%;
  padding: 0.3rem;
  margin-bottom: 0.75rem;
  box-sizing: border-box;
}

.calculator-box button {
  width: 100%;
  padding: 0.4rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  color: white;
  border: none;
  border-radius: 4px;
}

.calc-result {
  font-family: "Courier New", monospace;
  font-size: 0.95rem;
  font-weight: bold;
  background: #fffef8;
  padding: 0.5rem;
  border-radius: 4px;
  min-height: 4.5rem;
}

/* Table Styles */
table {
  border-collapse: collapse;
  width: 100%;
  background: #ffffff;
  table-layout: fixed;
  min-width: 600px;
}

thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

th {
  text-align: left;
  padding: 0.6rem;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}

th:hover {
  opacity: 0.8;
}

tbody tr:nth-child(even) {
  background: #fffef8;
}

td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #eee;
}

th.sorted-asc::after {
  content: " ▲";
}

th.sorted-desc::after {
  content: " ▼";
}

tr.selected-row {
  background-color: #fff8dc !important;
}

tr.checked-row {
  background-color: #fef5e7 !important;
}

/* Updates Section */
.updates-section {
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem auto;
  max-width: 900px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.updates-section h2 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem 0;
  cursor: pointer;
  user-select: none;
}

.updates-section h2:hover {
  opacity: 0.8;
}

.updates-content {
  font-size: 0.9rem;
  line-height: 1.6;
}

.updates-content ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.updates-content li {
  margin-bottom: 0.3rem;
}

.update-date {
  color: #666;
  font-style: italic;
  font-size: 0.85rem;
}

/* Warning Banner */
.warning-banner {
  color: white;
  padding: 1rem;
  margin: 1rem auto;
  max-width: 900px;
  border-radius: 8px;
  text-align: center;
  font-weight: bold;
  font-size: 1.1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Calculator Right Side */
.calculator-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 260px;
}

/* ========================================
   Mobile Responsive - Calculator Layout
   ======================================== */
@media (max-width: 768px) {
  .top-controls {
    padding-left: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
  }

  .top-controls label {
    margin-left: 0 !important;
  }

  .top-controls input[type="number"],
  .top-controls select {
    width: auto;
    min-width: 80px;
    margin-left: 0;
  }

  .layout {
    flex-direction: column;
  }

  .calculator-boxes {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .calculator-box {
    width: 100%;
  }

  .calculator-right {
    width: 100%;
  }

  table {
    min-width: unset;
    font-size: 0.85rem;
  }

  th, td {
    padding: 0.35rem 0.4rem;
  }
}
