/* ===== GENERAL RESET ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  
}
html, body {
  font-family: "Segoe UI", Roboto, system-ui, -apple-system, "Helvetica Neue", Arial;
  background: #e8f5f3;
  color: #21323a;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: auto;
}


/* ===== PAGE WRAPPER ===== */
.page-wrap {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 16px;
}


/* ===== HEADER ===== */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(15, 40, 40, 0.06);
}


.brand h1 {
  font-size: 2rem;
  margin: 0;
  color: #0b6b63;
}


/* ===== NAVIGATION ===== */
.main-nav {
  display: flex;
  gap: 12px;
}


.main-nav .nav-link {
  background: linear-gradient(180deg, #0f8b78, #08715f);
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}


.main-nav .nav-link:hover {
  transform: translateY(-2px);
}


.main-nav .nav-link.active {
  background: linear-gradient(180deg, #0f8b78, #08715f);
  border: none;
  color: white;
}


.main-nav .nav-link:active {
  transform: scale(0.97);
}


/* ===== HEADINGS ===== */
h2 {
  color: #0b6b63;
  margin: 6px 0 10px;
  font-size: 1.5rem;
  text-align: center;
}


/* ===== FORMS ===== */
.log-section {
  padding: 16px 0;
}


.catch-form {
  width: 100%;
  max-width: 1024px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 18px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(16, 40, 40, 0.04);
}

input:focus{
  outline-color: #0f8b78;
  outline-width: 2px;
}

.catch-form input[type="text"],
.catch-form input[type="date"],
.catch-form input[type="time"],
.catch-form input[type="number"] {
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid #D3D3D3;
  font-size: 0.95rem;
  color: #0f2d2a;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

input[type="date"],
input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit {
  padding: 0;
  margin: 0;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  padding: 0;
  margin: 0;
  width: 18px;
  height: 18px;
}

.catch-form input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.primary-btn {
  background: linear-gradient(180deg, #0f8b78, #08715f);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  width: 60%;
  box-shadow: 0 6px 16px rgba(8, 113, 95, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(8, 113, 95, 0.18);
}

#catchForm button[type="submit"] {
  font-size: 15px;
  font-weight: bold;
}


/* Muted button (modals) */
.muted-btn {
  background: #f2f4f3;
  color: #394a49;
  border: 1px solid #e8efee;
  padding: 9px 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}


/* ===== TABLE ===== */
.table-wrap {
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  overflow-x: auto;
  background: white;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(8, 43, 40, 0.04);
}

.catches-wrap {
  overscroll-behavior-y: contain;
}


.catches-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}


.catches-table th,
.catches-table td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid #eef6f4;
  font-size: 0.94rem;
  color: #133233;
}


.catches-table thead th {
  background: #0b6b63;
  color: white;
  font-weight: 700;
  position: sticky;
  top: 0;
}


.catches-table td:last-child {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  align-items: center;
}


.catches-table tr:nth-child(even) {
  background: #fbfdfc;
}


/* Edit button */
.catches-table td button.edit {
  background: linear-gradient(180deg, #12a18a, #0f8b78);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  width: 80px;
  text-align: center;
  transition: all 0.15s ease;
}
.catches-table td button.edit:hover {
  background: linear-gradient(180deg, #0f8b78, #08715f);
  transform: translateY(-1px);
}


/* Delete button */
.catches-table td button.delete {
  background: linear-gradient(180deg, #c94f4f, #b53f3f);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  width: 80px;
  text-align: center;
  transition: all 0.15s ease;
}
.catches-table td button.delete:hover {
  background: linear-gradient(180deg, #b53f3f, #a03232);
  transform: translateY(-1px);
}


/* ===== MODALS ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  padding: 24px 12px;
}


.modal[aria-hidden="false"] {
  display: flex;
}


.modal-content {
  background: #fff;
  width: 360px;
  max-width: 96%;
  margin-top: 16px;
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 12px 28px rgba(3, 20, 20, 0.18);
  flex: 0 0 auto;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
}


.modal-content h3 {
  color: #0b6b63;
  margin-bottom: 12px;
}


.modal-content label {
  display: block;
  font-size: 0.9rem;
  color: black;
  margin-bottom: 8px;
}


.modal-content input {
  width: 100%;
  padding: 8px 10px;
  margin-top: 6px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid #e6efee;
}

.edit-form label{
  font-size: 1rem;
  color: black;
}

.edit-form input{
  border: 2px solid #D3D3D3;
}

body.modal-open {
  position: fixed;
  overflow: hidden;
  width: 100%;
  touch-action: none;
}


/* Modal action buttons */
.modal-actions {
  display: flex;
  gap: 12px;
}
.modal-actions .primary-btn,
.modal-actions .muted-btn {
  flex: 1;
  min-width: 100px;
  text-align: center;
  box-shadow: 0 6px 16px rgba(8, 113, 95, 0.18);
}
.modal-actions .muted-btn {
  background: linear-gradient(180deg, #0f8b78, #08715f);
  color: white;
  border: none;
}
.modal-actions .muted-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(8, 113, 95, 0.18);
}


/* ===== CHARTS ===== */
#chartCanvas {
  width: 900px;
  height: 480px;
  flex-shrink: 0;
  background: white;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 6px 20px rgba(8, 43, 40, 0.04);
}


.chart-controls {
  width: 100%;
  max-width: 1024px;
  margin: 12px auto 14px auto;
  background: white;
  padding: 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  box-shadow: 0 6px 18px rgba(8, 43, 40, 0.04);
}


/* Chart controls container */
.chart-controls {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

/* Chart control group: take full width and allow flex children */
.chart-control-group {
  display: flex;
  width: 100%;
  max-width: 900px;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

/* Buttons container */
.chart-buttons {
  display: flex;
  flex: 1 1 auto;
  gap: 12px;
  flex-wrap: wrap;
}

/* Buttons themselves */
.chart-buttons button {
  position: relative; /* for the underline */
  flex: 1 1 0;
  min-width: 100px;
  padding: 10px 0;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(180deg, #0f8b78, #08715f);
  color: white;
  box-shadow: 0 3px 6px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  overflow: hidden;
}

/* Hover effect */
.chart-buttons button:hover {
  box-shadow: 0 6px 12px rgba(0,0,0,0.1);
  background: linear-gradient(180deg, #0f8b78, #08715f);
  transform: translateY(-2px);
}

/* Active button */
.chart-buttons button.active {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Animated underline under text */
.chart-buttons button::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 10%;
  width: 80%;
  height: 2px;
  background: white;
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: center;
}

.chart-buttons button.active::after {
  transform: scaleX(1);
  transform-origin: center;
}


/* Styled dropdown */
.select-wrapper {
  display: none;
  flex: 1 1 100%;
  position: relative;
  justify-content: center;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.select-wrapper label{
  font-size: 1.2rem;
  color: #0b6b63;
  font-weight: 700;
}

/* Style the select dropdown */
#chartSelect {
  width: 100%;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid #dce7e6;
  font-size: 0.95rem;
  color: #0b6b63;
  background: #fff;
  cursor: pointer;
  max-width: 400px;
}

/* Focus & hover effect to match other inputs */
#chartSelect:focus {
  outline: none;
  border-color: #0f8b78;
  border-width: 2px;
}

#chartSelect:hover {
  border-color: #0f8b78;
}

.chart-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-width: 100%;
  padding-bottom: 10px;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 16px;
  padding: 16px;  
}

#chartCanvas {
  display: block;
  margin: 0 auto;
}

.chart-inner {
  overflow: auto;
  border-radius: 0 0 16px 16px;
}

.chart-inner canvas {
  min-width: 900px;
  min-height: 500px;
}

.chart-inner canvas {
  min-width: 900px;
  min-height: 500px;
}

/* ===== SEARCH BAR ===== */
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  margin-top: 40px;
}

.table-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.table-header input {
  padding: 10px 16px;
  border: 2px solid #D3D3D3;
  border-radius: 12px;
  font-size: 0.95rem;
  background: #ffffff;
  color: #21323a;
  width: 260px;
  max-width: 100%;
  flex-shrink: 1;
}

.table-header input:focus {
  outline: none;
  border-color: #0f8b78;
  border-width: 2px;
}

.table-header input:hover {
  border-color: #0f8b78;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-bottom: 18px;
  font-weight: 600;
}
.pagination button {
  background: linear-gradient(180deg, #0f8b78, #08715f);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(8, 113, 95, 0.18);
  transition: background 0.2s ease, transform 0.12s ease, box-shadow 0.12s ease;
}
.pagination button:hover:not(:disabled),
.pagination button:focus:not(:disabled) {
  background: linear-gradient(180deg, #0e7e6d, #076957);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(8, 113, 95, 0.25);
}
.pagination button:disabled {
  background: #70a7a3;
  color: white;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
#pageInfo {
  color: #0b6b63;
  font-size: 0.95rem;
  font-weight: 700;
}

.styled-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  position: relative;
}

.styled-input:placeholder-shown::before {
  content: attr(data-placeholder);
  color: #888;
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.styled-input:not(:placeholder-shown)::before {
  content: "";
}

input[type="date"],
input[type="time"] {
  height: 2.5rem;
  padding: 0 0.5rem;
  font-size: 1rem;
  box-sizing: border-box; 
}

.brand-link {
  display: inline-block;
  font-size: 2.2rem;
  font-weight: bold;
  text-decoration: none;
  color: #08715f;
  cursor: pointer;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.toast {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 12px 20px;
  margin-bottom: 10px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(-20px);
  transition: transform 0.3s ease, opacity 0.3s ease;
  min-width: 250px;
  font-size: 20px;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success { 
  background: linear-gradient(180deg, #12a18a, #0f8b78); 
}

.toast.error { 
  background: linear-gradient(180deg, #c94f4f, #b53f3f); 
}

.table-wrap { 
  position: relative; 
  min-height: 50px; 
}

.chart-wrapper {
  position: relative;
  min-height: 50px;
}

.empty-message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: #0b6b63;
  border-radius: 8px;
  padding: 20px;
  box-sizing: border-box;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .catch-form {
    grid-template-columns: repeat(2, 1fr);
  }
  .main-nav .nav-link {
    padding: 7px 12px;
    font-size: 0.95rem;
  }
  .form-actions .primary-btn {
    width: 60%;
  }
}

@media (max-width: 640px) {
  .site-header { padding: 12px; }
  .catch-form { grid-template-columns: 1fr; padding: 14px; }
  .form-actions { margin-top: 8px; }
  .primary-btn { width: 100%; padding: 12px; }
  #chartCanvas { height: 360px; }
  .brand h1 { font-size: 1.6rem; }

  .chart-buttons { display: none; }
  .select-wrapper { display: inline-flex; flex: 1; }
  #chartSelect {
    width: 100%;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #dce7e6;
    font-size: 0.95rem;
    background: #fff;
    color: #21323a;
    box-shadow: 0 3px 8px rgba(8, 43, 40, 0.06);
  }


  .catches-header {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 12px;
  }
  .search-bar { width: 100%; }
  .search-bar input {
  width: 100%;
  max-width: 260px;
}
}