/* Projects Page Specific Styles */

/* Header styles for projects page */
.header-alt {
  background-color: var(--card-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.back-link-icon {
  display: inline-flex;
  margin-right: 10px;
  font-size: 14px;
  opacity: 0.7;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.logo:hover .back-link-icon {
  transform: translateX(-4px);
  opacity: 1;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Projects Hero Section */
.projects-hero-section {
  padding: calc(var(--header-height, 80px) + 60px) 0 60px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
  position: relative;
  overflow: hidden;
}

.projects-hero-content {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.projects-hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  margin-bottom: 24px;
  line-height: 1.2;
}

.projects-hero-subtitle {
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  color: var(--color-text-secondary);
  max-width: 700px;
  margin: 0 auto 48px;
  line-height: 1.6;
}

/* Stats Section */
.projects-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 0;
}

.stat-item {
  text-align: center;
  padding: 24px;
  background: var(--color-bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--color-border);
}

.stat-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

.stat-number {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 8px;
  display: block;
}

.stat-label {
  font-size: 1rem;
  color: var(--color-text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Legacy support */
.projects-hero {
  padding: 120px 0 60px;
  background: linear-gradient(to right, rgba(66, 153, 225, 0.1) 0%, transparent 100%);
  text-align: center;
}

.projects-page-title {
  font-size: 48px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.projects-page-subtitle {
  max-width: 700px;
  margin: 0 auto 40px;
  color: var(--secondary-color);
  font-size: 20px;
}

/* Filter Section */
.projects-filter-section {
  padding: 40px 0;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

body.dark-mode .projects-filter-section {
  background: rgba(30, 41, 59, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-secondary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* Legacy support */
.projects-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 40px 0;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 2px solid var(--color-border);
  background: var(--color-bg-primary);
  border-radius: 30px;
  font-size: 15px;
  color: var(--color-text-primary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.filter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--color-primary);
  background: var(--color-bg-secondary);
}

.filter-btn.active {
  background: var(--color-primary);
  color: var(--color-bg-primary);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.filter-btn.active:hover {
  box-shadow: var(--shadow-lg);
  background: var(--color-primary-dark);
}

/* Filter count badge */
.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(241, 245, 249, 0.7);
  backdrop-filter: blur(10px);
  color: var(--color-text-primary);
  transition: all 0.3s ease;
}

.filter-btn.active .filter-count {
  background: rgba(255, 255, 255, 0.25);
  color: var(--color-bg-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-btn:hover .filter-count {
  transform: scale(1.1);
}

/* Projects Grid */
.projects-gallery {
  padding: 60px 0 20px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s var(--animation-curve);
}

.projects-grid.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Project Card Styles */
.project-card-full {
  border-radius: 16px;
  overflow: hidden;
  background-color: var(--card-bg);
  box-shadow: var(--card-shadow);
  transition: transform 0.5s var(--animation-curve), box-shadow 0.3s ease;
  position: relative;
  opacity: 0;
  transform: translateY(40px);
  display: flex;
  flex-direction: column;
  min-height: 460px; /* Fixed minimum height for all cards */
  isolation: isolate; /* Create stacking context to prevent edge artifacts */
}

.project-card-full.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card-full:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.1);
}

.project-image-full {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.6s var(--animation-curve);
  border-radius: 16px 16px 0 0;
}

.project-card-full:hover .project-image-full {
  transform: scale(1.05);
}

.project-content-full {
  padding: 25px;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Take up all available space */
}

.project-content-full h3 {
  font-size: 20px;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.project-content-full p {
  font-size: 16px;
  color: var(--secondary-color);
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
}

.project-tags-full {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.project-tag-full {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 15px;
  background-color: rgba(66, 153, 225, 0.1);
  color: var(--accent-color);
}

/* Project footer - consistent positioning */
.project-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 15px;
  margin-top: auto; /* Push to bottom of flex container */
}

.project-date {
  font-size: 12px;
  color: var(--secondary-color);
}

.view-project-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-color);
  font-size: 14px;
  font-weight: 500;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: gap 0.3s ease;
}

.view-project-btn:hover {
  gap: 8px;
}

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

.view-project-btn:hover i {
  transform: translateX(3px);
}

/* Enhanced Project Modal */
.project-modal.active .project-modal-content {
  transform: translateY(0);
  opacity: 1;
}

.project-detail-header {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
}

.project-detail-slides {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

.project-detail-slide {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: none;
}

.project-detail-slide.active {
  display: block;
}

.slide-nav {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.slide-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  padding: 0;
  cursor: pointer;
}

.slide-dot.active {
  background: white;
  transform: scale(1.2);
}

.project-technicals {
  margin-top: 30px;
}

.project-technicals h4 {
  font-size: 18px;
  margin-bottom: 15px;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
}

.tech-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.tech-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Loading Spinner */
.projects-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  grid-column: 1 / -1;
}

.spinner-large {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(66, 153, 225, 0.3);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Footer styles */
.footer-alt {
  padding: 40px 0;
  background-color: var(--footer-bg, #2d3748);
  color: var(--footer-text, white);
  transition: background-color 0.3s ease, color 0.3s ease;
  margin-top: auto;
}

/* Ensure proper page layout to prevent overscroll */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

/* Ensure consistent centering in alternative footer */
.footer-alt .footer-content {
  text-align: center;
}

.footer-alt .footer-links {
  justify-content: center;
}

/* Update footer links color */
.footer-alt .footer-links a {
  color: var(--footer-text);
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.footer-alt .footer-links a:hover {
  opacity: 1;
}

/* Add CSS variables for light and dark mode */
:root {
  --footer-bg: #f7fafc;
  --footer-text: #2d3748;
}

.dark-mode {
  --footer-bg: #2d3748;
  --footer-text: white;
}

/* Update footer links color */
.footer-alt .footer-links a {
  color: var(--footer-text);
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.footer-alt .footer-links a:hover {
  opacity: 1;
}

@media (max-width: 1024px) {
  .projects-stats {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
  }
  
  .stat-item {
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .projects-hero-section {
    padding: calc(var(--header-height, 80px) + 40px) 0 40px;
  }
  
  .projects-hero-title {
    margin-bottom: 20px;
  }
  
  .projects-hero-subtitle {
    margin-bottom: 32px;
  }
  
  .projects-stats {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 24px 0;
  }
  
  .stat-item {
    padding: 20px 16px;
  }
  
  .stat-number {
    font-size: 2.5rem;
  }
  
  .filter-container {
    flex-direction: column;
    gap: 16px;
  }
  
  .filter-buttons {
    gap: 8px;
  }
  
  .filter-btn {
    padding: 8px 16px;
    font-size: 14px;
  }
  
  .filter-count {
    min-width: 20px;
    height: 20px;
    font-size: 11px;
  }
  
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }
  
  .project-detail-header {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-alt .footer-links li {
    margin: 0 12px;
  }
  
  /* Legacy support */
  .projects-page-title {
    font-size: 36px;
  }
  
  .projects-page-subtitle {
    font-size: 18px;
  }
  
  .projects-filter {
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .projects-hero-section {
    padding: calc(var(--header-height, 80px) + 32px) 0 32px;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .stat-label {
    font-size: 0.875rem;
  }
  
  .filter-label {
    font-size: 14px;
  }
  
  .filter-btn {
    padding: 6px 12px;
    font-size: 13px;
    gap: 6px;
  }
  
  .project-content-full h3 {
    font-size: 18px;
  }
  
  .project-card-full {
    max-width: 100%;
  }
  
  /* Legacy support */
  .projects-page-title {
    font-size: 30px;
  }
  
  .projects-filter {
    margin: 30px 0;
  }
}
