/* ----- // MAIN LAYOUT SPACING // ----- */
/* Add padding to all sections except hero */
main section:not(.project-hero) {
  padding-left: 20px;
  padding-right: 20px;
}

/* ----- SECTION HEADERS (h2) STYLING ----- */
main section:not(.project-hero) > h2 {
  text-align: center;
  color: var(--text-heading-h2);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 40px;
  padding-bottom: 15px;
  position: relative;
  letter-spacing: -0.5px;
}

/* Center underline accent */
main section:not(.project-hero) > h2::after  {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--accent-color);
  border-radius: 2px;
}

/* ----- // Project Hero Section // ----- */
.project-hero {
  text-align: center;
  padding: 60px 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 40px;
  position: relative;
  /* Modern background gradient */
  background: radial-gradient(circle at top right, 
              color-mix(in srgb, var(--accent-color), transparent 90%) 0%, 
              transparent 40%);
}

.project-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
}

.hero-icon {
  width: 100px;
  height: 100px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.title-with-badge {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.title-with-badge h2 {
  margin: 0;
  border: none;
  padding: 0;
  font-size: 3rem;
  line-height: 1.2;
  letter-spacing: -1px;
}

/* Status Badge with Pulse Animation */
@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-color), transparent 70%); }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.status-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
  align-self: center; /* Centered in column */
}

.status-badge.coming-soon {
  background: linear-gradient(135deg, var(--accent-color), #712bb6);
  color: #fff;
  animation: pulse-glow 2s infinite; /* Option 1: Pulse effect */
}

.project-tagline {
  font-size: 1.3rem;
  color: var(--text-muted);
  margin: 10px 0 20px 0;
}

.project-description {
  font-size: 1.05rem;
  max-width: 700px;
  margin: 0 auto 30px;
  line-height: 1.7;
}

.platform-badges {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 20px;
}
/* ----------------------------------- */

/* ----- Team References ----- */
.hero-team-compact {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.team-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin: 0;
}

.team-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.team-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px 8px 8px; /* Less padding left for avatar */
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 30px; 
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.team-link:hover {
  border-color: var(--accent-color);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px -5px color-mix(in srgb, var(--accent-color), transparent 70%);
}

.team-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--bg-body); /* Creates a ring between avatar and border */
}

/* Optional: Connect with an ampersand if desired, currently hidden via color in some themes, 
   but let's style it just in case it's used */
.team-separator {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 1.5rem;
  margin: 0 5px;
}
/* ----- // END // ----- */
/* -------------------------------------------------------- */

/* ----- // Contributions Grid // ----- */
.contributions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* Slightly wider min-width */
  gap: 24px;
  margin-top: 30px;
}

.contribution-item {
  background: var(--bg-card);
  border: 1px solid transparent; 
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04); 
  padding: 24px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Add a subtle top accent bar */
.contribution-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-color);
  opacity: 0.7;
}

.contribution-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.contribution-item h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-heading-h3);
  display: flex;
  align-items: center;
  gap: 10px;
}

.contribution-item ul {
  margin: 0;
  padding-left: 0; /* Remove default padding */
  list-style: none; /* Remove default bullets */
}

.contribution-item li {
  margin-bottom: 12px;
  line-height: 1.6;
  font-size: 0.95rem;
  color: var(--text-muted);
  display: grid;
  grid-template-columns: 12px 1fr; /* Create column for custom bullet */
  gap: 12px;
}

/* Custom Arrow Bullet */
.contribution-item li::before {
  content: "›"; 
  color: var(--accent-color);
  font-weight: bold;
  font-size: 1.2rem;
  line-height: 1.1rem;
}

/* Dark mode adjustment for card background distinction */
[data-theme='dark'] .contribution-item {
  background: var(--bg-paper); /* Slightly lighter than body */
  border: 1px solid var(--border-color); 
}
/* ----- // END // ----- */
/* ----------------------------------- */

/* ----- // Challenge Cards // ----- */
.challenges-grid {
  display: grid;
  grid-template-columns: 1fr; 
  gap: 30px;
  margin-top: 30px;
  max-width: 900px; /* Constrain width */
  margin-left: auto;
  margin-right: auto;
}

.challenge-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 30px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.challenge-card h3 {
  margin: 0;
  color: var(--accent-color);
  font-size: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 15px;
}

.challenge-step {
  display: grid;
  grid-template-columns: auto 1fr; 
  gap: 15px;
  align-items: start; 
}

/* Problem/Solution/Result Badges */
.step-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 12px;
  border-radius: 30px;
  min-width: 80px;
  text-align: center;
  flex-shrink: 0;
  align-self: center; /* Keep badge at top */
  white-space: nowrap;
}

.label-problem { background: #fee2e2; color: #991b1b; }
.label-solution { background: #dcfce7; color: #166534; }
.label-result { background: #fef9c3; color: #854d0e; }

/* Dark mode badge adjustments */
[data-theme='dark'] .label-problem { background: #450a0a; color: #fecaca; }
[data-theme='dark'] .label-solution { background: #064e3b; color: #d1fae5; }
[data-theme='dark'] .label-result { background: #422006; color: #fef08a; }

.step-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-main);
}
/* ----- // END // ----- */
/* ----------------------------------- */

/* ----- // Architecture Layers // ----- */
.architecture-note {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  margin: 20px 0 30px;
}

.architecture-layers {
  display: flex;
  flex-direction: column;
  max-width: 600px;
  margin: 0 auto;
  gap: 0; /* Remove gap to create stack connection */
}

.layer-card {
  position: relative;
  border: 1px solid var(--border-color);
  padding: 25px;
  background: linear-gradient(to right, var(--bg-card), transparent);
  text-align: left;
  border-bottom: none; /* Remove bottom border for stacking look */
  transition: all 0.3s ease;
}

/* Top card rounded top only */
.layer-card:first-child { 
  border-radius: 12px 12px 0 0; 
}

/* Bottom card rounded bottom and has border */
.layer-card:last-child { 
  border-radius: 0 0 12px 12px; 
  border-bottom: 1px solid var(--border-color); 
}

/* Middle cards square */
.layer-card:not(:first-child):not(:last-child) {
  border-radius: 0;
}

/* Colored indicator strip on the left */
.layer-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-color);
  opacity: 0.3;
  transition: opacity 0.3s;
}

.layer-card:first-child::before { border-top-left-radius: 12px; }
.layer-card:last-child::before { border-bottom-left-radius: 12px; }

.layer-card:hover::before {
  opacity: 1;
}

.layer-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--accent-color);
  font-size: 1rem;
}

.layer-card p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
}
/* ----- // END // ----- */
/* ----------------------------------- */

/* ----- // Media Gallery // ----- */
.gallery-note {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 30px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* Feature the video on larger screens */
@media (min-width: 768px) {
    .video-featured {
        grid-column: span 2;
        aspect-ratio: 16/9;
    }
}

.video-featured {
  grid-column: 1 / -1; /* Spans all columns to center itself */
  cursor: default;     /* Removed zoom-in cursor */
  aspect-ratio: 16 / 9;
  max-width: 900px;    
  margin: 0 auto;      
}

/* --- Media Item Container --- */
.media-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  position: relative;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.media-item:not(.video-featured) {
  cursor: zoom-in;
  aspect-ratio: 1 / 1; /* Keep images as consistent squares or 4:3 */
}

.media-item:hover {
  transform: translateY(-5px);
  border-color: var(--accent-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* --- The Real Content (Top Layer) --- */
.media-item img,
.media-item video {
    position: relative;
    z-index: 2; /* Sits ON TOP of the placeholder */
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: transparent; /* Ensures transparency doesn't block placeholder if needed */
}

/* Placeholder with Shimmer Effect */
.media-item.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  color: var(--text-muted);
  position: relative;
  overflow: hidden;
}

/* Shimmer animation overlay */
.media-item.placeholder::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  transform: translateX(-100%);
  animation: shimmer 2s infinite;

  /* DEFAULT (Light Mode) */
  background: linear-gradient(
      90deg, 
      transparent, 
      rgba(0,0,0, 0.06),
      transparent
  );
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .video-featured {
        aspect-ratio: 4 / 3;
    }
}

/* DARK MODE OVERRIDE: Use white tint */
[data-theme='dark'] .media-item.placeholder::after {
  background: linear-gradient(
      90deg, 
      transparent, 
      rgba(255,255,255,0.05), 
      transparent
  );
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* --- Placeholder Content (Text & Icons) --- */
.placeholder-content {
  text-align: center;
  z-index: 2;
  display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.placeholder-content svg {
    stroke: var(--text-muted);
    transition: stroke 0.3s ease;
}

.media-item:hover .placeholder-content svg {
  stroke: var(--accent-color); /* Highlight icon on hover if image is missing */
}

.placeholder-content p {
  margin: 0;
  font-size: 0.9rem;
}

.gallery-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}

.gallery-btn {
  background: var(--bg-paper);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 15px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-btn:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}

.gallery-counter {
  color: var(--text-muted);
  font-weight: 600;
}
/* ----- // END // ----- */
/* ----------------------------------- */

/* ----- // Tech Stack // -----  */
#tech-stack, .tech-category {
  text-align: center;
}

.tech-details {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-top: 20px;
  max-width: 800px; /* Constrain width for better centering */
  margin-left: auto;
  margin-right: auto;
}

.tech-category h3 {
  margin: 0 0 20px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  display: inline-block; /* Make border only as wide as text */
  border-bottom: 2px solid var(--accent-color); /* Add bottom border instead */
  padding-left: 0;
  padding-bottom: 8px;
}

[data-theme='dark'] .tech-category h3 {
  color: var(--text-main);
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

/* Tech Tag Styling */
.tech-tag {
  background: var(--bg-card);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.tech-tag:hover {
  transform: translateY(-3px);
  border-color: var(--accent-color);
  box-shadow: 0 8px 20px -5px rgba(92, 43, 182, 0.3);
  background: var(--bg-card);
  color: var(--accent-color);
}

.tech-tag i,
.tech-tag .custom-icon {
  font-size: 1.2rem;
  width: 1.2rem;
  height: 1.2rem;
  vertical-align: middle;
  flex-shrink: 0;
}

.custom-icon {
  width: 1.2rem;
  height: 1.2rem;
  vertical-align: middle;
}
/* ----- // END // ----- */
/* ----------------------------------- */

/* ----- Results ----- */
.results-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 25px;
  margin-top: 20px;
}

.achievement-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 25px;
  border-radius: 8px;
}

.achievement-card h3 {
    display: flex;           /* Puts SVG and text side-by-side */
    align-items: center;     /* Centers them vertically */
    gap: 12px;               /* Adds space between the icon and text */
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.25rem;
    line-height: 1.4;
}

/* Resize and Color the Icon */
.achievement-card h3 svg {
    width: 24px;             /* Enforce a smaller size */
    height: 24px;
    min-width: 24px;         /* Prevents shrinking on narrow screens */
    fill: var(--accent-color); /* Colors the icon with your theme accent */
}

.achievement-card ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.achievement-card li {
  margin-bottom: 12px;
  line-height: 1.6;
  font-size: 0.95rem;
  color: var(--text-muted);
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 12px;
}

/* Custom Arrow Bullet */
.achievement-card li::before {
  content: "›"; 
  color: var(--accent-color);
  font-weight: bold;
  font-size: 1.2rem;
  line-height: 1.3rem;
}
/* ----- // END // ----- */
/* ----------------------------------- */