/* ==========================================================================
   PROJECTS SECTION - ULTRA MODERN WOW PORTFOLIO
   ========================================================================== */
.projects {
  position: relative;
  overflow: hidden;
}

.projects-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.projects-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 30% 20%, rgba(255, 154, 46, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(26, 109, 212, 0.04) 0%, transparent 50%);
}

.projects-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(26, 109, 212, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 109, 212, 0.015) 1px, transparent 1px);
  background-size: 50px 50px;
}

.projects-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}

.projects-blob-1 {
  top: -10%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 154, 46, 0.06) 0%, transparent 70%);
  animation: projects-float 16s ease-in-out infinite;
}

.projects-blob-2 {
  bottom: -15%;
  right: -8%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(26, 109, 212, 0.05) 0%, transparent 70%);
  animation: projects-float 20s ease-in-out infinite reverse;
}

@keyframes projects-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(25px, -25px) scale(1.05); }
}

/* ─── Section Badge ─── */
.projects-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 7px 20px;
  border-radius: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px var(--accent-glow);
}

/* ─── Tab Bar ─── */
.project-tabs {
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px 16px 0 0;
  margin-bottom: 0;
  overflow: visible;
  position: relative;
  z-index: 2;
  box-shadow:
    0 8px 32px rgba(26, 39, 68, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  animation: tab-bar-enter 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tab-bar-enter {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.project-tab {
  background: transparent;
  border: none;
  color: #64748b;
  padding: 18px 28px;
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  position: relative;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 12px;
  margin: 6px;
}

.project-tab:nth-child(1) { animation: tab-enter 0.5s 0.1s both ease-out; }
.project-tab:nth-child(2) { animation: tab-enter 0.5s 0.2s both ease-out; }
.project-tab:nth-child(3) { animation: tab-enter 0.5s 0.3s both ease-out; }
.project-tab:nth-child(4) { animation: tab-enter 0.5s 0.4s both ease-out; }

@keyframes tab-enter {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.project-tab.active {
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.project-tab.active::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 25%,
    rgba(255, 255, 255, 0.25) 40%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(255, 255, 255, 0.25) 60%,
    transparent 75%
  );
  background-size: 300% 100%;
  animation: tab-shine 3s ease-in-out infinite;
  pointer-events: none;
  border-radius: inherit;
  mix-blend-mode: screen;
}

@keyframes tab-shine {
  0% { background-position: 300% 0; }
  50% { background-position: -100% 0; }
  100% { background-position: -100% 0; }
}

.project-tab i {
  font-size: 1.2rem;
  opacity: 0.5;
  transition: all 0.4s ease;
}

.project-tab:hover {
  color: #0f172a;
}

.project-tab:hover i {
  opacity: 0.8;
  transform: scale(1.1);
}

.project-tab[data-tab="custom"].active {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
  box-shadow: 0 4px 16px rgba(255, 107, 0, 0.35);
}
.project-tab[data-tab="custom"].active i { color: #fff; opacity: 1; }

.project-tab[data-tab="pemasangan"].active {
  background: var(--accent-blue-gradient);
  box-shadow: 0 4px 16px var(--accent-blue-glow);
}
.project-tab[data-tab="pemasangan"].active i { color: #fff; opacity: 1; }

.project-tab[data-tab="perawatan"].active {
  background: linear-gradient(135deg, var(--accent-green), var(--accent-green-dark));
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}
.project-tab[data-tab="perawatan"].active i { color: #fff; opacity: 1; }

.project-tab[data-tab="sukucadang"].active {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-dark));
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
}
.project-tab[data-tab="sukucadang"].active i { color: #fff; opacity: 1; }

/* ─── Content Pane ─── */
.project-tab-content {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(26, 109, 212, 0.06);
  border-top: none;
  border-radius: 0 0 20px 20px;
  padding: 36px 28px;
  position: relative;
  z-index: 2;
  box-shadow:
    0 15px 40px rgba(26, 39, 68, 0.03),
    0 1px 4px rgba(26, 39, 68, 0.02);
}

.project-tab-content .tab-pane {
  display: none;
}

.project-tab-content .tab-pane.active {
  display: block;
  animation: fadeInPane 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInPane {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Grid ─── */
.box-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* ─── Card ─── */
.box-container .box {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  display: block;
  background-color: #030a16;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
  aspect-ratio: 4/3;
  box-shadow:
    0 4px 20px rgba(26, 39, 68, 0.03),
    0 1px 4px rgba(26, 39, 68, 0.02);
}

/* Gradient border ring on hover */
.box-container .box::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 19px;
  background: conic-gradient(
    from 0deg at 50% 50%,
    transparent 0deg,
    rgba(255, 154, 46, 0.25) 90deg,
    rgba(255, 106, 0, 0.15) 180deg,
    rgba(26, 109, 212, 0.2) 270deg,
    transparent 360deg
  );
  opacity: 0;
  transition: opacity 0.6s ease;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 1.5px;
  animation: project-conic-rotate 3s linear infinite;
  pointer-events: none;
  z-index: 5;
}

@keyframes project-conic-rotate {
  to { transform: rotate(360deg); }
}

.box-container .box:hover::before {
  opacity: 1;
}

.box-container .box:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow:
    0 24px 50px rgba(26, 39, 68, 0.1),
    0 8px 20px rgba(26, 39, 68, 0.06);
}

/* Image */
.box-container .box .image {
  width: 100%;
  height: 100%;
}

.box-container .box .image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.box-container .box:hover .image img {
  transform: scale(1.08);
}

/* ─── Category Badge ─── */
.box-container .box > .category-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 5px 12px;
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-radius: 6px;
  color: #fff;
  z-index: 10;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  transition: all 0.4s ease;
  opacity: 1;
  transform: translateY(0);
}

.box-container .box:hover > .category-badge {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

#custom .box > .category-badge {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
}

#pemasangan .box > .category-badge {
  background: var(--accent-blue-gradient);
}

#perawatan .box > .category-badge {
  background: linear-gradient(135deg, var(--accent-green), var(--accent-green-dark));
}

#sukucadang .box > .category-badge {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-dark));
}

/* ─── Overlay ─── */
.box-container .box .content {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(3, 10, 22, 0.92) 0%,
    rgba(3, 10, 22, 0.25) 55%,
    rgba(3, 10, 22, 0) 100%
  );
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 22px 22px 26px;
  z-index: 2;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.box-container .box:hover .content {
  background: linear-gradient(
    to top,
    rgba(3, 10, 22, 0.97) 0%,
    rgba(3, 10, 22, 0.35) 55%,
    rgba(3, 10, 22, 0) 100%
  );
  padding-bottom: 30px;
}

/* ─── Info ─── */
.box-container .box .info h3 {
  font-size: 1.7rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  font-family: var(--font-title);
  letter-spacing: -0.01em;
  transition: all 0.4s ease;
}

.box-container .box:hover .info h3 {
  transform: translateY(-2px);
}

.box-container .box .info p {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  transition: all 0.4s ease;
}

.box-container .box:hover .info p {
  color: rgba(255, 255, 255, 0.9);
}

/* ─── Plus Button ─── */
.box-container .box .content i {
  width: 42px;
  height: 42px;
  background: var(--accent-gradient);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 12px var(--accent-glow);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  transform: scale(0.9);
  flex-shrink: 0;
}

.box-container .box:hover .content i {
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 8px 24px var(--accent-glow);
}

/* ─── CTA ─── */
.projects .text-center {
  position: relative;
  z-index: 2;
  margin-top: 36px;
}

.projects .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent-gradient);
  color: #fff;
  padding: 14px 34px;
  border-radius: 50px;
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.projects .btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px var(--accent-glow);
}

.projects .btn-primary i {
  transition: transform 0.4s ease;
}

.projects .btn-primary:hover i {
  transform: translateX(6px);
}

/* ─── Responsive ─── */
@media (max-width: 991px) {
  .box-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .project-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .project-tabs::-webkit-scrollbar {
    display: none;
  }

  .project-tab {
    flex: 0 0 auto;
    padding: 12px 16px;
    font-size: 1.25rem;
    gap: 8px;
    margin: 4px;
  }

  .project-tab i {
    font-size: 1rem;
  }

  .project-tab-content {
    padding: 24px 14px;
  }

  .box-container {
    gap: 16px;
  }

  .box-container .box > .category-badge {
    top: 10px;
    left: 10px;
    font-size: 0.85rem;
    padding: 3px 10px;
  }

  .box-container .box .content {
    padding: 16px 16px 20px;
  }

  .box-container .box .info h3 {
    font-size: 1.5rem;
  }

  .box-container .box .info p {
    font-size: 1.15rem;
  }

  .box-container .box .content i {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
}

@media (max-width: 575px) {
  .box-container {
    grid-template-columns: 1fr;
  }
}
