/* ========================================
   NEXUS DIGITAL - PORTFOLIO PAGE STYLES
   ======================================== */

/* ========================================
   PORTFOLIO HERO
   ======================================== */

.portfolio-hero {
  padding: 160px 0 80px;
  background: var(--color-black);
  text-align: center;
}

.portfolio-hero-title {
  font-size: clamp(40px, 8vw, 72px);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 24px;
}

.portfolio-hero-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: rgba(255, 255, 255, 0.6);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ========================================
   FILTER BAR
   ======================================== */

.filter-section {
  padding: 0 0 10px;
  background: var(--color-black);
  position: sticky;
  top: 70px;
  z-index: 100;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding: 16px;
  background: rgba(26, 26, 26, 0.8);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid var(--color-border);
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  border-color: var(--color-orange);
  color: white;
}

.filter-btn.active {
  background: var(--color-orange);
  border-color: var(--color-orange);
  color: white;
}

.filter-btn svg {
  width: 18px;
  height: 18px;
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

.filter-btn.active .filter-count {
  background: rgba(255, 255, 255, 0.2);
}

/* ========================================
   PROJECTS GRID
   ======================================== */

.projects-section {
  padding: 0 0 120px;
  background: var(--color-black);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 40px;
}

@media (min-width: 768px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Project Card */
.project-card {
  background: var(--color-dark-gray);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  overflow: hidden;
  transition: all 0.5s var(--ease-expo-out);
  opacity: 1;
  transform: translateY(0);
}

.project-card.hidden {
  display: none;
}

.project-card:hover {
  border-color: rgba(255, 107, 53, 0.3);
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* Project Preview */
.project-preview {
  position: relative;
  height: 320px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
}

.website-preview {
  height: 240px;
}

.project-screens {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.screen-main,
.screen-secondary,
.screen-tertiary {
  position: absolute;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transition: all 0.5s var(--ease-expo-out);
}

/* Mobile App Screens Layout */
.project-card[data-category="mobile"] .screen-main {
  width: 160px;
  height: auto;
  aspect-ratio: 9/16;
  z-index: 3;
  transform: translateX(-20px);
}

.project-card[data-category="mobile"] .screen-secondary {
  width: 120px;
  height: auto;
  aspect-ratio: 9/16;
  z-index: 2;
  transform: translateX(60px) translateY(-20px);
  opacity: 0.7;
}

.project-card[data-category="mobile"] .screen-tertiary {
  width: 100px;
  height: auto;
  aspect-ratio: 9/16;
  z-index: 1;
  transform: translateX(100px) translateY(-40px);
  opacity: 0.4;
}

/* Website Screens Layout */
.project-card[data-category="website"] .screen-main {
  width: 280px;
  height: auto;
  aspect-ratio: 16/9;
  z-index: 3;
  transform: translateX(-30px);
}

.project-card[data-category="website"] .screen-secondary {
  width: 200px;
  height: auto;
  aspect-ratio: 16/9;
  z-index: 2;
  transform: translateX(80px) translateY(-15px);
  opacity: 0.7;
}

.project-card[data-category="website"] .screen-tertiary {
  width: 160px;
  height: auto;
  aspect-ratio: 16/9;
  z-index: 1;
  transform: translateX(130px) translateY(-30px);
  opacity: 0.4;
}

/* Hover Effects on Screens */
.project-card:hover .screen-main {
  transform: translateX(-30px) scale(1.05);
}

.project-card:hover .screen-secondary {
  transform: translateX(70px) translateY(-25px) scale(1.02);
  opacity: 0.9;
}

.project-card:hover .screen-tertiary {
  transform: translateX(110px) translateY(-50px) scale(1.01);
  opacity: 0.6;
}

/* Project Overlay */
.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.view-project-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--color-orange);
  border: none;
  border-radius: 100px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.4s var(--ease-expo-out);
}

.project-card:hover .view-project-btn {
  transform: translateY(0);
  opacity: 1;
}

.view-project-btn:hover {
  background: var(--color-orange-light);
  box-shadow: 0 0 30px rgba(255, 107, 53, 0.4);
}

/* Project Info */
.project-info {
  padding: 28px;
}

.project-header {
  margin-bottom: 16px;
}

.project-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.mobile-badge {
  background: rgba(57, 255, 20, 0.15);
  color: #39ff14;
  border: 1px solid rgba(57, 255, 20, 0.3);
}

.website-badge {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.project-title {
  font-size: 24px;
  font-weight: 700;
  color: white;
  margin: 0;
}

.project-description {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.7;
  margin-bottom: 20px;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tech .tech-tag {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
}

.project-card:hover .project-tech .tech-tag {
  border-color: rgba(255, 107, 53, 0.3);
  color: rgba(255, 255, 255, 0.9);
}

/* ========================================
   PROJECT MODAL
   ======================================== */

.project-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}

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

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  background: var(--color-dark);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.4s var(--ease-expo-out);
}

.project-modal.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: var(--color-orange);
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr;
  max-height: 90vh;
  overflow-y: auto;
}

@media (min-width: 1024px) {
  .modal-body {
    grid-template-columns: 1.2fr 1fr;
  }
}

/* Modal Gallery */
.modal-gallery {
  background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 100%);
  padding: 40px;
}

.gallery-main {
  position: relative;
  margin-bottom: 20px;
}

.gallery-main img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-nav:hover {
  background: var(--color-orange);
  border-color: var(--color-orange);
}

.gallery-nav.prev {
  left: -24px;
}

.gallery-nav.next {
  right: -24px;
}

.gallery-thumbs {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.gallery-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumb:hover,
.gallery-thumb.active {
  border-color: var(--color-orange);
}

/* Modal Info */
.modal-info {
  padding: 40px;
  overflow-y: auto;
}

.modal-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 32px;
  font-weight: 700;
  color: white;
  margin-bottom: 16px;
}

.modal-description {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  margin-bottom: 32px;
}

.modal-section {
  margin-bottom: 28px;
}

.modal-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.modal-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-tech span {
  padding: 8px 16px;
  background: rgba(255, 107, 53, 0.1);
  border: 1px solid rgba(255, 107, 53, 0.3);
  border-radius: 100px;
  font-size: 13px;
  color: var(--color-orange);
}

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

.modal-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  border-bottom: 1px solid var(--color-border);
}

.modal-features li:last-child {
  border-bottom: none;
}

.modal-features li::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--color-orange);
  border-radius: 50%;
  margin-top: 8px;
  flex-shrink: 0;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

.modal-actions .btn {
  flex: 1;
}

/* ========================================
   PORTFOLIO CTA
   ======================================== */

.portfolio-cta {
  padding: 100px 0;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, transparent 50%);
  border-top: 1px solid var(--color-border);
}

.portfolio-cta .cta-content {
  text-align: center;
}

.portfolio-cta h2 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  color: white;
  margin-bottom: 16px;
}

.portfolio-cta p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.6);
  max-width: 500px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Filter Animation */
.project-card {
  animation: fadeInUp 0.6s var(--ease-expo-out) forwards;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }

/* Filter Transition */
.project-card.filtering-out {
  animation: fadeOut 0.3s ease forwards;
}

.project-card.filtering-in {
  animation: fadeInUp 0.5s var(--ease-expo-out) forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1023px) {
  .filter-section {
    top: 60px;
  }
  
  .modal-content {
    max-height: 95vh;
  }
  
  .modal-gallery {
    padding: 24px;
  }
  
  .modal-info {
    padding: 24px;
  }
  
  .gallery-nav.prev {
    left: 10px;
  }
  
  .gallery-nav.next {
    right: 10px;
  }
  
  .modal-actions {
    flex-direction: column;
  }
}

@media (max-width: 767px) {
  .portfolio-hero {
    padding: 120px 0 60px;
  }
  
  .filter-bar {
    padding: 12px;
    gap: 8px;
  }
  
  .filter-btn {
    padding: 10px 16px;
    font-size: 13px;
  }
  
  .filter-btn span:not(.filter-count) {
    display: none;
  }
  
  .project-preview {
    height: 260px;
  }
  
  .website-preview {
    height: 180px;
  }
  
  .project-card[data-category="mobile"] .screen-main {
    width: 120px;
  }
  
  .project-card[data-category="mobile"] .screen-secondary {
    width: 90px;
    transform: translateX(50px) translateY(-15px);
  }
  
  .project-card[data-category="mobile"] .screen-tertiary {
    width: 75px;
    transform: translateX(85px) translateY(-30px);
  }
  
  .project-card[data-category="website"] .screen-main {
    width: 200px;
  }
  
  .project-card[data-category="website"] .screen-secondary {
    width: 140px;
    transform: translateX(60px) translateY(-10px);
  }
  
  .project-card[data-category="website"] .screen-tertiary {
    width: 110px;
    transform: translateX(100px) translateY(-20px);
  }
  
  .project-info {
    padding: 20px;
  }
  
  .project-title {
    font-size: 20px;
  }
  
  .modal-title {
    font-size: 24px;
  }
  
  .gallery-nav {
    width: 40px;
    height: 40px;
  }
  
  .gallery-thumb {
    width: 60px;
    height: 60px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .project-card,
  .screen-main,
  .screen-secondary,
  .screen-tertiary,
  .project-overlay,
  .view-project-btn,
  .modal-content {
    animation: none !important;
    transition: none !important;
  }
}

/* =========================
   PROJECT MODAL BACKDROP
========================= */
.project-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-modal.active {
  display: flex;
  opacity: 1;
}


/* =========================
   MODAL CONTENT CONTAINER
========================= */
.modal-content {
  position: relative;
  width: 100%;
  max-width: 1000px;
  background: #111;
  border-radius: 16px;
  padding: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}


/* =========================
   IMAGE WRAPPER
========================= */
.modal-carousel {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-carousel img {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
}


/* =========================
   NAVIGATION BUTTONS
========================= */
.modal-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 20;
}

.modal-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

.modal-btn.prev {
  left: 15px;
}

.modal-btn.next {
  right: 15px;
}


/* =========================
   CLOSE BUTTON
========================= */
.close-modal {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 28px;
  color: #fff;
  cursor: pointer;
  z-index: 30;
  transition: 0.3s ease;
}

.close-modal:hover {
  color: #ccc;
}


/* =========================
   RESPONSIVE DESIGN
========================= */
@media (max-width: 768px) {

  .modal-content {
    padding: 15px;
  }

  .modal-carousel img {
    max-height: 70vh;
  }

  .modal-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .modal-btn.prev {
    left: 8px;
  }

  .modal-btn.next {
    right: 8px;
  }

  .close-modal {
    font-size: 24px;
    top: 8px;
    right: 12px;
  }
}


