/* Projects Page Styles */

/* Ensure consistent sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Projects Page Styles */

/* Projects Hero Section - Minimalist Layout */
.projects-hero {
  position: relative;
  min-height: 100vh;
  width: 100%;
  background-color: var(--primary-black);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Navigation Placeholder */
.hero-nav-placeholder {
  height: 80px; /* Height of the navbar */
  width: 100%;
  flex-shrink: 0;
}

/* Background Image */
.hero-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(3px);
  transform: scale(1.1);
  transform-origin: center center;
  animation: gentle-pan-bg 25s ease-in-out infinite;
  animation-play-state: var(--animation-play-state, running);
  will-change: transform;
  contain: layout style paint;
}

/* Gentle panning animation for background */
@keyframes gentle-pan-bg {
  0%,
  100% {
    transform: scale(1.1) translateX(0);
  }
  25% {
    transform: scale(1.1) translateX(10px);
  }
  50% {
    transform: scale(1.1) translateX(-10px);
  }
  75% {
    transform: scale(1.1) translateX(5px);
  }
}

/* Text Content Block */
.hero-text-block {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 40px 120px; /* Extra bottom padding for scroll indicator */
  position: relative;
  z-index: 2;
}

.hero-text-content {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  text-align: center;
  position: relative;
}

.hero-text-content::before {
  content: "";
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--electric-blue),
    transparent
  );
  border-radius: 2px;
}

.hero-text-content::after {
  content: "";
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--neon-purple),
    transparent
  );
  border-radius: 1px;
}

.hero-headline {
  font-family: var(--font-primary);
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--pure-white);
  margin: 0 0 30px 0;
  opacity: 0;
  transform: translateY(30px);
  animation: slide-up-reveal 1s ease-out 0.3s forwards;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  position: relative;
  display: inline-block;
}

.hero-headline::before {
  content: "";
  position: absolute;
  top: -15px;
  left: -20px;
  width: 6px;
  height: 6px;
  background: var(--electric-blue);
  border-radius: 50%;
  box-shadow: 0 0 15px var(--electric-blue);
  animation: pulse 2s ease-in-out infinite;
}

.hero-headline::after {
  content: "";
  position: absolute;
  bottom: -15px;
  right: -20px;
  width: 4px;
  height: 4px;
  background: var(--neon-purple);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--neon-purple);
  animation: pulse 2s ease-in-out infinite 0.5s;
}

.hero-description {
  font-family: var(--font-secondary);
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--light-gray);
  margin: 0;
  max-width: 700px;
  margin: 0 auto;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  position: relative;
  padding: 0 20px;
}

.hero-description::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 2px;
  height: 60%;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(0, 212, 255, 0.3),
    transparent
  );
  border-radius: 1px;
}

.hero-description::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 2px;
  height: 60%;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(128, 0, 255, 0.3),
    transparent
  );
  border-radius: 1px;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Slide-up reveal animation for headline */
@keyframes slide-up-reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: var(--pure-white);
  z-index: 3;
  animation: fade-in-out 2s ease-in-out infinite;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.scroll-arrow {
  font-size: 1.5rem;
  margin-bottom: 8px;
  animation: bounce 2s infinite;
}

.scroll-text {
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 300;
  font-family: var(--font-secondary);
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes fade-in-out {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes fade-in-out {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* Projects Section Styles */
.projects-section {
  padding: 80px 0;
  background-color: var(--primary-black);
  position: relative;
}

.projects-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--electric-blue),
    transparent
  );
  opacity: 0.5;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-title {
  font-family: var(--font-primary);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--pure-white);
  margin-bottom: 20px;
}

.section-subtitle {
  font-family: var(--font-secondary);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--light-gray);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.project-categories {
  margin-top: 30px;
  margin-bottom: 40px;
}

.filter-title {
  font-family: var(--font-secondary);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--light-gray);
  margin-bottom: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
}

.filter-btn {
  font-family: var(--font-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  background: rgba(15, 15, 20, 0.7);
  border: 1px solid rgba(0, 212, 255, 0.15);
  color: var(--light-gray);
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.count-badge {
  font-family: var(--font-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
  background: rgba(0, 212, 255, 0.2);
  color: var(--electric-blue);
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
  transition: all 0.3s ease;
}

.filter-btn.active .count-badge {
  background: rgba(255, 255, 255, 0.2);
  color: var(--pure-white);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--cyber-gradient);
  color: var(--pure-white);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 212, 255, 0.3);
}

/* Project Cards */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.project-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.4s ease;
  height: 300px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  box-sizing: border-box; /* Ensure consistent sizing */
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 212, 255, 0.2);
}

.project-card-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.stepper-arm-image {
  object-position: 50% 30%;
}

.vital-air-image {
  object-position: 50% 1%;
}

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

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 30%,
    rgba(0, 0, 0, 0.4) 100%
  );
  z-index: 2;
  transition: background 0.4s ease;
}

.project-card:hover .project-overlay {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9) 50%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

.project-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 30px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  box-sizing: border-box; /* Ensure padding is included in width calculation */
  overflow: hidden; /* Prevent content from spilling out */
}

.project-card:hover .project-content {
  transform: translateY(-5px);
}

.project-badge {
  font-family: var(--font-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
  background: var(--cyber-gradient);
  color: var(--pure-white);
  padding: 5px 12px;
  border-radius: 15px;
  margin-bottom: 15px;
  align-self: flex-start;
  max-width: 100%; /* Ensure badges don't overflow */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.project-content h3 {
  font-family: var(--font-primary);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--pure-white);
  width: 100%; /* Full width */
  overflow: hidden;
  text-overflow: ellipsis; /* Add ellipsis if text overflows */
  white-space: nowrap; /* Keep title on one line */
}

.project-content p {
  font-family: var(--font-secondary);
  font-size: 1rem;
  font-weight: bold;
  line-height: 1.6;
  color: #000000;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8),
    0 0 3px rgba(255, 255, 255, 0.6);
  width: 100%; /* Full width */
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Limit to 2 lines */
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis; /* Add ellipsis for overflow */
  margin-bottom: 0; /* Remove bottom margin to avoid overflow */
}

/* Modal Styles */
.project-modal {
  display: none;
  position: fixed;
  top: 80px;
  left: 0;
  width: 100%;
  height: calc(100vh - 80px);
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  overflow-y: auto;
  padding: 20px 0;
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 900px;
  margin: 0 auto;
  background: rgba(15, 15, 20, 0.95);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  animation: modal-fade-in 0.3s ease-out;
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
  padding-bottom: 15px;
}

.modal-title {
  font-family: var(--font-primary);
  font-size: 2rem;
  font-weight: 700;
  color: var(--electric-blue);
}

.modal-close {
  font-family: var(--font-secondary);
  font-size: 1.8rem;
  font-weight: 400;
  background: none;
  border: none;
  color: var(--light-gray);
  cursor: pointer;
  transition: color 0.3s;
}

.modal-close:hover {
  color: var(--pure-white);
}

.modal-body {
  margin-bottom: 30px;
}

.modal-category {
  font-family: var(--font-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-block;
  background: linear-gradient(90deg, #00d4ff, #00b4ff);
  color: var(--pure-white);
  padding: 5px 15px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.modal-description {
  font-family: var(--font-secondary);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.8;
  color: var(--light-gray);
  margin-bottom: 30px;
}

.modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }

  .project-content {
    padding: 25px; /* Slightly less padding on larger tablets */
  }
}

@media (max-width: 992px) {
  .hero-text-block {
    padding: 0 20px 100px;
  }

  .hero-text-content::before {
    width: 100px;
    top: -35px;
  }

  .hero-text-content::after {
    width: 60px;
    bottom: -35px;
  }

  .hero-headline {
    font-size: 3.2rem;
    margin-bottom: 25px;
  }

  .hero-description {
    font-size: 1.1rem;
    padding: 0 15px;
  }

  .hero-description::before,
  .hero-description::after {
    height: 50%;
  }

  .modal-content {
    width: 95%;
  }

  .modal-gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .project-content h3 {
    font-size: 1.4rem; /* Slightly smaller font on tablets */
  }

  .project-content p {
    font-size: 0.95rem; /* Slightly smaller description text */
  }
}

@media (max-width: 768px) {
  .hero-text-block {
    padding: 20px 15px 90px;
  }

  .hero-text-content::before {
    width: 80px;
    top: -30px;
  }

  .hero-text-content::after {
    width: 50px;
    bottom: -30px;
  }

  .hero-headline {
    font-size: 2.8rem;
    margin-bottom: 20px;
  }

  .hero-description {
    font-size: 1rem;
    padding: 0 10px;
  }

  .hero-description::before,
  .hero-description::after {
    height: 40%;
  }

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

  .projects-hero-content .page-subtitle {
    font-size: 1.3rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .section-subtitle {
    font-size: 1.1rem;
  }

  .project-card {
    height: 250px;
  }

  .project-content {
    padding: 20px; /* Less padding on smaller devices */
  }

  .project-badge {
    margin-bottom: 10px;
  }

  .project-content h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
  }

  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }

  .modal-title {
    font-size: 1.8rem;
  }

  .modal-gallery {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 576px) {
  .hero-text-block {
    padding: 15px 10px 80px;
  }

  .hero-headline {
    font-size: 2.4rem;
    margin-bottom: 18px;
  }

  .hero-description {
    font-size: 0.95rem;
    padding: 0;
  }

  .projects-hero-content .page-title {
    font-size: 2.5rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .section-subtitle {
    font-size: 1rem;
  }

  .project-card {
    height: 220px;
  }

  .project-content {
    padding: 15px; /* Minimal padding on mobile */
  }

  .project-content h3 {
    font-size: 1.2rem;
    margin-bottom: 6px;
  }

  .project-content p {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .project-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    margin-bottom: 8px;
  }

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

  .modal-content {
    padding: 20px;
  }

  .modal-gallery {
    grid-template-columns: 1fr;
  }

  .modal-title {
    font-size: 1.5rem;
  }

  .filter-btn {
    font-size: 0.85rem;
    padding: 8px 15px;
  }
}

/* Extra small devices */
@media (max-width: 400px) {
  .project-card {
    height: 200px; /* Shorter cards on very small screens */
  }

  .project-content {
    padding: 12px; /* Even less padding on very small screens */
  }

  .project-content h3 {
    font-size: 1.1rem; /* Smaller heading on very small screens */
  }

  .project-content p {
    -webkit-line-clamp: 2; /* Still show 2 lines, but smaller text */
    line-clamp: 2; /* Standard property for compatibility */
    font-size: 0.85rem;
    line-height: 1.3;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .section-subtitle {
    font-size: 0.95rem;
  }
}

/* Show/Hide based on filter */
.project-card.hide {
  display: none;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
