/* projects.css - Premium Styles for Projects Page */

:root {
  --glass-bg: rgba(15, 23, 42, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shine: rgba(255, 255, 255, 0.03);
  --accent-glow: rgba(139, 92, 246, 0.5);
  --hero-gradient: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
}

/* Hero Section */
.projects-hero {
  position: relative;
  padding: 8rem 2rem 4rem;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
  min-height: 80vh;
}

.hero-content {
  z-index: 2;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1.1;
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(to right, #c084fc, #6366f1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  display: inline-block;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 3rem;
  line-height: 1.6;
}

.highlight {
  color: #e2e8f0;
  font-weight: 600;
  position: relative;
}

.highlight::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-primary);
  opacity: 0.6;
}

/* Hero Stats */
.hero-stats {
  display: flex;
  gap: 3rem;
  padding: 2rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* Hero Visual (Code Block) */
.hero-visual {
  position: relative;
  perspective: 1000px;
}

.code-block-visual {
  background: #0f172a;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  transform: rotateY(-5deg) rotateX(5deg);
  transition: transform 0.5s ease;
  position: relative;
}

.code-block-visual:hover {
  transform: rotateY(0) rotateX(0);
}

.window-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 1.5rem;
}

.window-controls span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.window-controls span:nth-child(1) {
  background: #ef4444;
}

.window-controls span:nth-child(2) {
  background: #eab308;
}

.window-controls span:nth-child(3) {
  background: #22c55e;
}

.code-content {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #e2e8f0;
}

.keyword {
  color: #c084fc;
}

.obj {
  color: #60a5fa;
}

.prop {
  color: #22d3ee;
}

.str {
  color: #a5f3fc;
}

/* Floating Filter Bar */
.filter-bar-wrapper {
  position: sticky;
  top: 70px;
  /* Below navbar */
  z-index: 90;
  margin-bottom: 4rem;
  padding: 1rem 0;
  transition: all 0.3s ease;
}

.filter-bar-wrapper.scrolled {
  padding: 0.5rem 0;
}

.filter-bar-container {
  max-width: 1200px;
  margin: 0 auto;
  /* Centered */
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  width: 90%;
  /* Responsive width */
}

.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 300px;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

#project-search {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  border-radius: 50px;
  padding: 0.75rem 1rem 0.75rem 2.8rem;
  color: #fff;
  font-size: 0.95rem;
  transition: all 0.3s;
}

#project-search:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.filter-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  /* Hide scrollbar */
}

.filter-tab {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.filter-tab.active {
  color: #fff;
  background: var(--accent-primary);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.count-badge {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

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

/* Projects Grid */
.projects-content {
  padding-bottom: 6rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 2rem;
}

/* Premium Project Card */
.project-card {
  background: #0f172a;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.6s forwards;
}

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

.project-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(139, 92, 246, 0.3);
}

.card-header {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Dynamic gradient backgrounds for card headers based on ID hash would be cool, but simple reliable fallback is fine */
.card-header-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(139, 92, 246, 0.1),
    transparent
  );
  transition: transform 0.5s;
}

.project-card:hover .card-header-bg {
  transform: scale(1.2);
}

.card-icon {
  font-size: 4rem;
  color: var(--accent-primary);
  z-index: 1;
  filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.4));
  transition: transform 0.4s;
}

.project-card:hover .card-icon {
  transform: scale(1.1) rotate(5deg);
}

.card-badges {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 2;
}

.badge {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge.featured {
  background: rgba(234, 179, 8, 0.2);
  color: #fca5a5;
  border-color: rgba(234, 179, 8, 0.3);
}

.badge.category {
  color: #94a3b8;
}

/* Links overlay appears on hover */
.card-links-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 3;
}

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

.icon-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #fff;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  text-decoration: none;
  transition:
    transform 0.2s,
    background 0.2s;
}

.icon-btn:hover {
  transform: scale(1.1);
  background: var(--accent-primary);
  color: #fff;
}

.card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    180deg,
    rgba(30, 41, 59, 0.3) 0%,
    transparent 100%
  );
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.95rem;
  color: #94a3b8;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.card-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1rem;
}

.tech-stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-pill {
  font-size: 0.75rem;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 100px;
  transition: all 0.2s;
}

.project-card:hover .tech-pill {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.2);
  color: #e2e8f0;
}

/* Empty State */
.no-results {
  text-align: center;
  padding: 4rem 1rem;
  grid-column: 1 / -1;
}

.no-results-content {
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 3rem;
  max-width: 500px;
  margin: 0 auto;
}

.no-results i {
  font-size: 3rem;
  color: #475569;
  margin-bottom: 1.5rem;
}

.no-results h3 {
  font-size: 1.5rem;
  color: #e2e8f0;
  margin-bottom: 0.5rem;
}

.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 1024px) {
  .projects-hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
    padding-top: 6rem;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-stats {
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero-visual {
    display: none;
    /* Hide 3D element on smaller tablets to keep focus on filtering */
  }
}

@media (max-width: 768px) {
  .filter-bar-container {
    flex-direction: column;
    width: 95%;
    padding: 1rem;
    border-radius: 20px;
    gap: 1rem;
  }

  .search-wrapper {
    max-width: 100%;
    width: 100%;
  }

  .filter-tabs {
    width: 100%;
    padding-bottom: 5px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 3rem;
  }
}
