:root {
  --green: #1aff4c;
  --red: #ff2b2b;
  --bg: #08140d;
  --yellow: #f9a825;
}

* {
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

body {
  margin: 0;
  color: #fff;
  background: linear-gradient(180deg, #050b07, #08140d);
  min-height: 100vh;
}

/* container */
.container {
  max-width: 1100px;
  margin: auto;
  padding: 16px;
}

/* banner */
.banner img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
}

/* header */
header {
  text-align: center;
  margin-bottom: 12px;
}

header h1 {
  margin: 0;
  color: var(--green);
  text-shadow: 0 0 10px rgba(249, 168, 37, 0.4);
}

.last-update-global {
  text-align: center;
  margin: 6px auto 14px;
  font-size: 13px;
  color: #ccc;
}

.last-update-global span {
  color: #1aff4c;
  font-weight: 700;
  margin-left: 6px;
  text-shadow: 0 0 8px rgba(26,255,76,0.3);
}

.helper-text {
  margin: 10px auto 16px;
  padding: 10px 14px;
  max-width: 900px;

  font-size: 13px;
  color: #cfcfcf;
  text-align: center;
  line-height: 1.5;

  background: rgba(26, 255, 76, 0.06);
  border: 1px solid rgba(26, 255, 76, 0.15);
  border-radius: 10px;

  box-shadow: 0 0 12px rgba(26, 255, 76, 0.08);
}

/* highlight important phrases */
.helper-text strong {
  color: #1aff4c;
  font-weight: 700;
}

/* table wrapper */
.table-wrapper {
  background: rgba(10, 20, 13, 0.75);
  border-radius: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(26, 255, 76, 0.1);
}

/* table */
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

thead {
  background: rgba(8, 20, 13, 0.95);
  position: sticky;
  top: 0;
}

thead th {
  padding: 14px;
  text-transform: uppercase;
  font-size: 13px;
  color: #dfffe8;
  border-bottom: 1px solid rgba(26, 255, 76, 0.15);
}

tbody td {
  padding: 14px;
  text-align: center;
  font-size: 13px;
}

tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.015);
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

tbody tr:hover {
  background: rgba(26, 255, 76, 0.08);
  cursor: pointer;
}

/* ================= IGN BASE ================= */
td:nth-child(2),
.ign,
td.ign {
  font-weight: 600;
  font-size: 14px;

  letter-spacing: 0.5px;

  text-shadow:
    0 0 6px rgba(26, 255, 76, 0.35),
    0 0 12px rgba(26, 255, 76, 0.15);

  position: relative;
  display: inline-block;
}

@keyframes ignPulse {
  0% {
    text-shadow:
      0 0 4px rgba(26, 255, 76, 0.25),
      0 0 10px rgba(26, 255, 76, 0.15);
    transform: scale(1);
  }

  50% {
    text-shadow:
      0 0 10px rgba(26, 255, 76, 0.5),
      0 0 20px rgba(26, 255, 76, 0.25);
    transform: scale(1.03);
  }

  100% {
    text-shadow:
      0 0 4px rgba(26, 255, 76, 0.25),
      0 0 10px rgba(26, 255, 76, 0.15);
    transform: scale(1);
  }
}

.ign-pulse {
  animation: ignPulse 2.5s ease-in-out infinite;
}

/* bonus */
.acquire {
  color: #fff;
  font-weight: 700;
}

/* event tags */
.event-active {
  color: #1aff4c;
  font-weight: 700;
}

.event-grinder {
  color: #ffd700;
  font-weight: 700;
}

.event-none {
  color: #bbb;
}

.expand-row td {
  background: rgba(8, 20, 13, 0.9);
  padding: 0;
}

.event-box {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.event-item {
  display: grid;
  grid-template-columns: 120px 1fr 100px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  color: #ddd;
}

.event-item .bonus {
  color: #f9a825;
  font-weight: 700;
}

.expandable {
  cursor: pointer;
  font-weight: 700;
  color: #1aff4c;
}

.expandable:hover {
  text-shadow: 0 0 8px #1aff4c;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0;
}

/* LEFT SEARCH */
.controls-left {
  flex: 1;
  min-width: 220px;
}

.controls-left input {
  width: 100%;
  max-width: 280px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(26, 255, 76, 0.4);
  background: #08140d;
  color: #fff;
  outline: none;
  transition: 0.2s;
}

.controls-left input:focus {
  border-color: var(--green);
  box-shadow: 0 0 10px rgba(26, 255, 76, 0.25);
}

/* DATE FILTER */
.controls-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.controls-right input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(26, 255, 76, 0.4);
  background: #08140d;
  color: #fff;
}

.controls-right button {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--green);
  background: #08140d;
  color: #fff;
  cursor: pointer;
  transition: 0.2s;
}

.controls-right button:hover {
  background: var(--green);
  color: #000;
}

.date-wrapper {
  position: relative;
  width: 100%;
  max-width: 200px;
}

/* input */
.date-wrapper input {
  width: 100%;
  padding: 16px 40px 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(26, 255, 76, 0.4);
  background: #08140d;
  color: #fff;
  outline: none;
}

/* hide placeholder behavior */
.date-wrapper input::-webkit-datetime-edit {
  color: transparent;
}

.date-wrapper input:focus::-webkit-datetime-edit,
.date-wrapper input:not(:placeholder-shown)::-webkit-datetime-edit {
  color: #fff;
}

/* floating label */
.floating-label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: #aaa;
  pointer-events: none;
  transition: 0.2s ease;
}

/* when focused or has value */
.date-wrapper input:focus + .floating-label,
.date-wrapper input:not(:placeholder-shown) + .floating-label {
  top: 6px;
  font-size: 11px;
  color: #1aff4c;
}

.date-wrapper i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #1aff4c;
  pointer-events: none;
  font-size: 14px;
}

/* Hide native icon */
.date-wrapper input::-webkit-calendar-picker-indicator {
  opacity: 0;
  cursor: pointer;
  position: absolute;
  right: 0;
  width: 100%;
  height: 100%;
}

.date-wrapper::after {
  content: "\f133";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--green);
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* invalid date */
.date-invalid {
  border: 1px solid #ff4d4d !important;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

/* disabled apply button */
#filterBtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #444;
  border-color: #666;
}

/* empty state */
.empty-state {
  padding: 60px 20px;
  text-align: center;
}

.empty-icon {
  font-size: 60px;
  margin-bottom: 15px;
}

.empty-title {
  color: #1aff4c;
  font-size: 20px;
  font-weight: 700;
}

.empty-subtitle {
  margin-top: 8px;
  color: #aaa;
  font-size: 14px;
}

/* PAGINATION */

.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px;
}

.pagination button {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #1aff4c;
  background: #08140d;
  color: #fff;
  cursor: pointer;
  min-width: 34px;
  font-size: 12px;
}

.pagination button.active {
  background: #1aff4c;
  color: #000;
  box-shadow: 0 0 10px #1aff4c;
}

tbody tr.main-row.expanded {
  background: linear-gradient(
    90deg,
    rgba(26, 255, 76, 0.22),
    rgba(26, 255, 76, 0.06)
  ) !important;
  box-shadow: inset 4px 0 0 #1aff4c;
}

tbody tr.expanded {
  background: linear-gradient(
    90deg,
    rgba(26, 255, 76, 0.18),
    rgba(26, 255, 76, 0.05)
  );
  box-shadow:
    inset 4px 0 0 #1aff4c,
    0 0 20px rgba(26, 255, 76, 0.15);
}

.event-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 18px;
  border-radius: 12px;
  border-left: 5px solid;
}

.event-date {
  width: 120px;
  color: #aaa;
  font-size: 13px;
}

.event-title {
  flex: 1;
  font-weight: 600;
}

.event-bonus {
  min-width: 120px;
  text-align: right;

  color: #7cfc00;
  font-weight: bold;
}

.event-box {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;

  background: rgba(255, 255, 255, 0.02);

  border-left: 3px solid #1aff4c;
}

.event-item {
  display: grid;
  grid-template-columns:
    110px
    1fr
    100px;

  align-items: center;

  padding: 12px;

  border-radius: 12px;

  background: rgba(255, 255, 255, 0.03);

  transition: 0.2s;
}

.event-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.event-internal {
  background: rgba(0, 200, 255, 0.15);
  color: #00d9ff;
  border: 1px solid rgba(0, 217, 255, 0.3);
}

.event-guerilla {
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.35);
}

.event-meeting {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.event-compensation {
  background: rgba(155, 89, 182, 0.15);
  color: #bb6bd9;
  border: 1px solid rgba(187, 107, 217, 0.3);
}

.event-default {
  background: rgba(255, 255, 255, 0.07);
  color: #ccc;
}

.event-bonus {
  color: #f9a825;
  font-weight: 800;
  text-shadow: 0 0 8px rgba(249, 168, 37, 0.4);
}

.expand-label {
  display: inline-flex;
  gap: 8px;

  background: rgba(26, 255, 76, 0.1);

  color: #1aff4c;

  border: 1px solid rgba(26, 255, 76, 0.3);

  padding: 7px 14px;
  border-radius: 999px;

  cursor: pointer;

  transition: 0.2s;
}

.expand-label:hover {
  background: rgba(26, 255, 76, 0.2);
}

.expand-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  position: relative;
  margin-left: 8px;
}

/* right arrow */
.expand-icon::before {
  content: "\f054"; /* fa-chevron-right */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: #1aff4c;
  transition: 0.2s;
}

/* expanded = down arrow */
.main-row.expanded .expand-icon::before {
  content: "\f078"; /* fa-chevron-down */
}

/* SKELETON LOADING */
.skeleton-row {
  display: grid;
  grid-template-columns: 60px 1fr 120px 160px;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.sk {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(26, 255, 76, 0) 0%,
    rgba(26, 255, 76, 0.15) 50%,
    rgba(26, 255, 76, 0) 100%
  );
  background-size: 400% 100%;
  animation: shimmer 1.2s ease infinite;
}

.sk-no {
  width: 40px;
}
.sk-ign {
  width: 100%;
}
.sk-bonus {
  width: 80px;
}
.sk-event {
  width: 120px;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

@media (min-width: 769px) {
  .ign-pulse:hover {
    color: #7cfc00;
    text-shadow:
      0 0 12px rgba(124, 252, 0, 0.6),
      0 0 25px rgba(26, 255, 76, 0.4);
    cursor: pointer;
  }
}

@media (max-width: 768px) {
  table {
    min-width: 100%;
  }

  tbody td {
    padding: 10px;
    font-size: 12px;
  }

  header h1 {
    font-size: 18px;
  }

  td:nth-child(2),
  .ign,
  .ign-pulse {
    font-size: 13px;
    letter-spacing: 0.3px;
  }

  .ign-pulse {
    animation: ignPulse 3s ease-in-out infinite;
  }

  /* ================= FILTERS ================= */
  .controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .controls-left input {
    max-width: 100%;
  }

  .controls-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .controls-right button {
    grid-column: 1 / -1;
  }

  /* ================= MAIN TABLE CLEANUP ================= */
  .event-column {
    font-size: 12px;
    white-space: nowrap;
  }

  .expand-icon {
    font-size: 14px;
  }

  /* ================= EXPAND AREA ================= */
  .event-box {
    padding: 10px;
    gap: 10px;
    border-left: none;
    position: relative;
  }

  /* vertical timeline line */
  .event-box::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(26, 255, 76, 0.25);
  }

  /* ================= EVENT CARD ================= */
  .event-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;
    gap: 8px;

    padding: 14px 18px;
    border-radius: 12px;
    border-left: 5px solid currentColor;

    position: relative;
  }

  /* dot per event */
  .event-card::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 18px;

    width: 10px;
    height: 10px;

    border-radius: 50%;
    background: #1aff4c;

    box-shadow: 0 0 8px #1aff4c;
  }

  .event-date,
  .event-title,
  .event-bonus {
    text-align: center;
    width: 100%;
  }

  .event-date {
    font-size: 12px;
    opacity: 0.8;
  }

  .event-title {
    font-size: 14px;
    font-weight: 700;
  }

  .event-bonus {
    margin-top: 4px;
  }

  /* ================= DATE ================= */
  .event-date {
    width: auto;
    font-size: 11px;

    padding: 3px 8px;
    border-radius: 999px;

    background: rgba(255, 255, 255, 0.08);
    color: #ccc;
  }

  /* ================= TITLE ================= */
  .event-title {
    width: 100%;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
  }

  /* ================= BONUS CP ================= */
  .event-bonus {
    align-self: flex-end;

    font-size: 13px;
    font-weight: 700;

    padding: 6px 10px;
    border-radius: 999px;

    background: rgba(249, 168, 37, 0.12);
    border: 1px solid rgba(249, 168, 37, 0.25);

    color: #ffd54f;
  }

  tbody tr:hover {
    background: inherit;
  }
}
