/* Reset box sizing */
* {
  box-sizing: border-box;
}

/* Header background bar */
.header-bg {
  position: fixed;
  top: 0;
  left: 0;
  height: 80px;
  width: 100%;
  background-color: #1e1e1e;
  z-index: 90;
  border-bottom: 2px solid #4db8ff; /* blue border */
  box-shadow: 0 2px 10px rgba(0,0,0,0.7);
}

/* Nav bar fixed left with flex */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  height: 80px;
  display: flex;
  align-items: center;
  padding-left: 12px;
  gap: 20px;
  background-color: transparent;
  z-index: 100;
  min-width: 240px;
  max-width: 30vw;
  white-space: nowrap;
  overflow: visible;
  transition: gap 0.3s ease;
}

@media (min-width: 768px) {
  .main-nav {
    gap: 30px;
  }
}
@media (min-width: 1200px) {
  .main-nav {
    gap: 40px;
  }
}

/* Nav links and dropdown buttons */
.nav-link,
.dropbtn {
  background-color: transparent;
  border: none;
  color: #ffffffcc;
  font-weight: 600;
  font-size: 18px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 6px;
  transition: background-color 0.3s ease, color 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover,
.dropbtn:hover {
  background-color: #4db8ff;
  color: white;
}

/* Dropdown container */
.dropdown {
  position: relative;
}

/* Dropdown content */
.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #1e1e1e;
  min-width: 160px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  z-index: 200;
  transition: opacity 0.3s ease;
}

.dropdown-content a {
  color: #ffffffcc;
  padding: 12px 18px;
  text-decoration: none;
  display: block;
  font-size: 16px;
  font-weight: 500;
  transition: background-color 0.25s ease;
}

.dropdown-content a:hover,
.dropdown-content a:focus {
  background-color: #4db8ff;
  color: #fff;
  outline: none;
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* Title container centered */
.title-container {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  user-select: none;
  z-index: 95;
  padding: 0 260px; /* space for nav and search */
  box-sizing: border-box;
  max-width: calc(100vw - 520px);
  white-space: nowrap;
}

.title-container h1 {
  margin: 0;
  font-size: 48px;
  font-weight: 700;
  color: #ffffff;
  font-family: 'Roboto Slab', serif;
  padding-top: 10px;
}

/* Search box fixed right */
.search-box {
  position: fixed;
  top: 20px;
  right: 20px;
  height: 40px;
  width: 250px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 8px;
  z-index: 103;
  background-color: transparent;
}

.search-box input {
  width: 100%;
  padding: 8px 10px;
  font-size: 16px;
  border-radius: 6px;
  border: none;
  outline: none;
  background-color: #fff;
  color: #000;
  font-family: 'Inter', sans-serif;
  transition: box-shadow 0.3s ease;
}

.search-box input::placeholder {
  color: #000000aa;
  font-style: italic;
}

/* Scroll container */
.scroll-container {
  margin-top: 80px;
  padding: 24px 32px 32px 32px;
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 80px);
  width: 100vw;
  box-sizing: border-box;
  background-color: #121212;
}

/* Table styling */
table {
  border-collapse: collapse;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  background-color: #1e1e1e;
  border-radius: 12px;
  box-shadow: 0 0 10px #4db8ff;
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  color: #ffffffcc;
}

thead th {
  top: 0;
  background-color: #121212;
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  padding: 14px 18px;
  text-align: center;
  border-bottom: 2px solid #4db8ff;
  z-index: 50;
  user-select: none;
}

tbody td {
  padding: 12px 18px;
  text-align: center;
  border-bottom: 1px solid #333;
  vertical-align: middle;
  word-break: break-word;
  color: #e0e0e0;
  font-weight: 500;
  transition: background-color 0.25s ease;
}

tbody tr {
  background-color: #2a2a2a;
  transition: background-color 0.3s ease;
  cursor: default;
  border-radius: 8px;
}

tbody tr:nth-child(even) {
  background-color: #222222;
}

tbody tr:hover {
  background-color: #4db8ff2d;
  color: #fff;
}

/* Responsive column widths */
thead th:nth-child(1),
tbody td:nth-child(1) {
  width: 40%;
  font-weight: 600;
}

thead th:nth-child(2),
tbody td:nth-child(2) {
  width: 20%;
  font-weight: 500;
  color: #bee3fc;
}

thead th:nth-child(3),
tbody td:nth-child(3) {
  width: 20%;
  font-weight: 500;
  color: #3db2ff;
}

thead th:nth-child(4),
tbody td:nth-child(4) {
  width: 20%;
  font-weight: 500;
  color: #bee3fc;
}

/* Scrollbar styling */
.scroll-container::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.scroll-container::-webkit-scrollbar-track {
  background: #1e1e1e;
  border-radius: 10px;
}

.scroll-container::-webkit-scrollbar-thumb {
  background: #4db8ff;
  border-radius: 10px;
  border: 2px solid #1e1e1e;
}

/* Accessibility: focus styles */
.home-button:focus,
.dropbtn:focus,
.dropdown-content a:focus,
.search-box input:focus,
tbody tr:focus-within {
  outline: 2px solid #4db8ff;
  outline-offset: 2px;
  background-color: #33000088;
}

/* Responsive mobile */
@media (max-width: 480px) {
  .main-nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-left: 0;
    gap: 12px;
    max-width: 100vw;
  }

  .nav-link, .dropbtn {
    flex-shrink: 0;
    white-space: nowrap;
    height: auto;
    line-height: normal;
    padding: 8px 12px;
  }

  .dropdown-content {
    position: static;
    box-shadow: none;
    border-radius: 0;
    background-color: #2a2a2a;
    margin-top: 0;
    min-width: unset;
  }

  .title-container {
    text-align: center;
    margin-top: 0;
    padding: 0 12px;
    max-width: 100vw;
  }

  .title-container h1 {
    font-size: 28px;
  }

  .search-box {
    width: 100%;
    padding: 0 10px;
    position: fixed;
    top: 60px;
    right: 0;
  }

  .scroll-container {
    margin-top: 110px;
    padding: 12px 10px 32px;
    padding-left: 10px;
    padding-right: 10px;
    width: 100vw;
  }
}
