/* ============================================
   Projects Page — Styles
   Inherits design system from style.css
   ============================================ */

/* ── Page Hero ── */
.projects-hero {
  padding: 140px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.projects-hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -150px;
  width: 500px;
  height: 500px;
  background: var(--accent);
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0.1;
  pointer-events: none;
}

.projects-hero .section-subtitle {
  justify-content: center;
}

/* ── Filter Section ── */
.projects-toolbar {
  max-width: var(--container-width);
  margin: 0 auto 48px;
  padding: var(--container-padding);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px;
}

.filter-tab {
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-family: inherit;
  white-space: nowrap;
}

.filter-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.filter-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.filter-tab .tab-count {
  font-size: 0.72rem;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
}

.filter-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
}

.projects-search {
  position: relative;
  width: 280px;
}

.projects-search input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: inherit;
  transition: all var(--transition-normal);
}

.projects-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.projects-search input::placeholder {
  color: var(--text-muted);
}

.projects-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ── Projects Grid ── */
.projects-gallery {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: var(--container-padding);
}

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

/* ── Project Tile ── */
.project-tile {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px);
  animation: tileIn 0.5s ease forwards;
}

.project-tile:nth-child(1) { animation-delay: 0.05s; }
.project-tile:nth-child(2) { animation-delay: 0.1s; }
.project-tile:nth-child(3) { animation-delay: 0.15s; }
.project-tile:nth-child(4) { animation-delay: 0.2s; }
.project-tile:nth-child(5) { animation-delay: 0.25s; }
.project-tile:nth-child(6) { animation-delay: 0.3s; }

@keyframes tileIn {
  to { opacity: 1; transform: translateY(0); }
}

.project-tile:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px var(--accent-glow);
}

.tile-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(34, 211, 238, 0.1), var(--bg-secondary));
}

.tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  transition: transform 0.5s ease;
}

.project-tile:hover .tile-image img {
  transform: scale(1.06);
}

.tile-category-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.tile-category-badge.desktop {
  background: rgba(99, 102, 241, 0.75);
  color: #fff;
}

.tile-category-badge.web {
  background: rgba(34, 211, 238, 0.75);
  color: #0a0a1a;
}

.tile-category-badge.mobile {
  background: rgba(34, 197, 94, 0.75);
  color: #fff;
}

.tile-featured-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 1rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.tile-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tile-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.3;
}

.tile-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.tile-tech .chip {
  font-size: 0.72rem;
  padding: 3px 10px;
}

.tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.tile-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap var(--transition-normal);
}

.project-tile:hover .tile-link {
  gap: 10px;
}

.tile-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tile-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Stats Bar ── */
.projects-stats {
  max-width: var(--container-width);
  margin: 48px auto 0;
  padding: var(--container-padding);
}

.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 20px;
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-blur);
}

.stats-bar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.stats-bar-item strong {
  color: var(--text-primary);
  font-weight: 700;
}

.stats-bar-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
}

/* ── Empty State ── */
.projects-empty {
  text-align: center;
  padding: 80px 20px;
  grid-column: 1 / -1;
}

.projects-empty svg {
  width: 64px;
  height: 64px;
  color: var(--text-muted);
  opacity: 0.4;
  margin-bottom: 16px;
}

.projects-empty h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.projects-empty p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ── Loading Skeleton ── */
.tile-skeleton {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.skeleton-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-body {
  padding: 24px;
}

.skeleton-line {
  height: 14px;
  border-radius: 6px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-line.w-70 { width: 70%; }
.skeleton-line.w-90 { width: 90%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.h-20 { height: 20px; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Responsive — Tablet ── */
@media (max-width: 1024px) {
  .projects-grid-dynamic {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects-toolbar {
    justify-content: center;
  }
}

/* ── Responsive — Mobile ── */
@media (max-width: 768px) {
  .projects-hero {
    padding: 120px 0 40px;
  }

  .projects-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
  }

  .projects-search {
    width: 100%;
  }

  .projects-grid-dynamic {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }

  .stats-bar {
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
  }
}
