/* ===== PROJECT DETAIL PAGE STYLES ===== */
/* Extends the base styles.css design system */

/* ---- Reading Progress Bar ---- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--coral));
  z-index: 1001;
  transition: width 0.1s linear;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  padding: 100px 0 0;
  background: var(--deep);
}

.breadcrumb-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  transition: var(--transition);
}

.breadcrumb-link:hover {
  color: var(--coral);
}

/* ---- Project Hero ---- */
.project-hero {
  padding: 48px 0 100px;
  background: var(--deep);
  position: relative;
  overflow: hidden;
}

.project-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 50% 50% at 80% 20%, rgba(74, 63, 143, 0.25) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 20% 80%, rgba(255, 107, 107, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.project-hero .container {
  position: relative;
  z-index: 1;
}

.project-hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.project-hero-content .section-tag {
  background: rgba(255, 107, 107, 0.15);
}

.project-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.project-hero-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.75;
  margin-bottom: 36px;
  max-width: 500px;
}

.project-hero-stats {
  display: flex;
  gap: 32px;
  margin-bottom: 40px;
}

.project-hero-stat {
  display: flex;
  flex-direction: column;
}

.project-hero-stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}

.project-hero-stat-value .suffix {
  color: var(--coral);
}

.project-hero-stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 6px;
  font-weight: 500;
}

.project-hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.project-hero-actions .btn-ghost {
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.2);
}

.project-hero-actions .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--white);
}

.project-hero-visual {
  position: relative;
}

.project-hero-image {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.project-hero-image-placeholder {
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(74, 63, 143, 0.3) 0%, rgba(255, 107, 107, 0.15) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.2);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ---- The Challenge Section ---- */
.project-challenge {
  padding: 120px 0;
  background: var(--white);
}

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

.challenge-narrative p {
  color: var(--text-light);
  line-height: 1.85;
  margin-bottom: 20px;
  font-size: 1.05rem;
}

.challenge-narrative p:last-child {
  margin-bottom: 0;
}

.pain-points {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pain-point {
  display: flex;
  gap: 20px;
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.pain-point:hover {
  background: var(--bg-alt);
  border-color: rgba(255, 107, 107, 0.2);
  transform: translateX(4px);
}

.pain-point-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 107, 107, 0.08);
  border-radius: var(--radius-sm);
  color: var(--coral);
}

.pain-point h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--deep);
  margin-bottom: 4px;
}

.pain-point p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* ---- The Approach Section ---- */
.project-approach {
  padding: 120px 0;
  background: var(--bg);
}

.approach-steps {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.approach-steps::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--coral), transparent);
}

.approach-step {
  display: flex;
  gap: 32px;
  padding-bottom: 48px;
  position: relative;
}

.approach-step:last-child {
  padding-bottom: 0;
}

.approach-step-number {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 2px solid var(--primary);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  position: relative;
  z-index: 1;
}

.approach-step-content h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--deep);
  margin-bottom: 8px;
  padding-top: 12px;
}

.approach-step-content p {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.75;
}

.approach-step-detail {
  margin-top: 12px;
  padding: 16px 20px;
  background: var(--white);
  border-left: 3px solid var(--coral);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}

.tech-stack {
  margin-top: 64px;
}

.tech-stack h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--deep);
  text-align: center;
  margin-bottom: 32px;
}

.tech-stack-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.tech-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  transition: var(--transition);
}

.tech-item:hover {
  border-color: var(--primary);
  background: var(--bg-alt);
}

/* ---- Mid-Page Inline CTA ---- */
.project-cta-inline {
  padding: 80px 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  position: relative;
  overflow: hidden;
}

.project-cta-inline::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.project-cta-inline-inner {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
}

.project-cta-inline-inner h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
}

.project-cta-inline-inner p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.7;
  margin-bottom: 28px;
}

.btn-white {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.btn-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

/* ---- Key Features Section ---- */
.project-features {
  padding: 120px 0;
  background: var(--white);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.feature-card-inner {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  height: 100%;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--coral));
  transform: scaleX(0);
  transform-origin: left;
  transition: var(--transition-slow);
}

.feature-card:hover .feature-card-inner {
  border-color: rgba(74, 63, 143, 0.2);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.feature-card:hover .feature-card-inner::before {
  transform: scaleX(1);
}

.feature-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border-radius: var(--radius-md);
  color: var(--primary);
  margin-bottom: 20px;
  transition: var(--transition);
}

.feature-card:hover .feature-icon {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--deep);
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.7;
}

/* ---- Screenshots / Showcase Section ---- */
.project-showcase {
  padding: 120px 0;
  background: var(--bg);
}

.showcase-gallery {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.showcase-item {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}

.showcase-item:nth-child(even) {
  direction: rtl;
}

.showcase-item:nth-child(even) > * {
  direction: ltr;
}

.showcase-image-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}

.showcase-image-wrapper::after {
  content: 'Click to enlarge';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  opacity: 0;
  transition: var(--transition);
}

.showcase-image-wrapper:hover::after {
  opacity: 1;
}

.showcase-image-wrapper img {
  width: 100%;
  display: block;
  transition: var(--transition);
}

.showcase-image-wrapper:hover img {
  transform: scale(1.02);
}

.showcase-caption {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-lighter);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.showcase-description h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--deep);
  margin-bottom: 12px;
}

.showcase-description p {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.75;
}

/* ---- Results & Impact Section ---- */
.project-results {
  padding: 120px 0;
  background: var(--deep);
}

.project-results .section-tag {
  background: rgba(255, 107, 107, 0.15);
}

.project-results .section-title {
  color: var(--white);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 64px;
}

.result-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  transition: var(--transition);
}

.result-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-4px);
}

.result-value {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
  margin-bottom: 8px;
}

.result-value .suffix {
  color: var(--coral);
  font-size: 0.7em;
}

.result-label {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
}

.result-context {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
}

.results-testimonial {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.results-testimonial blockquote {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.8;
  font-style: italic;
  margin-bottom: 24px;
  position: relative;
  padding: 0 24px;
}

.results-testimonial blockquote::before {
  content: '"';
  position: absolute;
  top: -20px;
  left: 0;
  font-family: var(--font-display);
  font-size: 4rem;
  color: var(--coral);
  opacity: 0.3;
  line-height: 1;
}

.results-testimonial .testimonial-author {
  justify-content: center;
  border-top-color: rgba(255, 255, 255, 0.08);
}

.results-testimonial .testimonial-author strong {
  color: var(--white);
}

.results-testimonial .testimonial-author span {
  color: rgba(255, 255, 255, 0.45);
}

/* ---- Insights / Lessons Learned ---- */
.project-insights {
  padding: 120px 0;
  background: var(--white);
}

.insights-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.insight-item {
  display: flex;
  gap: 28px;
}

.insight-number {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--border);
  line-height: 1;
  padding-top: 4px;
}

.insight-item h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--deep);
  margin-bottom: 8px;
}

.insight-item p {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.8;
}

/* ---- Related Projects ---- */
.project-related {
  padding: 120px 0;
  background: var(--bg);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.related-grid .project-card {
  background: var(--deep);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.related-grid .project-card:hover {
  background: rgba(30, 27, 58, 0.95);
}

.related-grid .project-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* ---- Final CTA Section ---- */
.project-cta-final {
  padding: 120px 0;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 40%, var(--primary-light) 100%);
  position: relative;
  overflow: hidden;
}

.project-cta-final::before {
  content: '';
  position: absolute;
  top: -30%;
  left: -10%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: rgba(255, 107, 107, 0.08);
  pointer-events: none;
}

.project-cta-final::after {
  content: '';
  position: absolute;
  bottom: -40%;
  right: -10%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(72, 191, 227, 0.06);
  pointer-events: none;
}

.project-cta-final .container {
  position: relative;
  z-index: 1;
}

.project-cta-final-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.project-cta-final .section-tag {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
}

.project-cta-final .section-title {
  color: var(--white);
  margin-bottom: 20px;
}

.project-cta-final-text {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.75;
  margin-bottom: 40px;
}

.project-cta-form {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  padding: 40px;
  text-align: left;
}

.project-cta-form .form-group label {
  color: rgba(255, 255, 255, 0.8);
}

.project-cta-form .form-group input,
.project-cta-form .form-group textarea {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--white);
}

.project-cta-form .form-group input::placeholder,
.project-cta-form .form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.project-cta-form .form-group input:focus,
.project-cta-form .form-group textarea:focus {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.project-cta-note {
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 20px;
}

/* ---- Image Lightbox ---- */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
  opacity: 1;
}

.lightbox-overlay img {
  max-width: 90%;
  max-height: 90vh;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

/* ===== RESPONSIVE — PROJECT PAGE ===== */
@media (max-width: 1024px) {
  .project-hero-inner {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }

  .project-hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .project-hero-stats {
    justify-content: center;
  }

  .project-hero-actions {
    justify-content: center;
  }

  .project-hero-visual {
    max-width: 560px;
    margin: 0 auto;
  }

  .challenge-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-grid .project-card {
    grid-template-columns: 1fr;
  }

  .related-grid .project-meta {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .showcase-item,
  .showcase-item:nth-child(even) {
    grid-template-columns: 1fr;
    direction: ltr;
  }
}

@media (max-width: 768px) {
  .breadcrumb {
    padding-top: 80px;
  }

  .project-hero {
    padding: 32px 0 64px;
  }

  .project-hero-stats {
    flex-wrap: wrap;
    gap: 20px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .results-grid {
    grid-template-columns: 1fr 1fr;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .project-challenge,
  .project-approach,
  .project-features,
  .project-showcase,
  .project-results,
  .project-insights,
  .project-related,
  .project-cta-final {
    padding: 80px 0;
  }

  .project-cta-inline {
    padding: 60px 0;
  }

  .project-cta-inline-inner {
    padding: 36px 24px;
  }

  .project-cta-form {
    padding: 28px 20px;
  }

  .approach-steps::before {
    left: 24px;
  }
}

@media (max-width: 480px) {
  .project-hero-stats {
    flex-direction: column;
    align-items: center;
  }

  .project-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .result-value {
    font-size: 2.2rem;
  }

  .approach-step {
    gap: 20px;
  }

  .approach-step-number {
    width: 40px;
    height: 40px;
    font-size: 0.75rem;
  }

  .approach-steps::before {
    left: 19px;
  }

  .insight-item {
    flex-direction: column;
    gap: 12px;
  }
}
