/* ========== GLOBAL FIX FOR HORIZONTAL SCROLL ========== */
body {
  overflow-x: hidden;
  width: 100%;
}

html {
  overflow-x: hidden;
  width: 100%;
}

/* ========== PORTFOLIO SECTION ========== */

.portfolio-section {
  background: #ffffff;
  padding-top: 100px;
  padding-bottom: 100px;
  position: relative;
  overflow-x: hidden;
}

.portfolio-section .container {
  overflow-x: hidden;
}

.portfolio-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(to bottom, #f8f9fa 0%, transparent 100%);
  pointer-events: none;
}

/* ========== FILTER TABS ========== */

.filter-tabs {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.filter-btn {
  padding: 12px 28px;
  background: #ffffff;
  color: #555;
  border: 2px solid #e0e0e0;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: capitalize;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-btn:hover {
  border-color: #ff6a00;
  color: #ff6a00;
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.15);
}

.filter-btn.active {
  background: linear-gradient(135deg, #ff6a00, #ff8533);
  border-color: #ff6a00;
  color: white;
  box-shadow: 0 6px 20px rgba(255, 106, 0, 0.3);
  transform: translateY(-3px);
}

/* ========== PORTFOLIO GRID ========== */

.portfolio-grid {
  margin-top: 60px;
}

.portfolio-item {
  opacity: 1;
  transition: all 0.3s ease;
}

/* ========== PORTFOLIO CARDS ========== */

.portfolio-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border: 1px solid #f0f0f0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.portfolio-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #ff6a00, #ff8533);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
  z-index: 2;
}

.portfolio-card:hover::before {
  transform: scaleX(1);
}

.portfolio-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  border-color: rgba(255, 106, 0, 0.1);
}

.portfolio-card.featured {
  background: linear-gradient(135deg, #fff8f5 0%, #ffffff 100%);
  border: 2px solid rgba(255, 106, 0, 0.2);
  box-shadow: 0 8px 24px rgba(255, 106, 0, 0.15);
}

.featured-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: linear-gradient(135deg, #ff6a00, #ff8533);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 3;
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.3);
}

/* ========== CARD IMAGE ========== */

.card-img-wrapper {
  position: relative;
  height: 240px;
  overflow: hidden;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portfolio-card:hover .card-img-wrapper img {
  transform: scale(1.08);
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 106, 0, 0.95) 0%,
    rgba(255, 133, 51, 0.95) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.portfolio-card:hover .card-overlay {
  opacity: 1;
}

.btn-view-details {
  padding: 14px 36px;
  background: #ffffff;
  color: #ff6a00;
  border: 2px solid #ffffff;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transform: translateY(10px);
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.portfolio-card:hover .btn-view-details {
  transform: translateY(0);
}

.btn-view-details:hover {
  background: #ff6a00;
  color: #ffffff;
  border-color: #ff6a00;
  box-shadow: 0 6px 20px rgba(255, 106, 0, 0.4);
}

/* ========== CARD BODY ========== */

.portfolio-card .card-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.badge-primary {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(135deg, #ff6a00, #ff8533);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(255, 106, 0, 0.2);
}

.badge-secondary {
  display: inline-block;
  padding: 6px 14px;
  background: #6c757d;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.portfolio-card .card-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 12px;
  line-height: 1.4;
  transition: color 0.3s ease;
}

.portfolio-card:hover .card-title {
  color: #ff6a00;
}

.portfolio-card .card-text {
  font-size: 14px;
  color: #666;
  line-height: 1.7;
  margin-bottom: 20px;
  flex: 1;
}

/* ========== TECH STACK ========== */

.tech-stack {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
  margin-top: auto;
}

.tech-tag {
  padding: 6px 12px;
  background: #f8f9fa;
  color: #555;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
}

.portfolio-card:hover .tech-tag {
  background: rgba(255, 106, 0, 0.08);
  border-color: rgba(255, 106, 0, 0.2);
  color: #ff6a00;
}

/* ========== REVEAL ANIMATIONS ========== */

.revealY {
  position: relative;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.8s ease;
}

.revealY.active {
  transform: translateY(0);
  opacity: 1;
}

.revealX {
  position: relative;
  transform: translateX(-80px);
  opacity: 0;
  transition: all 0.8s ease;
}

.revealX.active {
  transform: translateX(0);
  opacity: 1;
}

/* Staggered animation delay */
.portfolio-item:nth-child(1) {
  transition-delay: 0.1s;
}
.portfolio-item:nth-child(2) {
  transition-delay: 0.2s;
}
.portfolio-item:nth-child(3) {
  transition-delay: 0.3s;
}
.portfolio-item:nth-child(4) {
  transition-delay: 0.4s;
}
.portfolio-item:nth-child(5) {
  transition-delay: 0.5s;
}
.portfolio-item:nth-child(6) {
  transition-delay: 0.6s;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
======================================== */

/* Large Desktops (1920px and above) */
@media (min-width: 1920px) {
  .portfolio-section {
    padding-top: 70px;
    padding-bottom: 70px;
  }

  .filter-tabs {
    gap: 12px;
  }

  .filter-btn {
    font-size: 14px;
    padding: 10px 22px;
  }

  .card-img-wrapper {
    height: 200px;
  }

  .portfolio-card .card-body {
    padding: 24px;
  }

  .portfolio-card .card-title {
    font-size: 19px;
  }
}

/* Tablets and Small Laptops (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
  .portfolio-section {
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .filter-btn {
    font-size: 14px;
    padding: 11px 24px;
  }

  .card-img-wrapper {
    height: 220px;
  }

  .portfolio-card .card-body {
    padding: 24px;
  }

  .portfolio-card .card-title {
    font-size: 19px;
  }
}

/* Tablets Portrait (768px - 991px) - FIX HORIZONTAL SCROLL */
@media (max-width: 991px) {
  /* Disable horizontal scroll animations */
  .revealX {
    transform: translateY(60px) translateX(0) !important;
    opacity: 0;
  }

  .revealX.active {
    transform: translateY(0) translateX(0) !important;
    opacity: 1;
  }
}

/* Mobile Landscape & Large Phones (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
  .portfolio-section {
    padding-top: 60px;
    padding-bottom: 60px;
  }

  .filter-btn {
    font-size: 14px;
    padding: 10px 20px;
  }

  .card-img-wrapper {
    height: 200px;
  }
}

/* Mobile Portrait (up to 575px) - FIX HORIZONTAL SCROLL */
@media (max-width: 575px) {
  /* Reduce animation distance on mobile */
  .revealX {
    transform: translateY(40px) translateX(0) !important;
    opacity: 0;
  }

  .revealY {
    transform: translateY(40px) !important;
  }

  /* Portfolio Section */
  .portfolio-section {
    padding-top: 50px;
    padding-bottom: 50px;
  }

  .portfolio-section::before {
    height: 150px;
  }

  .filter-tabs {
    gap: 8px;
  }

  .filter-btn {
    font-size: 13px;
    padding: 9px 18px;
  }

  .portfolio-grid {
    margin-top: 40px;
  }

  .card-img-wrapper {
    height: 180px;
  }

  .portfolio-card .card-body {
    padding: 20px;
  }

  .featured-badge {
    font-size: 10px;
    padding: 5px 12px;
    top: 12px;
    right: 12px;
  }

  .project-badges {
    margin-bottom: 12px;
  }

  .badge-primary,
  .badge-secondary {
    font-size: 10px;
    padding: 5px 12px;
  }

  .portfolio-card .card-title {
    font-size: 18px;
    margin-bottom: 10px;
  }

  .portfolio-card .card-text {
    font-size: 13px;
    margin-bottom: 15px;
  }

  .tech-stack {
    padding-top: 15px;
  }

  .tech-tag {
    font-size: 11px;
    padding: 5px 10px;
  }

  .btn-view-details {
    font-size: 13px;
    padding: 11px 28px;
  }
}

/* Extra Small Devices (up to 375px) */
@media (max-width: 375px) {
  .filter-btn {
    font-size: 12px;
    padding: 8px 16px;
  }

  .card-img-wrapper {
    height: 160px;
  }

  .portfolio-card .card-body {
    padding: 18px;
  }

  .portfolio-card .card-title {
    font-size: 17px;
  }

  .portfolio-card .card-text {
    font-size: 12px;
  }

  .btn-view-details {
    font-size: 12px;
    padding: 10px 24px;
  }
}

/* Very Small Devices (up to 320px) */
@media (max-width: 320px) {
  .filter-btn {
    font-size: 11px;
    padding: 7px 14px;
  }

  .card-img-wrapper {
    height: 140px;
  }

  .portfolio-card .card-title {
    font-size: 16px;
  }

  .portfolio-card .card-text {
    font-size: 12px;
  }
}

/* Landscape Orientation (Mobile) */
@media (max-height: 500px) and (orientation: landscape) {
  .portfolio-section {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .bubble,
  .floating-icons,
  .geometric-shapes {
    display: none;
  }
}

/* Tablet Landscape */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
  .portfolio-section {
    padding-top: 120px;
    padding-bottom: 120px;
  }

  .filter-btn {
    font-size: 17px;
    padding: 14px 32px;
  }

  .card-img-wrapper {
    height: 280px;
  }

  .portfolio-card .card-title {
    font-size: 22px;
  }

  .portfolio-card .card-text {
    font-size: 15px;
  }
}
