/* === Tech Stack Section === */
#tech-stack {
  position: relative;
  padding: 0; /* Remove lateral padding so the container takes 100% */
  margin: 10px auto;
  max-width: 1280px; /* Adjust this value if necessary */
  width: 100%; /* Ensures the container takes the available width */
  box-sizing: border-box;
}

.tech-stack-title {
  font-family: 'Orbitron', sans-serif;
  color: #ffffff;
  font-size: 45px;
  text-align: center;
  text-shadow: 0 0 15px rgba(92, 232, 88, 0.9);
  
  /* Requested distances */
  margin-top: 80px;    /* "> Our Tech Stack" 88px from top */
  margin-bottom: 30px; /* 58px above the box */
}

.tech-stack-content-box {
  background: rgba(13, 17, 23, 0.7);
  border: 1px solid rgba(0, 255, 65, 0.4);
  border-radius: 12px;
  padding: 0px 20px 30px 20px; /* 38px internal top padding */
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  width: 100%; /* Forces 100% of space */
  box-sizing: border-box;
  transition: all 0.3s ease; /* Added for a smooth transition */
}

/* Glow effect and border change on mouseover */
.tech-stack-content-box:hover {
  border-color: #00BFFF; /* Cyan border */
  box-shadow: 0 5px 25px rgba(0, 255, 65, 0.3), 0 0 15px rgba(0, 204, 255, 0.3); /* Double glow (green and cyan) */
}

.tech-stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Forces 3 equal columns */
  gap: 20px;
  width: 100%;
}

.tech-category {
  position: relative;
  padding: 0px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tech-category-title {
  /* ... your other styles ... */
  
  /* Adjust these values */
  margin-bottom: 10px; /* Reduce from 25px to 10px to bring cards closer */
  margin-top: 5px;       /* Explicitly ensure it has no top margin */
  
  /* Keep the rest */
  min-height: 3em; 
  display: flex;
  align-items: flex-end; 
  font-family: 'Orbitron', sans-serif;
  color: #00BFFF;
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-shadow: 0 0 8px rgba(0, 191, 255, 0.4);
  border-bottom: 1px solid rgba(0, 191, 255, 0.2);
  padding-bottom: 10px;
}

/* ... Keep the rest of your styles for .tech-card and .tech-cards-container the same ... */

/* Simple circuit lines connecting categories */
.tech-category:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -10px; /* Adjusted to the gap */
  transform: translateY(-50%);
  width: 1px;
  height: 60%;
  background: linear-gradient(to top, transparent, rgba(0, 191, 255, 0.3), transparent);
  transition: all 0.3s ease;
}

.tech-category-title {
  /* Fixed height to align all bottom borders */
  min-height: 3em; 
  display: flex;
  align-items: flex-end; 
  
  font-family: 'Orbitron', sans-serif;
  color: #00BFFF;
  font-size: 22px;
  margin-bottom: 25px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-shadow: 0 0 8px rgba(0, 191, 255, 0.4);
  border-bottom: 1px solid rgba(0, 191, 255, 0.2);
  padding-bottom: 10px;
}

.tech-cards-container {
    /* Switched to flex for total control */
    display: flex;
    flex-wrap: wrap; /* Allows wrapping to the next line if necessary */
    gap: 15px;
    flex-grow: 1;
}

.tech-card {
    /* Define a fixed size so they NEVER change size */
    flex: 0 0 100px; /* Does not grow, does not shrink, 100px width */
    width: 100px;
    height: 100px; /* Or preferred height for uniform squares */
    
    position: relative;
    background-color: rgba(10, 15, 25, 0.8);
    background-image: linear-gradient(45deg, rgba(255,255,255,0.02) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.02) 50%, rgba(255,255,255,0.02) 75%, transparent 75%, transparent);
    background-size: 8px 8px;
    border: 2px solid transparent; 
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-sizing: border-box;
}

.tech-card:hover {
  transform: none; /* Remove translateY so it doesn't overflow its container */
  border-color: #ffc800; /* Inner yellow border */
  box-shadow: inset 0 0 10px rgba(255, 200, 0, 0.3); /* Inward shadow */
}

/* Connecting line hover effect */
.tech-category:has(.tech-card:hover)::after {
  background: linear-gradient(to top, transparent, #ffc800, transparent);
  box-shadow: 0 0 10px #ffc800;
}

.tech-card-logo {
  width: 50px;
  height: 50px;
  margin: 0 auto 10px;
  object-fit: contain;
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: grayscale(50%) brightness(0.8);
}

.tech-card:hover .tech-card-logo {
  transform: scale(1.1);
  filter: grayscale(0%) brightness(1.1) drop-shadow(0 0 8px rgba(255, 200, 0, 0.7));
}

.tech-card-name {
  font-family: 'JetBrains Mono', 'Andale Mono', monospace;
  color: #e0e0e0;
  font-size: 14px;
  margin: 0;
}

.tech-card-version {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #00BFFF;
  margin-top: 5px;
  opacity: 0.8;
}

/* ================================================================
   MOBILE RESPONSIVE — Tech Stack Section
   ================================================================ */
@media (max-width: 1024px) {
  .tech-stack-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on tablet */
  }

  .tech-stack-title {
    font-size: 35px;
    margin-top: 50px;
    margin-bottom: 20px;
  }
}

@media (max-width: 768px) {
  .tech-stack-grid {
    grid-template-columns: 1fr; /* 1 column on mobile */
  }

  .tech-stack-title {
    font-size: 26px;
    margin-top: 40px;
    margin-bottom: 16px;
  }

  .tech-stack-content-box {
    padding: 0 12px 20px 12px;
  }

  .tech-category-title {
    font-size: 18px;
  }

  .tech-card {
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
    padding: 10px;
  }

  .tech-card-logo {
    width: 40px;
    height: 40px;
  }

  .tech-card-name {
    font-size: 11px;
  }
}

@media (max-width: 600px) {
  .tech-stack-title {
    font-size: 22px;
  }

  /* Slightly smaller cards on very narrow screens */
  .tech-card {
    flex: 0 0 70px;
    width: 70px;
    height: 70px;
    padding: 8px;
  }

  .tech-card-logo {
    width: 34px;
    height: 34px;
    margin-bottom: 6px;
  }

  .tech-card-name {
    font-size: 10px;
  }
}

/* * {
    outline: 1px solid red !important;
} */