/* =========================
   GLOBAL SCROLL
========================= */
html {
  scroll-behavior: smooth;
}

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

main {
  font-family: 'Inter', sans-serif;
  color: #222;
  line-height: 1.6;
  background: url("../imgs/index_bg.png") center / cover no-repeat fixed;
}

main::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(120, 120, 120, 0.35); /* grey tint */
  z-index: -1;
}

/* =========================
   BACK BUTTON
========================= */

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  margin-top: 100px;
  margin-bottom: 20px;
  margin-left:40px;

  padding: 8px 16px;

  background: rgba(0, 0, 0, 0.5);
  color: white;

  border: none;
  border-radius: 6px;

  font-size: 16px;
  font-weight: 600;

  cursor: pointer;

  transition: background 0.25s ease, transform 0.2s ease;
}

.back-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-1px);
}

/* =========================
   CONCURRENT PROJECTS SECTION
========================= */

.projects-section {
  padding: 60px;
  background: rgba(0, 0, 0, 0.4);
  min-height: 800px;
}

.projects-header {
  text-align: center;
  color: white;
}

.projects-header img {
  width: 100%;
  max-height: 250px;
  object-fit: cover;
  border-radius: 10px;
}

.projects-header h2 {
  margin-top: 15px;
  font-size: 32px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.gallery-item {
  position: relative;
}

.gallery-item img {
  width: 100%;
  border-radius: 10px;
  cursor: pointer;
  display: block;
}

.gallery-title {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.6);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 14px;
  color: white;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 9999;
}

.lightbox-img {
  max-width: 90%;
  max-height: 80%;
  transition: transform 0.2s ease;
}

.lightbox-title {
  margin-top: 10px;
  color: white;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 30px;
  cursor: pointer;
  color: white;
}

/* Projects container */
.projects-list {
  width: 100%;
  margin-top: 20px;
}

/* Each category block */
.project-category {
  margin-top: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

/* Collapse button */
.collapse-btn {
  width: 100%;
  padding: 14px 18px;
  background: rgba(238, 238, 238, 0.78);
  border: none;
  cursor: pointer;
  font-size: 26px;
  font-weight: 600;
  color: black;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
}

.collapse-btn:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* Content area */
.collapse-content {
  display: block;
  padding: 10px;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.collapse-content::-webkit-scrollbar {
  height: 6px;
}

.collapse-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
}

/* Table */
.project-table {
  min-width: 900px;
  width: 100%;
  border-collapse: collapse;
  background: rgba(12, 12, 12, 0.377);
}

.project-table th,
.project-table td {
  padding: 12px;
  border: 1px solid rgba(34, 209, 49, 0.2);
  color: rgb(255, 255, 255);
  vertical-align: middle;
}

.project-table th {
  background: rgba(0, 0, 0, 0.4);
  text-align: left;
}

.project-table td:first-child,
.project-table th:first-child {
  width: 70px;
  text-align: center;
}

.project-table td:nth-child(2),
.project-table th:nth-child(2) {
  width: 120px;
  text-align: center;
}

.project-image-link {
  display: inline-block;
}

.project-thumb {
  width: 90px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.project-link {
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.project-link:hover {
  opacity: 0.85;
}

/* Mobile tweak */
@media (max-width: 768px) {
  main {
    background-attachment: scroll;
  }

  .projects-section {
    padding: 30px 15px;
  }

  .projects-header {
    margin-top: 60px;
  }

  .projects-header h2 {
    font-size: 26px;
  }

  .collapse-btn {
    font-size: 20px;
    padding: 12px 14px;
  }

  .project-table {
    min-width: 700px;
  }

  .project-thumb {
    width: 75px;
    height: 50px;
  }
}

/* =========================
   SCROLL TO TOP BUTTON
========================= */

#scrollTopBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: rgba(34, 209, 49, 0.95);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  z-index: 2147483647;
  display: none;
  pointer-events: auto;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);

  /* smooth transitions */
  transition: 
    background 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease,
    opacity 0.25s ease;
}

#scrollTopBtn:hover {
  background: rgba(52, 255, 69, 0.95);
  transform: translateY(-4px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
}

#scrollTopBtn:active {
  transform: translateY(-1px);
}