/* =====================================================
   PORTFOLIO PAGE - CLEANED & ORGANIZED
   ===================================================== */

/* =====================================================
   PORTFOLIO FILTER
   ===================================================== */
.portfolio-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 4rem;
  padding: 0;
  background: transparent;
}

.filter-btn {
  padding: 0.625rem 1.25rem;
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  color: #5a5a5a;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.filter-btn::after {
  content: '✓';
  margin-left: 0.5rem;
  font-size: 0.75rem;
  opacity: 0;
  display: inline-block;
  transition: opacity 0.2s ease;
}

.filter-btn:hover {
  border-color: #FF6B35;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.15);
}

.filter-btn:focus {
  outline: none;
  border-color: #FF6B35;
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.filter-btn:focus:not(:focus-visible) {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.filter-btn.active {
   background: rgba(255, 245, 240, 1);
  border-color: #FF6B35;
  color: #FF6B35;
  box-shadow: 0 4px 16px rgba(26, 26, 46, 0.2);
}

.filter-btn.active::after {
  opacity: 1;
  animation: checkmarkPop 0.3s ease;
}

/* =====================================================
   PORTFOLIO GRID & ITEMS
   ===================================================== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  transition: all 0.3s ease;
  align-items: start;
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  opacity: 0;
  transform: scale(0.96) translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Visible state */
.portfolio-item.fade-in {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Hidden state */
.portfolio-item.fade-out {
  opacity: 0;
  transform: scale(0.95) translateY(30px);
  position: absolute;
  pointer-events: none;
}

.portfolio-item-image {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
  border-radius: 10px;
  background: #F1F5F9;
}

.portfolio-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portfolio-item:hover .portfolio-item-image img {
  transform: scale(1.1);
}

.placeholder-image {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: #FFFFFF;
}

/* =====================================================
   PORTFOLIO OVERLAY & CONTENT
   ===================================================== */
.portfolio-item-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.95) 0%, rgba(247, 147, 30, 0.95) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  padding: 2rem;
}

.portfolio-item:hover .portfolio-item-overlay {
  opacity: 1;
}

.portfolio-item-info {
  text-align: center;
  color: #FFFFFF;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.portfolio-item:hover .portfolio-item-info {
  transform: translateY(0);
}

.portfolio-item-category {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(255, 107, 53, 0.9);
  border-radius: 30px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.portfolio-item-title {
  font-size: 1.75rem;
  color: #FFFFFF;
  margin-bottom: 1rem;
}

.portfolio-item-excerpt {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.portfolio-view-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: #FFFFFF;
  color: #FF6B35;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.portfolio-view-btn:hover {
  background: #1a1a2e;
  color: #FFFFFF;
  transform: translateY(-2px);
}

.coming-soon {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  cursor: default;
}

.coming-soon:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  transform: none;
}

/* =====================================================
   PROCESS STEPS
   ===================================================== */
.process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.process-step {
  text-align: center;
  padding: 2rem;
  background: #FFFFFF;
  border-radius: 5px;
  box-shadow: 0 4px 20px rgba(26, 26, 46, 0.08);
  transition: all 0.3s ease;
}

.process-step:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 40px rgba(26, 26, 46, 0.15);
}

.process-step-number {
  width: 60px;
  height: 60px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  color: #FFFFFF;
}

.process-step h4 {
  font-size: 1.25rem;
  color: #1a1a2e;
  margin-bottom: 1rem;
}

.process-step p {
  font-size: 1rem;
  color: #5a5a5a;
  line-height: 1.6;
  margin: 0;
}

/* =====================================================
   TECH STACK
   ===================================================== */
.tech-stack-minimal {
  max-width: 1000px;
  margin: 0 auto;
}

.tech-category-minimal {
  margin-bottom: 3rem;
  animation: fadeInUp 0.8s ease;
}

.tech-category-minimal:last-child {
  margin-bottom: 0;
}

.tech-category-label {
  font-size: 1rem;
  font-weight: 600;
  color: #5a5a5a;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.tech-category-label::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
  border-radius: 2px;
}

.tech-icons-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 2.5rem;
}

.tech-icon-item {
  font-size: 4rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  opacity: 0;
  animation: fadeInScale 0.6s ease forwards, float 3s ease-in-out infinite;
}

.tech-icon-item:nth-child(odd) { animation-duration: 0.6s, 3.5s; }
.tech-icon-item:nth-child(even) { animation-duration: 0.6s, 2.8s; }

.tech-icons-row .tech-icon-item:nth-child(1) { animation-delay: 0.1s; }
.tech-icons-row .tech-icon-item:nth-child(2) { animation-delay: 0.15s; }
.tech-icons-row .tech-icon-item:nth-child(3) { animation-delay: 0.2s; }
.tech-icons-row .tech-icon-item:nth-child(4) { animation-delay: 0.25s; }
.tech-icons-row .tech-icon-item:nth-child(5) { animation-delay: 0.3s; }
.tech-icons-row .tech-icon-item:nth-child(6) { animation-delay: 0.35s; }
.tech-icons-row .tech-icon-item:nth-child(7) { animation-delay: 0.4s; }
.tech-icons-row .tech-icon-item:nth-child(8) { animation-delay: 0.45s; }

.tech-icon-item:hover {
  transform: translateY(-15px) scale(1.2);
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
}

.tech-icon-item i {
  display: block;
  transition: all 0.4s ease;
}

.tech-icon-item:hover i {
  transform: rotateY(360deg);
}

.tech-icon-item::after {
  content: attr(title);
  position: absolute;
  bottom: -2.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #1a1a2e;
  color: #FFFFFF;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 10;
}

.tech-icon-item:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Tech brand colors */
.tech-icon-item[data-tech="html"] { color: #E34F26; }
.tech-icon-item[data-tech="css"] { color: #1572B6; }
.tech-icon-item[data-tech="javascript"] { color: #F7DF1E; }
.tech-icon-item[data-tech="react"] { color: #61DAFB; }
.tech-icon-item[data-tech="vue"] { color: #42B883; }
.tech-icon-item[data-tech="sass"] { color: #CC6699; }
.tech-icon-item[data-tech="bootstrap"] { color: #7952B3; }
.tech-icon-item[data-tech="nodejs"] { color: #339933; }
.tech-icon-item[data-tech="python"] { color: #3776AB; }
.tech-icon-item[data-tech="php"] { color: #777BB4; }
.tech-icon-item[data-tech="laravel"] { color: #FF2D20; }
.tech-icon-item[data-tech="mongodb"] { color: #47A248; }
.tech-icon-item[data-tech="mysql"] { color: #4479A1; }
.tech-icon-item[data-tech="aws"] { color: #FF9900; }
.tech-icon-item[data-tech="docker"] { color: #2496ED; }
.tech-icon-item[data-tech="git"] { color: #F05032; }
.tech-icon-item[data-tech="wordpress"] { color: #21759B; }
.tech-icon-item[data-tech="shopify"] { color: #96BF48; }
.tech-icon-item[data-tech="figma"] { color: #F24E1E; }
.tech-icon-item[data-tech="github"] { color: #181717; }
.tech-icon-item[data-tech="npm"] { color: #CB3837; }

/* =====================================================
   CTA SECTION
   ===================================================== */
.cta-section {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: floatCTA 20s ease-in-out infinite;
}

.cta-content {
  text-align: center;
  position: relative;
  z-index: 2;
  max-width: 700px;
  margin: 0 auto;
}

.cta-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #FFFFFF;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.cta-subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
  line-height: 1.75;
}

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

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes floatCTA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 30px) scale(1.05); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
}

@keyframes checkmarkPop {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* =====================================================
   RESPONSIVE - TABLET (992px and below)
   ===================================================== */
@media (max-width: 992px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .portfolio-item-image {
    height: 350px;
  }

  .process-steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .tech-icon-item {
    font-size: 3.5rem;
  }

  .tech-icons-row {
    gap: 2rem;
  }

  .tech-category-minimal {
    margin-bottom: 2.5rem;
  }
}

/* =====================================================
   RESPONSIVE - MOBILE (768px and below)
   ===================================================== */
@media (max-width: 768px) {
  /* Filter */
  .portfolio-filter {
    gap: 0.5rem;
  }
  
  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
  }

  /* Grid */
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Portfolio Items */
  .portfolio-item-image {
    height: 280px;
  }

  .portfolio-item-overlay {
    padding: 1.25rem 1rem;
    overflow: hidden;
  }

  .portfolio-item-info {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding: 0 0.5rem;
  }

  .portfolio-item-category {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .portfolio-item-title {
    font-size: 1.25rem !important;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .portfolio-item-excerpt {
    font-size: 0.875rem !important;
    line-height: 1.5;
    margin-bottom: 1rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .portfolio-view-btn {
    padding: 0.75rem 1.5rem !important;
    font-size: 0.9375rem !important;
    min-width: 140px;
    white-space: nowrap;
  }

  .portfolio-view-btn i {
    font-size: 0.875rem;
    margin-left: 0.35rem;
  }

  .placeholder-image {
    font-size: 3.5rem;
  }

  /* Remove desktop hover effects */
  .portfolio-item:hover .portfolio-item-image img {
    transform: none;
  }

  /* Tap indicator */
  .portfolio-item::after {
    content: '👆 Tap';
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.9);
    color: #FF6B35;
    padding: 0.4rem 0.875rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    opacity: 0.8;
    z-index: 5;
    animation: pulse 2s ease-in-out infinite;
  }

  .portfolio-item.active::after {
    display: none;
  }

  .portfolio-item.active .portfolio-item-overlay {
    opacity: 1 !important;
    pointer-events: auto;
    visibility: visible;
  }

  /* Process Steps */
  .process-steps {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .process-step {
    padding: 1.5rem;
  }

  .process-step-number {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .process-step h4 {
    font-size: 1.125rem;
  }

  .process-step p {
    font-size: 0.9375rem;
  }

  /* Tech Stack */
  .tech-icon-item {
    font-size: 3rem;
  }

  .tech-icons-row {
    gap: 1.5rem;
  }

  .tech-category-label {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
  }

  .tech-category-minimal {
    margin-bottom: 2rem;
  }

  .tech-icon-item:hover {
    transform: translateY(-10px) scale(1.15);
  }

  /* CTA */
  .cta-section {
    padding: 4rem 0;
  }

  .cta-title {
    font-size: 1.75rem;
  }

  .cta-subtitle {
    font-size: 1.125rem;
  }

  .btn-large {
    width: 100%;
  }
}

/* =====================================================
   RESPONSIVE - SMALL MOBILE (480px and below)
   ===================================================== */
@media (max-width: 480px) {
  /* Filter */
  .portfolio-filter {
    gap: 0.5rem;
    padding: 0 0.5rem;
  }
  
  .filter-btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.75rem;
  }

  /* Portfolio Items */
  .portfolio-item-image {
    height: 260px;
  }

  .portfolio-item-overlay {
    padding: 1rem 0.875rem;
  }

  .portfolio-item-category {
    padding: 0.3rem 0.65rem;
    font-size: 0.6875rem;
    margin-bottom: 0.65rem;
  }

  .portfolio-item-title {
    font-size: 1.125rem !important;
    margin-bottom: 0.65rem;
  }

  .portfolio-item-excerpt {
    font-size: 0.8125rem !important;
    margin-bottom: 0.875rem;
    -webkit-line-clamp: 2;
  }

  .portfolio-view-btn {
    padding: 0.65rem 1.25rem !important;
    font-size: 0.875rem !important;
    min-width: 130px;
  }

  .portfolio-item::after {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
  }

  .placeholder-image {
    font-size: 3rem;
  }

  /* Tech Stack */
  .tech-icon-item {
    font-size: 2.5rem;
  }

  .tech-icons-row {
    gap: 1.25rem;
  }

  .tech-category-label {
    font-size: 0.8125rem;
  }

  .tech-icon-item::after {
    font-size: 0.75rem;
    padding: 0.4rem 0.75rem;
  }

  /* CTA */
  .cta-section {
    padding: 3rem 0;
  }

  .cta-title {
    font-size: 1.5rem;
  }

  .cta-subtitle {
    font-size: 1rem;
  }
}

/* =====================================================
   ACCESSIBILITY
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
  .portfolio-item-overlay,
  .portfolio-item-info,
  .portfolio-item-image img,
  .tech-icon-item,
  .filter-btn,
  .filter-btn::after {
    transition: none !important;
    animation: none !important;
  }
  
  .filter-btn:hover,
  .portfolio-item:hover .portfolio-item-image img {
    transform: none;
  }
}





/* =====================================================
   VIEW ALL BUTTON
   ===================================================== */
.portfolio-view-all-container {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
  margin-bottom: 2rem;
}

.btn-view-all {
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 15px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-view-all:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(255, 107, 53, 0.4);
}

.btn-view-all i {
  transition: transform 0.3s ease;
}

.btn-view-all:hover i {
  transform: translateY(3px);
}

.btn-view-all.expanded i {
  transform: rotate(180deg);
}

/* Hide projects beyond index 3 initially */
.portfolio-item[data-index]:nth-child(n+5) {
  display: none;
}

.portfolio-item[data-index]:nth-child(n+5).show-all {
  display: block;
}

/* Mobile */
@media (max-width: 768px) {
  .btn-view-all {
    padding: 0.875rem 1.75rem;
    font-size: 0.9375rem;
  }
}

@media (max-width: 480px) {
  .btn-view-all {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
  }
}