/* Project Selector - Light Theme with Frosted Glass Cards */
/* Matching reference design with portrait cards */

/* CSS Variables */
:root {
  --ps-font-family: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ps-bg-light: #f5f5f7;
  --ps-bg-white: #ffffff;
  --ps-text-dark: #1a1a1a;
  --ps-text-secondary: #666666;
  --ps-text-muted: #999999;
  --ps-accent-blue: rgba(59, 130, 246, 0.15);
  --ps-card-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  --ps-card-radius: 28px;
  --ps-transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--ps-font-family);
  background: var(--ps-bg-light);
  color: var(--ps-text-dark);
  min-height: 100vh;
  position: relative;
}

/* ============================================
   Wave Background - Center positioned, AI Voice style
   ============================================ */
.wave-background {
  position: fixed;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  width: 100%;
  height: 300px;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  filter: blur(2px);
  opacity: 0.7;
}

.wave-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.wave-path {
  stroke-linecap: round;
  transform: translateZ(0);
}

/* Wave glow effects - matching AI voice assistant active state */
.wave-1 {
  filter: 
    drop-shadow(0 0 8px rgba(59, 130, 246, 0.6))
    drop-shadow(0 0 20px rgba(59, 130, 246, 0.4))
    drop-shadow(0 0 40px rgba(59, 130, 246, 0.2));
}

.wave-2 {
  filter: 
    drop-shadow(0 0 6px rgba(99, 102, 241, 0.5))
    drop-shadow(0 0 16px rgba(99, 102, 241, 0.3))
    drop-shadow(0 0 32px rgba(99, 102, 241, 0.15));
}

.wave-3 {
  filter: 
    drop-shadow(0 0 5px rgba(147, 197, 253, 0.4))
    drop-shadow(0 0 12px rgba(147, 197, 253, 0.25));
}

.wave-4 {
  filter: 
    drop-shadow(0 0 4px rgba(191, 219, 254, 0.3))
    drop-shadow(0 0 8px rgba(191, 219, 254, 0.15));
}

/* Main Container */
.selector-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 2rem;
  max-width: 1600px;
  margin: 0 auto;
}

/* Header */
.selector-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-top: 3rem;
}

.main-logo {
  height: 44px;
  width: auto;
  margin-bottom: 0.5rem;
}

.header-subtitle {
  font-size: 0.9375rem;
  color: var(--ps-text-secondary);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* Projects Section */
.projects-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ============================================
   Cards Container - Single row on desktop
   ============================================ */
.cards-container {
  display: flex;
  gap: 1.25rem;
  padding: 2rem 1rem;
  width: 100%;
  justify-content: center;
  align-items: stretch;
  overflow: visible;
}

/* Project Card - Portrait Style */
.project-card {
  position: relative;
  width: 260px;
  min-width: 260px;
  height: 440px;
  border-radius: var(--ps-card-radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--ps-transition);
  box-shadow: var(--ps-card-shadow);
  flex-shrink: 0;
}

.project-card:hover {
  transform: translateY(-12px) scale(1.03);
  box-shadow: 
    0 35px 70px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Card Background Image */
.card-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

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

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

/* Placeholder for images - subtle loading state */
.card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #e5e7eb 0%, #d1d5db 50%, #e5e7eb 100%);
  color: rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.card-image-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s infinite;
  transform: translateX(-100%);
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.card-image-placeholder svg {
  width: 40px;
  height: 40px;
  opacity: 0.3;
  z-index: 1;
}

/* Pagination dots on image - updates with selection */
.card-dots {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 5;
}

.card-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
}

.card-dot.active {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

/* Featured/Latest Badge */
.featured-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 5;
  letter-spacing: 0.02em;
}

/* ============================================
   Card Blur Overlay - Gradient Blur Effect
   ============================================ */
.card-blur-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65%;
  z-index: 2;
  pointer-events: none;
  
  /* Frosted blur effect */
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  
  /* Gradient mask - blur fades from bottom to top */
  -webkit-mask-image: linear-gradient(
    to top,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.95) 20%,
    rgba(0, 0, 0, 0.8) 40%,
    rgba(0, 0, 0, 0.5) 60%,
    rgba(0, 0, 0, 0.2) 80%,
    rgba(0, 0, 0, 0) 100%
  );
  mask-image: linear-gradient(
    to top,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.95) 20%,
    rgba(0, 0, 0, 0.8) 40%,
    rgba(0, 0, 0, 0.5) 60%,
    rgba(0, 0, 0, 0.2) 80%,
    rgba(0, 0, 0, 0) 100%
  );
}

/* ============================================
   Card Content - Text overlay
   ============================================ */
.card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.25rem 1.25rem;
  z-index: 3;
  
  /* Subtle tint for text readability */
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.4) 0%,
    rgba(255, 255, 255, 0.3) 40%,
    rgba(255, 255, 255, 0.1) 70%,
    rgba(255, 255, 255, 0) 100%
  );
}

/* Title row with badge */
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  min-height: 24px;
}

.card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.card-tagline-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.6rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.card-description {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Tags */
.card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 0.625rem;
}

.card-tag {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.6rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Explore Button - White rounded with shadow */
.card-button {
  display: block;
  width: 100%;
  padding: 10px 18px;
  background: var(--ps-bg-white);
  border: none;
  border-radius: 20px;
  color: var(--ps-text-dark);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: var(--ps-transition);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-button:hover {
  background: var(--ps-text-dark);
  color: var(--ps-bg-white);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* ============================================
   Pagination Dots - Below cards
   ============================================ */
.pagination-dots {
  display: none;
  justify-content: center;
  gap: 10px;
  margin-top: 2rem;
}

.pagination-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.15);
  border: none;
  cursor: pointer;
  transition: var(--ps-transition);
}

.pagination-dot.active {
  background: var(--ps-text-dark);
  transform: scale(1.3);
}

.pagination-dot:hover {
  background: rgba(0, 0, 0, 0.35);
}

/* Footer */
.selector-footer {
  text-align: center;
  padding: 1.5rem 0;
  margin-top: auto;
}

.selector-footer p {
  font-size: 0.8125rem;
  color: var(--ps-text-muted);
}

/* ============================================
   Mobile Responsive - Horizontal Carousel
   ============================================ */

@media (max-width: 1200px) {
  .projects-section {
    overflow: visible;
  }
  
  .cards-container {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2rem;
    /* GPU acceleration for smooth scrolling */
    transform: translateZ(0);
    will-change: scroll-position;
  }
  
  /* Optimize cards for scroll performance */
  .project-card {
    transform: translateZ(0);
    backface-visibility: hidden;
  }
  
  /* Remove blur on mobile for Safari compatibility */
  .card-blur-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    /* Use solid gradient fallback instead of blur */
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.6) 0%,
      rgba(0, 0, 0, 0.4) 40%,
      rgba(0, 0, 0, 0.2) 70%,
      rgba(0, 0, 0, 0) 100%
    );
  }

  .cards-container::-webkit-scrollbar {
    display: none;
  }

  .project-card:hover {
    transform: none;
  }

  /* Show pagination dots */
  .pagination-dots {
    display: flex;
  }
}

@media (max-width: 768px) {
  .selector-container {
    padding: 1.5rem 0;
    overflow: visible;
  }
  
  .projects-section {
    overflow: visible;
  }

  .selector-header {
    padding: 0 1rem;
    padding-top: 2.5rem;
    margin-bottom: 1.5rem;
  }

  .main-logo {
    height: 36px;
  }

  .header-subtitle {
    font-size: 0.8125rem;
  }

  .project-card {
    width: 260px;
    min-width: 260px;
    height: 420px;
    /* Add margin for shadow visibility */
    margin: 10px 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  }

  .card-content {
    padding: 0.875rem 1rem 1rem;
  }

  .card-title {
    font-size: 0.9375rem;
  }

  .card-button {
    padding: 10px 16px;
    font-size: 0.8125rem;
  }
  
  /* Remove expensive effects on mobile for smooth scrolling */
  .card-tagline-badge,
  .card-tag {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255, 255, 255, 0.25);
  }
  
  .featured-badge {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  
  /* Disable transitions on mobile for scroll performance */
  .project-card,
  .card-image img,
  .card-button {
    transition: none;
  }
  
  .project-card:hover {
    transform: none;
  }
  
  .project-card:hover .card-image img {
    transform: none;
  }

  /* Wave background - full width, no blur on mobile for Safari */
  .wave-background {
    width: 100%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    height: 200px;
    filter: none;
    opacity: 0.5;
  }
  
  /* Remove all blur effects on mobile for Safari compatibility */
  .card-blur-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    /* Solid gradient fallback for blur effect */
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.55) 0%,
      rgba(0, 0, 0, 0.35) 40%,
      rgba(0, 0, 0, 0.15) 70%,
      rgba(0, 0, 0, 0) 100%
    );
  }
  
  /* Disable wave glow filters on mobile */
  .wave-1, .wave-2, .wave-3, .wave-4 {
    filter: none;
  }
}

/* Small phones */
@media (max-width: 400px) {
  .project-card {
    width: 240px;
    min-width: 240px;
    height: 400px;
  }
  
  .card-content {
    padding: 0.75rem 0.875rem 1rem;
  }
  
  .card-title {
    font-size: 0.875rem;
  }
  
  .card-description {
    font-size: 0.7rem;
    -webkit-line-clamp: 2;
  }
}

/* Touch feedback for mobile */
@media (hover: none) {
  .project-card:active {
    transform: scale(0.98);
  }

  .card-button:active {
    background: var(--ps-text-dark);
    color: var(--ps-bg-white);
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .project-card,
  .card-button,
  .card-image img,
  .pagination-dot {
    transition: none;
  }

  .wave-path animate {
    animation: none;
  }
  
  .card-image-placeholder::before {
    animation: none;
  }
}

/* Disable shimmer on mobile for performance */
@media (max-width: 768px) {
  .card-image-placeholder::before {
    animation: none;
    display: none;
  }
}
