/* ========== PORTFOLIO GALLERY (portfolio.html) ========== */

/* ---- Category navigation (tabs on desktop, hamburger dropdown on mobile) ---- */

.portfolio-nav {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 50px;
}

.category-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-light);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.category-toggle:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.portfolio-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

.portfolio-tab {
  padding: 12px 26px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.portfolio-tab:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.portfolio-tab.active {
  background: var(--brand-primary);
  color: #050816;
  box-shadow: 0 0 20px var(--brand-glow);
}

@media (max-width: 640px) {
  .category-toggle {
    display: flex;
  }
  .portfolio-tabs {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column;
    background: rgba(5, 8, 22, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 12px;
    gap: 8px;
    z-index: 60;
    width: min(280px, 82vw);
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  }
  .portfolio-tabs.open {
    display: flex;
  }
  .portfolio-tab {
    width: 100%;
    text-align: center;
  }
}

/* ---- Empty state ---- */

.portfolio-empty {
  text-align: center;
  padding: 90px 20px;
  color: var(--text-muted);
}

.portfolio-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 14px;
}

.portfolio-empty-sub {
  font-size: 0.85rem;
  margin-top: 6px;
  opacity: 0.7;
}

/* ---- 3D carousel ---- */

.carousel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 700px;
  margin: 0 auto;
}

.carousel-stage {
  position: relative;
  width: 100%;
  min-height: 420px;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1400px;
  touch-action: pan-y;
}

.carousel-box {
  position: relative;
  width: 300px;
  height: 300px;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.22, 0.9, 0.3, 1);
}

.carousel-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 25px rgba(0, 212, 255, 0.12);
  cursor: pointer;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.carousel-item:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 0 35px var(--brand-glow);
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  box-sizing: border-box;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.carousel-zoom-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent 55%);
  opacity: 0;
  transition: opacity 0.3s ease;
  font-size: 1.1rem;
}

.carousel-item:hover .carousel-zoom-hint {
  opacity: 1;
}

.carousel-caption {
  text-align: center;
  margin-top: 26px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-light);
  min-height: 1.4em;
}

.carousel-counter {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 4px;
}

.carousel-nav {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin-top: 24px;
}

.carousel-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: white;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.carousel-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: rgba(0, 212, 255, 0.1);
}

.carousel-btn:active {
  transform: scale(0.92);
}

/* Single-sample view (no ring needed) */
.carousel-single .carousel-stage {
  min-height: 360px;
}
.carousel-single .carousel-item {
  position: relative;
  width: 340px;
  height: 340px;
}

@media (max-width: 640px) {
  .carousel-stage {
    min-height: 300px;
    perspective: 1000px;
  }
  .carousel-box {
    width: 230px;
    height: 230px;
  }
  .carousel-item img {
    padding: 10px;
  }
  .carousel-single .carousel-stage {
    min-height: 260px;
  }
  .carousel-single .carousel-item {
    width: 240px;
    height: 240px;
  }
  .carousel-btn {
    width: 46px;
    height: 46px;
    font-size: 1.25rem;
  }
  .carousel-nav {
    gap: 20px;
  }
}

/* ---- Lightbox ---- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 12, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 40px;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 75vh;
  border-radius: 16px;
  box-shadow: 0 0 50px rgba(0, 212, 255, 0.2);
}

.lightbox-caption {
  color: var(--text-light);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.lightbox-close:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.lightbox-nav:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: rgba(0, 212, 255, 0.1);
}

#lightboxPrev { left: 24px; }
#lightboxNext { right: 24px; }

@media (max-width: 768px) {
  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
  #lightboxPrev { left: 10px; }
  #lightboxNext { right: 10px; }
}
