/* === COLLAPSIBLES === */
.collapsible-header {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.collapsible-header .arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}

.collapsible-header.open .arrow {
  transform: rotate(90deg);
}

.collapsible-content {
  margin-top: 0.5em;
  display: none;
}

/* === INDEX === */
.page-index ul {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 1rem;
}

.page-index a {
  text-decoration: none;
  color: #007acc;
}

.page-index a:hover {
  text-decoration: underline;
}

/* === TABLE === */
#data-table, .year-summary {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95em;
}

#data-table th, #data-table td,
.year-summary th, .year-summary td {
  border: 1px solid #ccc;
  padding: 6px 10px;
  vertical-align: top;
}

#data-table th.sortable {
  cursor: pointer;
  background: #f9f9f9;
  position: relative;
}

#data-table th.sortable .arrow {
  display: inline-block;
  margin-left: 0.3em;
  font-size: 0.8em;
  color: #888;
  transition: transform 0.2s ease, color 0.2s ease;
}

/* Ascending: rotate 180deg */
#data-table th.sortable.asc .arrow {
  transform: rotate(180deg);
  color: #333;
}

/* Descending: rotate 0deg (original) */
#data-table th.sortable.desc .arrow {
  transform: rotate(0deg);
  color: #333;
}

/* SEARCH INPUTS */
#data-table input.search {
  width: 90%;
  padding: 2px 4px;
  font-size: 0.9em;
}

/* === MODAL === */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background-color: rgba(0,0,0,0.5);
  padding: 1rem;
  box-sizing: border-box;
}

.modal-content {
  background: #fff;
  width: 100%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  position: relative;
  line-height: 1.6;
  animation: modalFade 0.2s ease-out;
}

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

#modal-body ul {
  margin: 0;
  padding-left: 1.2em;
  line-height: 1.6;
}

#modal-body li {
  margin-bottom: 1em;
  text-align: justify;
}

#modal-close {
  position: absolute;
  top: 0.6rem;
  right: 1rem;
  font-size: 28px;
  cursor: pointer;
  color: #555;
}

#modal-close:hover { color: #000; }

body.modal-open {
  overflow: hidden;
}

/* === TOOLTIP === */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 4px 8px;
  border-radius: 4px;
  position: absolute;
  z-index: 100;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}
