/* Mobile Portfolio Filter System with Category Tags */
/* ================================================= */

@media screen and (max-width: 991px) {
  /* Hide desktop filter and old mobile dropdown */
  .portfolio-filter,
  .pf-filter-wrapper {
    display: none !important;
  }

  /* Mobile Filter Pills Container */
  .mobile-portfolio-filters {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    background: transparent;
  }

  .mobile-portfolio-filters::-webkit-scrollbar {
    display: none;
  }

  /* Filter Pills/Chips */
  .filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 25px;
    background: rgba(240, 240, 245, 0.8);
    border: 2px solid transparent;
    color: #454360;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
  }

  .filter-pill i {
    font-size: 13px;
    transition: transform 0.3s ease;
  }

  /* Filter pill hover/active states */
  .filter-pill:active {
    transform: scale(0.95);
  }

  .filter-pill.active {
    background: linear-gradient(135deg, #ff4c60 0%, #ff6b7a 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(255, 76, 96, 0.3);
  }

  .filter-pill.active i {
    transform: rotate(360deg);
  }

  /* Ripple effect on tap */
  .filter-pill::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
  }

  .filter-pill:active::after {
    width: 100px;
    height: 100px;
  }

  /* Category specific colors */
  .filter-pill[data-filter="ai"] {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
  }

  .filter-pill[data-filter="ai"].active {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
  }

  .filter-pill[data-filter="webapp"] {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
  }

  .filter-pill[data-filter="webapp"].active {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  }

  .filter-pill[data-filter="youtube"] {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
  }

  .filter-pill[data-filter="youtube"].active {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
  }

  .filter-pill[data-filter="game"] {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
  }

  .filter-pill[data-filter="game"].active {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  }

  .filter-pill[data-filter="crypto"] {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
  }

  .filter-pill[data-filter="crypto"].active {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  }

  /* Counter badge on filter pills */
  .filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 4px;
  }

  .filter-pill.active .filter-count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
  }

  /* Category tags on cards */
  .card-category-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
  }

  .category-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .category-tag i {
    font-size: 10px;
  }

  /* Category tag colors matching filters */
  .category-tag.tag-ai {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
  }

  .category-tag.tag-webapp {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
  }

  .category-tag.tag-youtube {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
  }

  .category-tag.tag-game {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
  }

  .category-tag.tag-crypto {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
  }

  /* Dark mode support for filters */
  [data-theme="dark"] .mobile-portfolio-filters {
    background: transparent;
  }

  [data-theme="dark"] .filter-pill {
    background: rgba(30, 30, 41, 0.8);
    color: #a8a8b8;
    border-color: rgba(255, 255, 255, 0.05);
  }

  [data-theme="dark"] .filter-pill.active {
    color: white;
  }

  [data-theme="dark"] .category-tag {
    background: rgba(255, 255, 255, 0.05);
  }

  [data-theme="dark"] .category-tag.tag-ai {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
  }

  [data-theme="dark"] .category-tag.tag-webapp {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
  }

  [data-theme="dark"] .category-tag.tag-youtube {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
  }

  [data-theme="dark"] .category-tag.tag-game {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
  }

  [data-theme="dark"] .category-tag.tag-crypto {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
  }

  /* Results counter */
  .filter-results {
    padding: 0 20px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #7c7c8a;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .filter-results strong {
    color: #ff4c60;
    font-weight: 600;
  }

  .clear-filters {
    font-size: 12px;
    color: #ff4c60;
    text-decoration: none;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(255, 76, 96, 0.1);
    transition: all 0.3s ease;
  }

  .clear-filters:hover {
    background: rgba(255, 76, 96, 0.2);
  }

  [data-theme="dark"] .filter-results {
    color: #a8a8b8;
  }

  /* Animation for filtered items */
  .portfolio-item {
    animation: fadeInUp 0.4s ease;
  }

  .portfolio-item.hidden {
    display: none !important;
  }

  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Empty state */
  .no-results {
    text-align: center;
    padding: 60px 20px;
    color: #7c7c8a;
  }

  .no-results i {
    font-size: 48px;
    color: rgba(255, 76, 96, 0.3);
    margin-bottom: 20px;
  }

  .no-results h3 {
    font-size: 18px;
    color: #454360;
    margin-bottom: 10px;
  }

  .no-results p {
    font-size: 14px;
    margin-bottom: 20px;
  }

  [data-theme="dark"] .no-results h3 {
    color: #ffffff;
  }

  [data-theme="dark"] .no-results p {
    color: #a8a8b8;
  }

  /* Small screen adjustments */
  @media screen and (max-width: 400px) {
    .mobile-portfolio-filters {
      padding: 10px 15px;
    }

    .filter-pill {
      padding: 8px 14px;
      font-size: 13px;
    }

    .filter-pill i {
      font-size: 12px;
    }
  }
}

/* Desktop - hide mobile filters */
@media screen and (min-width: 992px) {
  .mobile-portfolio-filters,
  .filter-results,
  .no-results {
    display: none !important;
  }
}