/* --- Projects Section --- */
#projects {
  text-align: center;
  padding: 120px 20px;
  position: relative;
  background: linear-gradient(135deg, #0a0e17 0%, #1a1f3a 50%, #0f1525 100%);
  font-family: "Poppins", sans-serif;
  color: #fff;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Background effect for projects section */
#projects::before {
  content: "";
  position: absolute;
  top: 20%;
  right: 10%;
  width: 60%;
  height: 60%;
  max-width: 1000px;
  z-index: 0;
}

.projects-header {
  text-align: center;
  margin-bottom: 5rem;
  position: relative;
  z-index: 1;
}

.projects-header h2 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 60px;
  font-weight: 800;
  background: linear-gradient(135deg, #88d3ce 0%, #6e45e2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-family: "Orbitron", sans-serif;
  display: inline-block;
}

.projects-header .projects-intro {
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: 700px;
  margin: 0 auto;
  color: var(--text-secondary);
  /* Ensure --text-secondary is defined */
}

/* --- Projects Container (Grid Layout, Responsive) --- */
.project-card {
  background: rgba(26, 31, 58, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  overflow: hidden;
  width: 100%; /* ✅ responsive inside grid */
  max-width: 100%; /* ✅ prevent overflow */
  transition: transform 0.4s ease, box-shadow 0.4s ease, opacity 0.6s ease-out,
    transform 0.6s ease-out;
  border: 1px solid rgba(136, 211, 206, 0.25);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);

  opacity: 0;
  transform: translateY(40px);
}

/* --- Responsive Grid --- */
.projects-container {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(260px, 1fr)
  ); /* ✅ shrinks smoothly */
  gap: 40px;
  padding: 20px;
  margin-bottom: 50px;
  position: relative;
  z-index: 1;
}

.project-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card:hover {
  transform: translateY(-12px) scale(1.03);
  box-shadow: 0 25px 50px rgba(110, 69, 226, 0.45);
  border-color: rgba(136, 211, 206, 0.45);
}

/* --- Project Image Area --- */
.project-image {
  position: relative;
  height: 200px;
  /* Fixed height for consistency */
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
  filter: brightness(0.8) grayscale(0.2);
}

.project-card:hover .project-image img {
  transform: scale(1.1);
  filter: brightness(1) grayscale(0);
}

/* "Ongoing" Tag */
.ongoing-tag {
  position: absolute;
  top: 12px;   /* ✅ keep inside the card */
  right: -35px; /* ✅ slight offset for angled effect */
  background: linear-gradient(
    135deg,
    var(--secondary-accent),
    var(--primary-accent)
  );
  color: white;
  padding: 5px 0;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  width: 140px; /* ✅ wide enough for text */
  transform: rotate(45deg); /* ✅ diagonal effect */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  z-index: 5;
}


/* Project Overlay with Links */
.project-overlay {
  padding: 1rem;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(110, 69, 226, 0.7);
  /* Overlay color */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-links {
  display: flex;
  gap: 20px;
}

.project-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(5px);
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.project-link:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* --- Project Info --- */
.project-info {
  padding: 25px;
  text-align: left;
  /* Align text left within the info block */
  background: rgba(26, 31, 58, 0.8);
  /* Slightly darker background for info */
  border-top: 1px solid rgba(136, 211, 206, 0.1);
}

.project-info h3 {
  font-family: "Orbitron", sans-serif;
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 10px;
}

.project-info .project-description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  /* Allow tags to wrap if many */
  gap: 10px;
}

.project-tags .tag {
  background: var(--bg-dark-secondary);
  /* Darker background for tags */
  color: var(--primary-accent);
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(136, 211, 206, 0.1);
  transition: background 0.3s ease, color 0.3s ease;
}

.project-tags .tag:hover {
  background: var(--primary-accent);
  color: var(--bg-dark-primary);
}

/* --- Call to Action Button --- */
.projects-cta {
  text-align: center;
  margin-top: 3rem;
  position: relative;
  z-index: 1;
}

.projects-btn {
  padding: 15px 40px;
  font-size: 1.1rem;
  background: linear-gradient(
    135deg,
    var(--secondary-accent),
    var(--primary-accent)
  );
  border: none;
  border-radius: 50px;
  color: white;
  cursor: pointer;
  transition: all 0.4s ease;
  font-family: "Orbitron", sans-serif;
  font-weight: 600;
  letter-spacing: 1px;
  box-shadow: 0 10px 30px rgba(110, 69, 226, 0.3);
}

.projects-btn:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 15px 40px rgba(110, 69, 226, 0.5);
}

/* --- Mobile Friendly Adjustments --- */
@media (max-width: 768px) {
  .projects-container {
    grid-template-columns: 1fr; /* ✅ single column for mobile */
    gap: 20px;
    padding: 15px;
  }

  .project-card {
    width: 100%; /* ✅ no fixed width */
    max-width: 100%; /* ✅ keep it fluid */
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    transform: none !important;
  }

  .project-card:hover {
    transform: none;
  }
}

/* --- Extra Small Screens (phones < 480px) --- */
@media (max-width: 480px) {
  .projects-container {
    padding: 10px;
    gap: 15px;
  }

  .project-card {
    border-radius: 14px;
    padding: 10px;
  }
}
