/* Projects */
#projects .projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.project-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: background 0.3s, border-color 0.3s;
}

.project-card h3 {
  margin-top: 0;
}

.project-card a {
  color: #007bff;
}

/* Portfolio */
#portfolio {
  padding-top: 6rem;
}

#portfolio .portfolio-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.portfolio-card {
  display: flex;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: border-color 0.3s;
}

.portfolio-img {
  flex: 1 1 100%;
  max-width: none;
  width: 90%;
  object-fit: cover;
  object-position: center center;
  display: block;
  padding: 1.5rem;
}

.portfolio-content {
  flex: 1 1 60%;
  padding: 1.5rem;
}

.portfolio-content h3 {
  margin-top: 0;
}

.portfolio-content a {
  color: #007bff;
}

.project-card,
.portfolio-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  /* Smooth 'snap' effect */
  position: relative;
  z-index: 1;
}

.project-card:hover,
.portfolio-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(14, 165, 164, 0.15);
  /* Soft teal shadow */
  border-color: var(--primary);
  /* Highlights the border in teal */
  background: rgba(255, 255, 255, 0.85);
  /* Becomes slightly less transparent */
}

.portfolio-card:hover .portfolio-img {
  transform: scale(1.02);
  transition: transform 0.4s ease;
}

/* About */
#about .profile-pic {
  float: left;
  margin: 0 1.5rem 1rem 0;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  shape-outside: circle();
  /* Helps text wrap nicely around the circle */
  border: 3px solid rgba(255, 255, 255, 0.8);
  /* Clean white rim */
  box-shadow: 0 0 20px rgba(14, 165, 164, 0.5);
  /* Teal Glow */
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

/* Hover Interaction */
#about .profile-pic:hover {
  transform: scale(1.08);
  box-shadow: 0 0 35px rgba(14, 165, 164, 0.8);
  /* Glow gets intense */
}

/* Technologies & Skills Grid */
.tech-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  padding: 1rem 0;
}

.tech-badge {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;

  /* Glass Effect */
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.3);

  /* Typography & Layout */
  font-weight: 500;
  color: #374151;
  font-size: 0.95rem;
  letter-spacing: 0.02em;

  cursor: default;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
  animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

.tech-badge:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-4px) scale(1.05);
  border-color: var(--primary);
  color: var(--primary-600);
  box-shadow: 0 8px 20px rgba(14, 165, 164, 0.25);
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(20px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Contact */
#contact .contact-list {
  list-style: none;
  padding: 0;
  /* Make the list centered and neat */
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 700px;
  margin: 1rem auto;
}

#contact .contact-list li {
  /* 1. GLASS CONTAINER STYLE */
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;

  /* 2. SPACING & LAYOUT */
  padding: 1rem 1.5rem;
  font-size: 1.05rem;
  color: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  position: relative;

  /* 3. INTERACTION */
  transition: all 0.3s ease;
  cursor: default;

  overflow-wrap: break-word;
  /* Standard way to break long words */
  word-wrap: break-word;
  /* Legacy support */
  hyphens: auto;
  /* Adds hyphens if possible */
}

.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  margin-left: 4px;
  border-radius: 6px;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: rgba(14, 165, 164, 0.1);
  color: var(--primary);
  transform: scale(1.1);

}

#contact .contact-list li a {
  color: var(--primary-600);
  font-weight: bold;
  text-decoration: none;
  margin-left: 5px;
}

/* Hover Effect for the whole row */
#contact .contact-list li:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: translateX(10px);
  /* Slides slightly to the right */
  border-color: var(--primary);
  box-shadow: 0 5px 15px rgba(14, 165, 164, 0.2);
  /* Teal shadow */
}

@media screen and (max-width: 480px) {
  #contact .contact-list li {
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.2rem;
  }

  #contact .contact-list li a {
    margin-left: 0;
  }
}

/* CTA Button */
.cta-container {
  margin-top: 2rem;
}

.cta-button {
  display: inline-block;
  padding: 0.9rem 2.5rem;
  font-size: 1.1rem;
  font-weight: bold;
  text-decoration: none;
  border-radius: 50px;

  background: var(--primary);
  color: #ffffff;
  border: 2px solid var(--primary);

  box-shadow: 0 4px 15px rgba(14, 165, 164, 0.3);
  transition: all 0.3s ease;
}

.cta-button:hover {
  background: transparent;
  color: var(--primary);
  box-shadow: 0 6px 20px rgba(14, 165, 164, 0.5);
  transform: translateY(-3px);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  /* Controls spacing between items */
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem 0;
}

.timeline::after,
.timeline-item::after {
  display: none !important;
}

.timeline-item {
  background: transparent;
  padding: 0;
  width: 100%;
}

.timeline-content {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.3) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  /* Smoother corner */
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-left: 4px solid var(--primary);
  /* A clean left accent replaces the external track */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  overflow: hidden;

  /* CSS Grid to put Date on the Right of the Title */
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
}

/* Subtle inner glow */
.timeline-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent, rgba(14, 165, 164, 0.05));
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.timeline-content:hover {
  transform: translateY(-3px);
  border-left-width: 8px;
  /* Accent bar grows smoothly */
  box-shadow: 0 8px 20px rgba(14, 165, 164, 0.1);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.5) 100%);
}

.timeline-content:hover::before {
  opacity: 1;
}

.timeline-date {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  font-size: 0.8rem;
  /* Scaled down */
  color: var(--primary-600);
  font-weight: 700;
  margin-bottom: 0.8rem;
  background: rgba(14, 165, 164, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.timeline-content h3 {
  grid-column: 1;
  grid-row: 1;
  margin: 0 0 0.5rem 0;
  padding-right: 1.5rem;
  /* Gap buffer so long titles don't touch the date pill */
  font-size: 1.25rem;
  /* Scaled down */
  color: #111827;
}

.timeline-content>*:not(h3):not(.timeline-date) {
  grid-column: 1 / -1;
}

.timeline-content h4 {
  margin: 0 0 0.8rem 0;
  color: #6b7280;
  font-weight: 500;
  font-size: 0.95rem;
  /* Scaled down */
}

.timeline-content p,
.timeline-content ul {
  position: relative;
  z-index: 1;
  color: #374151;
  font-size: 0.9rem;
  /* Scaled down text */
  margin-bottom: 0.5rem;
}

@media screen and (max-width: 768px) {
  .timeline-content {
    padding: 1rem 1.2rem;
    grid-template-columns: 1fr;
    /* Switch to single column on mobile */
  }

  .timeline-date {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    /* Put date back on the left */
    margin-bottom: 0.6rem;
  }

  .timeline-content h3 {
    grid-column: 1;
    grid-row: 2;
    padding-right: 0;
  }
}

/* ==========================================================================
   Project Page Specific Styles
   ========================================================================== */

/* Featured Projects Showcase */
.projects-showcase-grid {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  max-width: 900px;
  margin: 0 auto;
}

.showcase-card {
  display: flex;
  flex-direction: row;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  min-height: 250px;
}

.showcase-card.rev {
  flex-direction: row-reverse;
}

.showcase-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(14, 165, 164, 0.15);
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.85);
}

.showcase-img {
  flex: 0 0 40%;
  overflow: hidden;
  position: relative;
}

.showcase-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.showcase-card:hover .showcase-img img,
.showcase-card:hover .showcase-img div {
  transform: scale(1.05);
  transition: transform 0.5s ease;
}

.showcase-content {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.showcase-content h3 {
  margin-top: 0;
  font-size: 1.5rem;
  color: #111827;
  margin-bottom: 0.5rem;
}

.showcase-content p {
  color: #555;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* Tech Pills (for projects) */
.tech-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tech-pills span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-600);
  background: rgba(14, 165, 164, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

/* Action Buttons within Projects */
.project-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.project-actions a.small-btn {
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
}

.project-actions a.outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.project-actions a.outline:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(14, 165, 164, 0.3);
}

/* Grid for smaller projects */
.projects-grid.extra {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.projects-grid.extra .project-card {
  display: flex;
  flex-direction: column;
}

.projects-grid.extra .project-card p {
  flex-grow: 1;
  color: #555;
  font-size: 0.95rem;
}

.projects-grid.extra .project-actions {
  margin-top: auto;
  padding-top: 1rem;
}

.projects-grid.extra .project-actions a {
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s, transform 0.2s;
}

.projects-grid.extra .project-actions a:hover {
  color: var(--primary-600);
  transform: translateX(3px);
}

/* Responsive */
@media screen and (max-width: 768px) {
  .showcase-card, .showcase-card.rev {
    flex-direction: column;
  }
  
  .showcase-img {
    height: 200px;
    flex: none;
  }

  .projects-grid.extra {
    grid-template-columns: 1fr;
  }
}