:root {
  --primary: #0ca5c4;
  --primary-dark: #007eb3;
  --accent: #888585;
  --text: #333333;
  --text-light: #777777;
  --bg: #f5f7fa;
  --card: #ffffff;
  --border: #e0e0e0;
}

body {
  font-family: "Montserrat", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

.header {
  background-color: var(--primary);
  color: white;
  padding: 1.5rem 0;
  text-align: center;
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 2rem;
  padding-right: 2rem;
}

.header-logo {
  position: absolute;
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.header-logo:hover {
  opacity: 0.8;
}

.header-logo svg {
  width: 80px;
  height: auto;
}

.header-logo svg path {
  fill: white;
}

.back-button {
  position: absolute;
  right: 5rem;
  top: 50%;
  transform: translateY(-50%);
  background-color: transparent;
  color: rgba(255, 255, 255, 1);
  border: 1px solid rgba(255, 255, 255, 1);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  z-index: 10;
}

.back-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.header h1 {
  margin: 0;
  font-weight: 500;
  font-size: 1.6rem;
  letter-spacing: 0.5px;
}

.container {
  max-width: 900px;
  width: 90%;
  margin: 2rem auto;
  padding: 2rem;
  background-color: var(--card);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease;
}

.container:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#result {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 243, 224, 0.95);
  padding: 1rem;
  text-align: center;
  font-size: 0.95rem;
  color: #888585;
  margin-bottom: 1.5rem;
  display: none;
  backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(230, 81, 0, 0.2);
  animation: fadeIn 0.3s ease-out;
  border-radius: 6px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.form-column {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.input-group {
  margin-bottom: 0;
}
.reset-sort-btn {
  background-color: transparent;
  color: rgba(255, 255, 255, 1);
  border: 1px solid rgba(255, 255, 255, 1);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  margin-right: 8px;
}
.reset-sort-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text);
  font-size: 0.9rem;
}

input[type="number"],
select {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  background-color: var(--card);
  box-sizing: border-box;
  max-width: 250px;
}

input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 156, 217, 0.1);
}

select option:disabled {
  color: #999;
  background-color: #f5f5f5;
  font-style: italic;
}

.button-group {
  display: flex;
  gap: 15px;
  margin: 25px 0;
  justify-content: center;
  flex-wrap: wrap;
}

button {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.8rem 1.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
  min-width: 160px;
}

button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
}

#resetBtn,
#toggleChartBtn {
  background-color: var(--card);
  color: var(--primary);
  border: 1px solid var(--primary);
}

#resetBtn:hover,
#toggleChartBtn:hover {
  background-color: rgba(0, 156, 217, 0.1);
}

.chart-container {
  position: relative;
  height: 400px;
  width: 100%;
  margin: 30px 0;
  background-color: transparent;
  padding: 0;
  display: none;
}

.results-container {
  width: 100%;
  margin-top: 2rem;
  display: none;
}

.results-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0 auto;
  max-width: 1000px;
  table-layout: fixed;
}

.results-table th {
  background-color: var(--primary);
  color: white;
  padding: 0.7rem 0.8rem;
  text-align: left;
  cursor: pointer;
  position: relative;
  font-weight: 500;
  font-size: 0.8rem;
  transition: background-color 0.2s;
}

.results-table th:hover {
  background-color: var(--primary-dark);
}

.sortable::after {
  content: "↕";
  margin-left: 8px;
  font-size: 0.8em;
  opacity: 0.7;
}

.sort-asc::after {
  content: "↑";
  opacity: 1;
}

.sort-desc::after {
  content: "↓";
  opacity: 1;
}

.results-table th:first-child {
  border-top-left-radius: 6px;
  width: 30%;
  align-items: center;
}

.results-table th:nth-child(2) {
  width: 15%;
  align-items: center;
}

.results-table th:nth-child(3) {
  width: 12%;
  align-items: center;
}

.results-table th:nth-child(4) {
  width: 10%;
  align-items: center;
}

.results-table th:nth-child(5) {
  width: 12%;
}

.results-table th:last-child {
  border-top-right-radius: 6px;
  width: 21%;
}

.results-table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  align-items: center;
}

.results-table td:last-child {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.results-table tr:last-child td {
  border-bottom: none;
}

.results-table tr:hover td {
  background-color: rgba(0, 156, 217, 0.03);
}

.view-btn {
  background-color: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.view-btn:hover {
  background-color: rgba(0, 156, 217, 0.1);
}

.small-button {
  padding: 0.5rem 0.8rem;
  font-size: 0.8rem;
  min-width: auto;
  white-space: nowrap;
}

@media (max-width: 992px) {
  .form-container {
    grid-template-columns: 1fr 1fr;
  }

  input[type="number"],
  select {
    max-width: 100%;
  }

  .results-table {
    table-layout: auto;
  }

  .results-table th:first-child,
  .results-table th:nth-child(2),
  .results-table th:nth-child(3),
  .results-table th:nth-child(4),
  .results-table th:last-child {
    width: auto;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1.5rem;
    margin: 1.5rem;
    width: calc(100% - 3rem);
  }

  .form-container {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .form-column {
    gap: 1.2rem;
  }

  .button-group {
    flex-direction: column;
    align-items: center;
  }

  button {
    width: 100%;
  }

  .chart-container {
    height: 350px;
  }

  .results-table {
    font-size: 0.8rem;
  }

  .results-table td {
    white-space: normal;
  }
}

body::-webkit-scrollbar {
  width: 6px;
  background-color: #e6e6e6;
}

body::-webkit-scrollbar-thumb {
  background-color: #969696;
}