/* ===========================
   PORTFOLIO SECTION
   Premium Portfolio Showcase
   =========================== */

/* Section Container */
.portfolio-section {
  position: relative;
  background: var(--surface);
  padding: 120px 20px;
  overflow: hidden;
}

/* Professional color tokens for portfolio/testimonials */
:root {
  --gold: #d4af37;
  --card-bg: rgba(12,16,23,0.55); /* deep translucent background for cards */
  --card-border: rgba(255,255,255,0.04);
  --nav-border: rgba(202,162,58,0.22);
  --dot-bg: rgba(255,255,255,0.12);
  --dot-active-shadow: rgba(202,162,58,0.32);
}

.portfolio-wrapper {
  max-width: 1280px;
  margin: 0 auto;
}

/* Header (Badge, Title, Description) */
.portfolio-header {
  max-width: 800px;
  margin: 0 auto 48px;
  text-align: center;
}

.portfolio-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
  opacity: 0.9;
}

.portfolio-title {
  font-family: "Morabba", sans-serif;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin: 12px 0 24px;
  letter-spacing: -0.02em;
}

.portfolio-description {
  font-size: 16px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
}

/* Navigation Buttons Container */
.portfolio-nav-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 56px;
}

/* Slider Container */
.portfolio-slider-container {
  position: relative;
  margin: 56px 0 40px;
  overflow: hidden;
  border-radius: 24px;
}

.portfolio-slider-track {
  display: flex;
  align-items: stretch;
  gap: 24px;
  transform: translateX(0);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: visible;
  padding: 4px 0;
  will-change: transform;
}

/* Project Card */
.portfolio-card {
  position: relative;
  flex: 0 0 auto;
  width: var(--card-width, 100%);
  min-height: 320px;
  border-radius: 24px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  cursor: grab;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-user-select: none;
  user-select: none;
  display: flex;
  flex-direction: column;
}

/* Testimonials-specific overrides: reduce slide height for compact testimonials */
#testimonials .portfolio-card {
  min-height: 220px; /* default desktop testimonial height */
}

@media (max-width: 1024px) {
  #testimonials .portfolio-card {
    min-height: 200px;
  }
}

@media (max-width: 768px) {
  #testimonials .portfolio-card {
    min-height: 180px;
  }
}

@media (max-width: 640px) {
  #testimonials .portfolio-card {
    min-height: 160px;
  }
}

/* Force single-slide layout on mobile viewports */
@media (max-width: 767px) {
  .portfolio-slider-track {
    gap: 16px;
  }

  .portfolio-card {
    flex: 0 0 100% !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    border-radius: 16px;
  }

  .portfolio-slider-container {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* Testimonials color tweaks (override inline styles where needed) */
#testimonials {
  --testimonial-title: rgba(255,255,255,0.96);
  --testimonial-body: rgba(255,255,255,0.84);
  --testimonial-meta: rgba(255,255,255,0.72);
}

#testimonials .portfolio-card-title {
  color: var(--testimonial-title) !important;
}

#testimonials .portfolio-card-description {
  color: var(--testimonial-body) !important;
}

/* rating stars (some items had inline color) */
#testimonials .rating-stars {
  color: var(--gold) !important;
  font-size: 16px;
  line-height: 1;
}

/* rating number */
#testimonials .portfolio-card .text-white\/70 {
  color: var(--testimonial-meta) !important;
}

/* project label (override Tailwind-like classes) */
#testimonials p.project-label,
#testimonials p[class*="text-yellow-500"] {
  color: var(--gold) !important;
  font-weight: 600;
  font-size: 13px;
  margin: 0 !important;
}

/* avatar border tone */
#testimonials img {
  border-color: rgba(202,162,58,0.28) !important;
}

.portfolio-card:active {
  cursor: grabbing;
}

.portfolio-card:hover {
  transform: translateY(-10px);
  border-color: var(--nav-border);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.45),
              0 0 36px rgba(202,162,58,0.08);
}

.portfolio-card:hover .portfolio-card-image img {
  transform: scale(1.08);
  filter: blur(4px);
}

.portfolio-card:hover .portfolio-card-overlay {
  background: rgba(0, 0, 0, 0.5);
}

/* Hover State: Show Hidden Content */
/* Show tech badges by default (not hover-only) */

.portfolio-card:hover .portfolio-cta {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.35s;
  pointer-events: auto;
}

.portfolio-card:hover .portfolio-card-title {
  color: var(--gold);
}

.portfolio-card:hover .portfolio-card-description {
  color: rgba(255, 255, 255, 0.9);
}

/* Card Image */
.portfolio-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9; /* slightly wider ratio to reduce image height */
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
}

.portfolio-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.portfolio-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

/* Card Content */
.portfolio-card-content {
  display: flex;
  flex-direction: column;
  padding: 24px 20px; /* reduced padding to save vertical space */
  gap: 12px;
  height: calc(100% - calc(100% * 9 / 16));
}

.portfolio-card-title {
  font-family: "Morabba", sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin: 0;
  transition: all 0.4s ease;
  opacity: 1;
  transform: translateY(0);
}

.portfolio-card-description {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
  transition: all 0.4s ease;
  opacity: 1;
  transform: translateY(0);
}

/* Technology Badges - Hidden in Normal State */
.portfolio-tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  opacity: 1; /* visible by default */
  transform: none;
  transition: none;
  transition-delay: 0ms;
  pointer-events: auto;
}

/* Purpose block inside card */
.portfolio-purpose {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  padding: 12px 14px;
  border-radius: 10px;
  margin-top: 6px;
  transition: transform 0.28s ease, box-shadow 0.28s ease, background 0.28s ease;
}

.portfolio-purpose-title {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  font-weight: 700;
  margin-bottom: 6px;
}

.portfolio-purpose-text {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  margin: 0 0 8px 0;
}

.portfolio-purpose-tags {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.purpose-tag{
  display:inline-block;
  padding:6px 10px;
  font-size:12px;
  color: rgba(255,255,255,0.9);
  background: rgba(212,175,55,0.08);
  border:1px solid rgba(212,175,55,0.12);
  border-radius:8px;
}

/* Hover effect for purpose block */
.portfolio-card:hover .portfolio-purpose{
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.45), 0 0 24px rgba(212,175,55,0.06) inset;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
}

.portfolio-badge-tech {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 16px;
  border: 1.5px solid rgba(212, 175, 55, 0.3);
  background: rgba(212, 175, 55, 0.08);
  font-size: 12px;
  font-weight: 600;
  color: rgba(212, 175, 55, 0.9);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.portfolio-badge-tech:hover {
  border-color: rgba(212, 175, 55, 0.6);
  background: rgba(212, 175, 55, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.15);
}

/* CTA Button - Hidden in Normal State */
.portfolio-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px; /* uniform padding on all sides */
  font-size: 14px;
  font-weight: 600;
  font-family: "Dana", sans-serif;
  color: #ffffff; /* white text */
  background: var(--gold); /* solid gold background */
  border: 1.5px solid var(--gold);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  margin-top: auto;
  align-self: flex-start;
  opacity: 0;
  transform: translateY(20px);
  transition-delay: 0ms;
  pointer-events: none;
}

.portfolio-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
              rgba(212, 175, 55, 0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.portfolio-cta:hover {
  border-color: rgba(212, 175, 55, 0.95);
  background: linear-gradient(180deg, rgba(212,175,55,1) 0%, rgba(212,175,55,0.92) 100%);
  box-shadow: 0 6px 24px rgba(212, 175, 55, 0.18);
  transform: translateY(-2px);
}

.portfolio-cta:hover::before {
  opacity: 1;
}

.portfolio-cta:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.portfolio-cta span {
  transition: transform 0.4s ease;
}

.portfolio-cta:hover span:last-child {
  transform: translateX(-3px);
}

/* hide icon / arrow inside CTA if present */
.portfolio-cta span:last-child {
  display: none;
}

/* Controls Container */
.portfolio-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 48px;
}

/* Pagination Dots */
.portfolio-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.portfolio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(212, 175, 55, 0.2);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.portfolio-dot.active {
  width: 32px;
  border-radius: 4px;
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 20px var(--dot-active-shadow);
}

.portfolio-dot:hover:not(.active) {
  background: rgba(255, 255, 255, 0.4);
  border-color: rgba(212, 175, 55, 0.5);
}

/* Navigation Buttons */
.portfolio-nav-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--nav-border);
  background: rgba(255,255,255,0.02);
  color: var(--gold);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  font-size: 18px;
  overflow: hidden;
}

.portfolio-nav-button::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.portfolio-nav-button:hover {
  border-color: rgba(212, 175, 55, 0.7);
  background: rgba(212, 175, 55, 0.1);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.25);
  transform: scale(1.05);
}

.portfolio-nav-button:hover::before {
  opacity: 1;
}

.portfolio-nav-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: rgba(212, 175, 55, 0.15);
}

.portfolio-nav-button:disabled:hover {
  transform: scale(1);
  box-shadow: none;
  background: transparent;
}

.portfolio-nav-button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.portfolio-card {
  animation: fadeInUp 0.6s ease both;
}

.portfolio-card:nth-child(1) { animation-delay: 0s; }
.portfolio-card:nth-child(2) { animation-delay: 0.1s; }
.portfolio-card:nth-child(3) { animation-delay: 0.2s; }
.portfolio-card:nth-child(4) { animation-delay: 0.3s; }
.portfolio-card:nth-child(5) { animation-delay: 0.4s; }
.portfolio-card:nth-child(6) { animation-delay: 0.5s; }

/* Responsive Design */
@media (max-width: 1279px) {
  .portfolio-slider-track {
    gap: 20px;
  }

  .portfolio-card {
    min-height: 380px;
  }

  .portfolio-card-content {
    padding: 28px 24px;
  }

  .portfolio-card-title {
    font-size: 20px;
  }
}

@media (max-width: 1023px) {
  .portfolio-section {
    padding: 80px 16px;
  }

  .portfolio-header {
    margin-bottom: 32px;
  }

  .portfolio-title {
    font-size: 28px;
  }

  .portfolio-description {
    font-size: 15px;
  }

  .portfolio-nav-buttons {
    margin-bottom: 40px;
  }

  .portfolio-slider-track {
    gap: 16px;
  }

  .portfolio-card {
    min-height: 360px;
  }

  .portfolio-card-content {
    padding: 24px 20px;
    gap: 12px;
  }

  .portfolio-card-title {
    font-size: 18px;
  }

  .portfolio-card-description {
    font-size: 13px;
  }

  .portfolio-controls {
    gap: 16px;
  }

  .portfolio-nav-button {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }
}

@media (max-width: 767px) {
  .portfolio-section {
    padding: 60px 12px;
  }

  .portfolio-header {
    margin-bottom: 28px;
  }

  .portfolio-title {
    font-size: 24px;
  }

  .portfolio-nav-buttons {
    margin-bottom: 32px;
    gap: 12px;
  }

  .portfolio-slider-container {
    margin: 40px 0 32px;
  }

  .portfolio-card {
    min-height: 340px;
    border-radius: 20px;
  }

  .portfolio-card-content {
    padding: 20px 16px;
  }

  .portfolio-card-image {
    aspect-ratio: 1 / 1;
  }

  .portfolio-badge-tech {
    font-size: 11px;
    padding: 5px 10px;
  }

  .portfolio-pagination {
    gap: 6px;
  }

  .portfolio-dot {
    width: 6px;
    height: 6px;
  }

  .portfolio-dot.active {
    width: 24px;
  }

  .portfolio-nav-button {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  /* Mobile: show CTA by default (no hover required) */
  .portfolio-cta {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
    margin-top: 12px;
  }

  /* Prevent hover blur effect on touch devices */
  .portfolio-card:hover .portfolio-card-image img {
    transform: none;
    filter: none;
  }
}
/* Tablet: also show CTA by default on touch/tablet sizes up to 1024px */
@media (max-width: 1024px) and (min-width: 641px) {
  .portfolio-cta {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
    margin-top: 12px;
  }

  /* Disable hover blur for tablet/touch devices */
  .portfolio-card:hover .portfolio-card-image img {
    transform: none !important;
    filter: none !important;
  }
}


/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .portfolio-card,
  .portfolio-card-image img,
  .portfolio-card-title,
  .portfolio-card-description,
  .portfolio-nav-button,
  .portfolio-dot {
    transition: none;
    animation: none;
  }
}
