* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #0e1117;  /* Dark slate background */
  color: #f4f4f4;             /* Light text */
  line-height: 1.6;
  overflow-x: hidden;
}

html {
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  height: 100%;
  position: fixed;
  top: 0;
  left: -400px;
  background-color: #0d1117;
  color: white;
  padding-top: 60px;
  transition: 0.3s;
  z-index: 1000;
  overflow-x: hidden;
  white-space: nowrap;
}

.sidebar-header {
  padding: 1rem 1.25rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.sidebar.open .sidebar-header {
  opacity: 1;
  left: 0;
  width: 400px;
  pointer-events: auto;
}

.sidebar-nav {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
}

.sidebar a {
  padding: 12px 24px;
  display: block;
  color: #c9d1d9;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.sidebar a:hover {
  background-color: #21262d;
  color: #ffffff;
}

.sidebar h2 {
  padding: 0 24px;
  margin-top: 0;
  font-size: 1.2rem;
}

.hamburger {
  position: relative;
  font-size: 36px;
  cursor: pointer;
  color: #f4f4f4;
  z-index: 1100;
  background: none;
  border: none;
  padding: 0.75rem;
}

.project-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #bd9c0b;
}

.author-name {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: #ccc;
}

.author-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.author-links a {
  color: #bd9c0b;
  text-decoration: none;
}

.author-links a:hover {
  /* text-decoration: underline; */
  text-decoration: none;
}

.top-ribbon-content {
  flex-direction: column;
  align-items: flex-start;
}

.left-group {
  width: 100%;
  justify-content: space-between;
}

.main-content {
  transition: margin-left 0.3s;
  padding: 6rem 1rem 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.sidebar.open {
  left: 0;
}

/* Container */
.container {
  background: #161b22;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  max-width: 600px;
  width: 90%;
  text-align: center;
  margin-top: 2rem;
}

.container p {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  color: #ccc;
}

/* inputs */
input[type="text"], input[type="number"] {
  width: 100%;
  padding: 0.85rem;
  margin: 0.5rem 0;
  border: 1px solid #30363d;
  border-radius: 12px;
  font-size: 1rem;
  background-color: #0d1117;
  color: #f4f4f4;
}

input:focus {
  outline: none;
  border-color: #58a6ff;
}

button {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  background-color: #238636;
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 1rem;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #2ea043;
}

#result {
  margin-top: 1.5rem;
  font-size: 1.1rem;
  color: #e6edf3;
  white-space: pre-line;
}

.description-section {
  width: 100%;
  max-width: fit-content;
  margin: 4rem auto;
  padding: 2rem;
  background-color: #0e1117;
  border-radius: 12px;
}

.description-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.description-section h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #ffffff;
}

.description-section p {
  font-size: 1.05rem;
  color: #d0d0d0;
  text-align: left;
  margin-top: 1rem;
}

.description-section a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.description-section a:hover {
  color: #f0c93d;
}

.formula {
  background-color: #0d1117;
  padding: 1rem;
  border-radius: 8px;
  font-family: monospace;
  color: #58a6ff;
  margin-top: 1rem;
  overflow-x: auto;
  white-space: nowrap;
  max-width: 100%;
}

.left-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.chart-container {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 2rem auto;
  height: 500px;
}

.chart-container--tall {
  height: auto;
  min-height: 1500px;
  max-height: none;
  width: fit-content;
  min-width: 1000px;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

@media (max-width: 600px) {
  .chart-container {
    height: 300px;
    padding: 0 1rem;
  }

  .chart-container--tall {
    height: auto;
    min-height: 500px;
    padding: 0 1rem;
    width: fit-content;
  }

  .chart-container--tall canvas {
    height: auto !important;
  }
}

.chart-canvas {
  width: 100% !important;
  max-width: 2000px;
  width: fit-content;
  height: auto;
  min-height: 1500px;
  max-height: none;
  margin-top: 2rem;
}

select#candidateSelect {
  width: 100%;
  padding: 0.85rem;
  margin: 0.5rem 0;
  border: 1px solid #30363d;
  border-radius: 12px;
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #f4f4f4;
  background-color: #0d1117;
  font-family: 'Inter', sans-serif;
  appearance: none;
  text-align: center;
  text-align-last: center;

  /* Optional: Keep default arrow but clean up style */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='16' height='16' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

select#candidateSelect:focus {
  outline: none;
  border-color: #58a6ff;
}

.custom-table-container {
  width: 100%;
  overflow-x: auto;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #161b22;
  color: #f4f4f4;
  border-radius: 8px;
  overflow: hidden;
}

.custom-table th,
.custom-table td {
  padding: 0.75rem 1rem;
  text-align: center;
  border: 1px solid #30363d;
  font-size: 0.95rem;
}

.custom-table th {
  background-color: #21262d;
  font-weight: 600;
}
