/* === Portfolio Section === */
#portfolio {
  position: relative;
  padding: 3rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(9, 199, 251, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 100%, rgba(147, 251, 157, 0.08) 0%, transparent 60%),
    linear-gradient(180deg, #f0fdf4 0%, #f8fafc 50%, #eff6ff 100%);
}

/* Subtle decorative elements */
#portfolio::before {
  content: "";
  position: absolute;
  top: -200px;
  right: -200px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(9, 199, 251, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

#portfolio::after {
  content: "";
  position: absolute;
  bottom: -200px;
  left: -200px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(74, 222, 128, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* === Section Header === */
#portfolio .section-header {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  z-index: 1;
}

#portfolio .section-title {
  font-size: 3rem;
  font-weight: 700;
  color: #1a202c;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  background-clip: unset;
}

#portfolio .section-title .highlight {
  background: linear-gradient(135deg, #09c7fb, #3ad171);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#portfolio .section-subtitle {
  font-size: 1.125rem;
  color: #64748b;
  max-width: 50ch;
  margin: 0 auto;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

/* === Slider Container === */
#portfolio-slider-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

#portfolio-slider {
  position: relative;
  width: 90%;
  max-width: 440px;
  aspect-ratio: 4 / 3;
  perspective: 1500px;
  transform-style: preserve-3d;
}

/* === Slide Card === */
.portfolio-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition:
    transform 0.5s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 0.5s ease-out;
  opacity: 0;
  transform: scale(0.8);
}

.portfolio-slide .card-content {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 1.25rem;
  box-shadow:
    0 20px 30px -8px rgba(0, 0, 0, 0.12),
    0 8px 12px -6px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  background-color: #e2e8f0;
  border: 3px solid transparent;
  transition:
    border-color 0.5s ease-out,
    box-shadow 0.3s ease;
}

.portfolio-slide.active .card-content {
  box-shadow:
    0 24px 40px -12px rgba(0, 0, 0, 0.2),
    0 8px 16px -8px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(74, 222, 128, 0.15);
}

.portfolio-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.portfolio-slide.active .portfolio-image {
  transform: scale(1.05);
}

/* === Text Overlay === */
.portfolio-text-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3.5rem 1.5rem 1.5rem;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.88) 0%,
    rgba(0, 0, 0, 0.65) 40%,
    transparent 100%
  );
  color: white;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.portfolio-slide.active .portfolio-text-overlay {
  transform: translateY(0);
}

.portfolio-text-overlay h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  letter-spacing: -0.01em;
}

.portfolio-text-overlay p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.portfolio-text-overlay .project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: #4ade80;
  text-decoration: none;
  font-size: 0.9rem;
  transition: gap 0.2s ease;
}

.portfolio-text-overlay .project-link:hover {
  gap: 0.7rem;
}

.portfolio-text-overlay .project-link svg {
  transition: transform 0.2s ease;
}

.portfolio-text-overlay .project-link:hover svg {
  transform: translateX(2px);
}

/* === Slide States === */
.portfolio-slide.active {
  opacity: 1;
  transform: translateX(0) scale(1);
  z-index: 10;
}

.portfolio-slide.active .card-content {
  border-color: #4ade80;
}

.portfolio-slide.prev,
.portfolio-slide.next {
  opacity: 1;
  z-index: 5;
  cursor: pointer;
}

.portfolio-slide.prev {
  transform: translateX(-70%) scale(0.85) rotateY(10deg);
}

.portfolio-slide.next {
  transform: translateX(70%) scale(0.85) rotateY(-10deg);
}

/* === Navigation Buttons === */
.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-radius: 9999px;
  border: 1px solid rgba(226, 232, 240, 0.6);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.08),
    0 2px 4px rgba(0, 0, 0, 0.04);
  transition:
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s ease,
    background-color 0.2s ease;
  cursor: pointer;
  color: #475569;
}

.slider-nav:hover {
  transform: translateY(-50%) scale(1.12);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.12),
    0 4px 8px rgba(0, 0, 0, 0.06);
  background-color: #ffffff;
  color: #16a34a;
}

.slider-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.slider-nav svg {
  width: 22px;
  height: 22px;
}

#prev-slide {
  left: 1rem;
}

#next-slide {
  right: 1rem;
}

/* === Slide Indicators (Dots) === */
.portfolio-indicators {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  position: relative;
  z-index: 1;
}

.portfolio-indicators .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  border: none;
  cursor: pointer;
  transition:
    all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 0;
}

.portfolio-indicators .dot.active {
  width: 28px;
  border-radius: 999px;
  background: linear-gradient(90deg, #09c7fb, #22c55e);
  cursor: default;
}

.portfolio-indicators .dot:not(.active):hover {
  background: #9ca3af;
  transform: scale(1.3);
}

/* === Responsive === */
@media (min-width: 768px) {
  #portfolio {
    padding: 3rem 2rem ;
  }

  #portfolio-slider {
    max-width: 480px;
  }

  .slider-nav {
    width: 48px;
    height: 48px;
  }

  #prev-slide {
    left: calc(50% - 310px);
  }
  #next-slide {
    right: calc(50% - 310px);
  }
}

@media (min-width: 1024px) {
  #portfolio-slider {
    max-width: 520px;
  }

  #prev-slide {
    left: calc(50% - 380px);
  }
  #next-slide {
    right: calc(50% - 380px);
  }
}

@media (max-width: 480px) {
  #portfolio {
    padding: 4rem 0.75rem 5rem;
  }

  #portfolio .section-title {
    font-size: 2rem;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
  }

  #portfolio .section-subtitle {
    font-size: 1rem;
  }

  #portfolio-slider {
    max-width: 360px;
  }

  .portfolio-text-overlay {
    padding: 2.5rem 1rem 1rem;
  }

  .portfolio-text-overlay h3 {
    font-size: 1.1rem;
  }
}
