/* PORTFOLIO GRID & CARDS */

.portfolio-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}

.project-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-thumb img {
  transform: scale(1.08);
}

.project-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-visits {
  font-size: 0.8rem;
  color: var(--primary-glow);
  background: rgba(59, 130, 246, 0.1);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-weight: 700;
}

.project-genre {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1.2rem;
}

/* === GLASS MODAL === */

.project-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 8, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 3000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.project-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.project-modal-content {
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  position: relative;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(20px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  padding: 0;
}

.project-modal-overlay.open .project-modal-content {
  transform: scale(1) translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 10;
  transition: color 0.3s ease;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
}

.modal-img-wrapper {
  background: #000;
}

.modal-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.modal-info {
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding-right: 1rem;
}

/* Custom Scrollbar for Modal */
.modal-scroll-area::-webkit-scrollbar {
  width: 6px;
}

.modal-scroll-area::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

.modal-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.modal-subheading {
  font-size: 0.9rem;
  color: var(--primary-glow);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.8rem;
  font-weight: 700;
}

.modal-p-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.modal-list {
  list-style: none;
  padding: 0;
}

.modal-list li {
  color: var(--text-main);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.8rem;
  padding-left: 1.5rem;
  position: relative;
}

.modal-list li::before {
  content: "▹";
  color: var(--primary);
  position: absolute;
  left: 0;
  top: 0;
  font-size: 1.2rem;
}

/* === MARQUEE CONVEYER BELT (Home Page) === */

.view-all-link {
  color: var(--primary-glow);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.view-all-link:hover {
  color: #fff;
  transform: translateX(4px);
}

.marquee-track-container {
  width: 100%;
  overflow: hidden;
  position: relative;
  /* fade out edges slightly */
  mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  padding: 1rem 0 3rem;
}

.marquee-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  animation: scrollMarquee 45s linear infinite;
}

.marquee-track.track-reverse {
  animation: scrollMarqueeReverse 45s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused !important;
  /* Smooth individual hover stop */
}

@keyframes scrollMarquee {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }

  /* Animates half way (over duplicated items) */
}

@keyframes scrollMarqueeReverse {
  0% {
    transform: translateX(-50%);
  }

  100% {
    transform: translateX(0);
  }
}

.marquee-track .project-card {
  width: 320px;
  flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.marquee-track .project-card:hover {
  transform: scale(1.03);
}

/* Mobile Adjustments */
@media (max-width: 900px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .project-card-content {
    padding: 1rem;
  }

  .project-title {
    font-size: 1.1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .project-btn-mobile {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  .marquee-track-container {
    mask-image: none;
    -webkit-mask-image: none;
  }

  .modal-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
    /* Scroll the whole modal on mobile */
  }

  .modal-img-wrapper {
    height: 250px;
  }

  .modal-info {
    padding: 2rem 1.5rem;
    max-height: none;
    /* Let it stretch */
  }

  .modal-scroll-area {
    overflow-y: visible;
    /* Disable inner scroll on mobile */
  }
}

/* === PAGINATION === */
.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.page-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}