/**
 * Projects Page Styles
 * Premium Glassmorphism Design
 */

#projectsPage {
  padding: 100px 0 80px;
  min-height: 100vh;
  background: #0b1020;
  position: relative;
  z-index: 1;
}

/* Homepage Projects Section */
#homeProjects {
  padding: 80px 0;
  position: relative;
}

/* Section Header (Shared styles) */
.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.projects-header {
  text-align: center;
  margin-bottom: 50px;
}

.projects-header h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, #00d9ff 0%, #8b5cf6 50%, #00d9ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 16px;
  text-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
}

.projects-header p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Filter Buttons */
.projects-filters {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.projects-filter-btn {
  padding: 12px 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.projects-filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(155, 92, 243, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(155, 92, 243, 0.2);
}

.projects-filter-btn.active {
  background: linear-gradient(135deg, rgba(155, 92, 243, 0.3), rgba(106, 167, 255, 0.3));
  border-color: rgba(155, 92, 243, 0.5);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(155, 92, 243, 0.3);
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  width: 100%;
}

/* Homepage Grid (3-4 items) */
.projects-grid-home {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .projects-grid-home {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .projects-grid,
  .projects-grid-home {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Project Card - Glassmorphism */
.project-card {
  position: relative;
  isolation: isolate;
  background: rgba(15, 20, 31, 0.4);
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s ease,
              box-shadow 0.3s ease;
  will-change: transform, opacity;
}

.project-card.reveal {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.project-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, 
    rgba(155, 92, 243, 0.3) 0%, 
    rgba(106, 167, 255, 0.2) 50%, 
    rgba(245, 37, 133, 0.3) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: rgba(155, 92, 243, 0.5);
  box-shadow: 0 20px 60px rgba(155, 92, 243, 0.25),
              0 8px 24px rgba(106, 167, 255, 0.2);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

/* Card Image */
.project-card-image {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: #0f141b;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .project-card-image img {
  transform: scale(1.1);
}

.project-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(11, 16, 32, 0.8) 100%);
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.project-card:hover .project-card-overlay {
  opacity: 0.4;
}

.project-card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 6px 12px;
  background: rgba(155, 92, 243, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(155, 92, 243, 0.3);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(155, 92, 243, 1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Card Content */
.project-card-content {
  padding: 24px;
}

.project-card-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 12px 0;
  line-height: 1.3;
}

.project-card-description {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 20px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.project-card-year {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
}

.project-card-tech {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tech-tag {
  padding: 4px 10px;
  background: rgba(155, 92, 243, 0.15);
  border: 1px solid rgba(155, 92, 243, 0.2);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(155, 92, 243, 0.9);
  white-space: nowrap;
}

/* Loading State */
.projects-grid:empty::before {
  content: 'جاري تحميل المشاريع...';
  display: block;
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.1rem;
}

/* Empty State */
.projects-grid:empty::after {
  content: '';
}

