/* assets/css/products.css */
:root {
  --bg-dark: #050507;
  --violet-glow: #a855f7;
  --deep-purple: #3b0764;
  --accent-purple: #7c3aed;
  --glass-bg: rgba(255, 255, 255, 0.02);
  --glass-border: rgba(168, 85, 247, 0.15);
}

.products-showcase {
  background-color: var(--bg-dark);
  color: #ffffff;
  padding: 4rem 2rem 6rem;
  position: relative;
  overflow: hidden;
  font-family: 'Manrope', sans-serif;
  min-height: 100vh;
}

/* Background effects */
.products-bg-glow {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100vw;
  height: 80vh;
  background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.15) 0%, rgba(5, 5, 7, 0) 65%);
  filter: blur(120px);
  z-index: 0;
  pointer-events: none;
}

.products-header {
  text-align: center;
  position: relative;
  z-index: 2;
  margin-bottom: 5rem;
  animation: slideUpFade 1s ease-out forwards;
}

.products-header h2 {
  font-family: 'Syne', sans-serif;
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  animation: fadeUp 0.8s 0.12s ease both;
}


.products-header em {
  font-style: normal;
  background: linear-gradient(135deg, #c084fc 0%, var(--purple-glow) 40%, var(--purple-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.products-header p {
  font-size: 1.15rem;
  color: #a1a1aa;
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.7;
  font-weight: 400;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* Tablet */
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .products-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 3rem;
    gap: 1.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; 
    -ms-overflow-style: none;  
  }
  .products-grid::-webkit-scrollbar {
    display: none; 
  }
  .product-card {
    flex: 0 0 85%; 
    scroll-snap-align: center;
  }
  .products-header h2 {
    font-size: 2.5rem;
  }
}

.product-card {
  position: relative;
  border-radius: 32px;
  padding: 2.5rem 1.5rem;
  background: linear-gradient(145deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: slideUpFade 0.8s ease-out forwards;
  opacity: 0;
  transform: translateY(40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 15px 35px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }

.product-card:hover {
  transform: translateY(-15px) scale(1.02);
  box-shadow: 0 25px 45px rgba(59, 7, 100, 0.8), inset 0 1px 0 rgba(255,255,255,0.2);
  border-color: rgba(168, 85, 247, 0.8);
  background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 32px;
  box-shadow: 0 0 50px var(--violet-glow);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: -1;
  pointer-events: none;
}

.product-card:hover::before {
  opacity: 0.3;
}

/* realistic phone mockup - enforced size */
.mockup-container {
  width: 100%;
  max-width: 260px; /* Default phone size constraint */
  aspect-ratio: 9 / 19;
  background-color: #050508;
  border-radius: 34px;
  border: 7px solid #22222c;
  box-shadow: inset 0 0 15px rgba(255,255,255,0.1), 0 20px 40px rgba(0,0,0,0.8);
  position: relative;
  transform-style: preserve-3d;
  transform: perspective(1000px) rotateX(5deg) rotateY(-3deg);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: floatMockup 6s ease-in-out infinite alternate;
  margin: 0 auto;
}

.product-card:nth-child(even) .mockup-container {
    animation-delay: -3s;
    transform: perspective(1000px) rotateX(5deg) rotateY(3deg);
}
@keyframes floatMockupEven {
    from { transform: perspective(1000px) rotateX(5deg) rotateY(3deg) translateY(0); }
    to { transform: perspective(1000px) rotateX(5deg) rotateY(3deg) translateY(-15px); }
}
.product-card:nth-child(even) .mockup-container {
    animation: floatMockupEven 6s ease-in-out infinite alternate;
}

.product-card:hover .mockup-container {
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg) scale(1.05);
  animation-play-state: paused;
}

.mockup-inner-border {
  width: 100%;
  height: 100%;
  border-radius: 26px;
  overflow: hidden;
  position: relative;
  background: #000;
}

.mockup-screen {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: object-position 6s ease-in-out, filter 0.5s ease;
}

/* Auto-scroll on hover */
.product-card:hover .mockup-screen {
  object-position: bottom;
  transition: object-position 6s linear, filter 0.5s ease;
  filter: brightness(1.1);
}

.mockup-notch {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 38%;
  height: 22px;
  background: #22222c;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  z-index: 5;
}

.mockup-notch::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  box-shadow: 0 0 4px rgba(255,255,255,0.2);
}

/* tags & overlay */
.product-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, var(--accent-purple), var(--violet-glow));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 8px 18px;
  border-radius: 20px;
  z-index: 10;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.5);
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.2);
}

.view-demo-btn {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 12px 26px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 700;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.product-card:hover .view-demo-btn {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.view-demo-btn:hover {
  background: var(--violet-glow);
  border-color: var(--violet-glow);
  box-shadow: 0 0 25px rgba(168,85,247,0.6);
  transform: translateX(-50%) translateY(-3px) scale(1.05); /* Slight pop up */
}

/* animations */
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(60px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatMockup {
  from {
    transform: perspective(1000px) rotateX(5deg) rotateY(-3deg) translateY(0);
  }
  to {
    transform: perspective(1000px) rotateX(5deg) rotateY(-3deg) translateY(-15px);
  }
}

/* Modal */
.product-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(3, 3, 5, 0.9);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s ease-in-out;
}

.product-modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  position: relative;
  transform: scale(0.95);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.product-modal.show .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: -20px;
  right: -20px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 20;
}

@media (max-width: 768px) {
  .modal-close {
    top: -60px;
    right: 0;
  }
}

.modal-close:hover {
  background: var(--violet-glow);
  border-color: var(--violet-glow);
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 0 20px var(--violet-glow);
}

.modal-mockup {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  aspect-ratio: 9 / 19;
  background: #000;
  border-radius: 40px;
  border: 10px solid #22222c;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(255,255,255,0.05);
}

.modal-mockup-inner {
  width: 100%;
  height: 100%;
  overflow-y: auto; 
  scroll-behavior: smooth;
  scrollbar-width: none; 
  -ms-overflow-style: none;  
}
.modal-mockup-inner::-webkit-scrollbar {
  display: none;
}

.modal-mockup img {
  width: 100%;
  display: block;
}

/* Light particles */
.light-particle {
  position: absolute;
  background: var(--violet-glow);
  border-radius: 50%;
  filter: blur(6px);
  opacity: 0.6;
  animation: floatParticle 8s infinite ease-in-out alternate;
  pointer-events: none;
}

@keyframes floatParticle {
  from { transform: translateY(0) translateX(0) scale(1); }
  to { transform: translateY(-100px) translateX(40px) scale(1.6); }
}

/* --- FEATURES SHOWCASE --- */
.features-showcase {
  background-color: var(--bg-dark);
  color: #ffffff;
  padding: 8rem 2rem 2rem;
  position: relative;
  overflow: hidden;
  font-family: 'Manrope', sans-serif;
  z-index: 1;
}

/* Add a background line gradient */
.features-showcase::after {
  content: '';
  position: absolute;
  top: 30%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(168,85,247,0.3), transparent);
  z-index: -1;
}

.features-header {
  text-align: center;
  position: relative;
  z-index: 2;
  margin-bottom: 5rem;
  animation: slideUpFade 1s ease-out forwards;
}

.features-header h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 20%, var(--violet-glow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(168, 85, 247, 0.2);
}

.features-header p {
  font-size: 1.15rem;
  color: #a1a1aa;
  max-width: 600px;
  margin: 0 auto;
}

.features-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

.features-col {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  flex: 1;
}

.left-col {
  align-items: flex-end;
  text-align: right;
}

.right-col {
  align-items: flex-start;
  text-align: left;
}

.features-center {
  position: relative;
  flex: 0 0 300px;
  display: flex;
  justify-content: center;
  z-index: 2;
}

.center-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150%;
  height: 80%;
  background: radial-gradient(circle, rgba(168,85,247,0.4) 0%, transparent 60%);
  filter: blur(40px);
  z-index: -1;
  animation: pulseGlow 4s infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.6; }
  100% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

.center-mockup {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 9 / 19;
  background-color: #050508;
  border-radius: 34px;
  border: 7px solid #22222c;
  box-shadow: inset 0 0 15px rgba(255,255,255,0.05), 0 20px 50px rgba(0,0,0,0.8), 0 0 30px rgba(168,85,247,0.3);
  position: relative;
  transform: perspective(1000px) translateY(0);
  animation: floatMockupCenter 6s ease-in-out infinite alternate;
}

@keyframes floatMockupCenter {
  0% { transform: perspective(1000px) translateY(0); }
  100% { transform: perspective(1000px) translateY(-15px); }
}

.center-mockup img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 26px;
  opacity: 0.9;
}

.feature-card {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: linear-gradient(145deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
  border: 1px solid rgba(255,255,255,0.05);
  padding: 1.2rem 1.5rem;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform: translateY(20px);
  opacity: 0;
  animation: slideUpFade 0.6s ease-out forwards;
  position: relative;
  max-width: 380px;
}

/* Stagger animations */
.left-col .feature-card:nth-child(1) { animation-delay: 0.1s; }
.left-col .feature-card:nth-child(2) { animation-delay: 0.2s; }
.left-col .feature-card:nth-child(3) { animation-delay: 0.3s; }
.left-col .feature-card:nth-child(4) { animation-delay: 0.4s; }

.right-col .feature-card:nth-child(1) { animation-delay: 0.2s; }
.right-col .feature-card:nth-child(2) { animation-delay: 0.3s; }
.right-col .feature-card:nth-child(3) { animation-delay: 0.4s; }
.right-col .feature-card:nth-child(4) { animation-delay: 0.5s; }

.left-col .feature-card {
  flex-direction: row-reverse;
}

.feature-card:hover {
  transform: translateY(-5px) scale(1.03);
  background: linear-gradient(145deg, rgba(168,85,247,0.1), rgba(255,255,255,0.01));
  border-color: rgba(168,85,247,0.5);
  box-shadow: 0 10px 25px rgba(59,7,100,0.6);
}

.feature-icon {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 14px;
  background: rgba(168,85,247,0.1);
  border: 1px solid rgba(168,85,247,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--violet-glow);
  transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
  background: var(--violet-glow);
  color: #fff;
  box-shadow: 0 0 15px var(--violet-glow);
  transform: scale(1.1);
}

.feature-text h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: #fff;
}

.feature-text p {
  font-size: 0.9rem;
  color: #a1a1aa;
  line-height: 1.4;
  margin: 0;
}

/* Connecting lines hint */
.left-col .feature-card::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -30px;
  width: 20px;
  height: 1px;
  background: linear-gradient(90deg, rgba(168,85,247,0.5), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.right-col .feature-card::after {
  content: '';
  position: absolute;
  top: 50%;
  left: -30px;
  width: 20px;
  height: 1px;
  background: linear-gradient(-90deg, rgba(168,85,247,0.5), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.feature-card:hover::after {
  opacity: 1;
}

/* Responsive Features */
@media (max-width: 1024px) {
  .features-layout {
    flex-direction: column;
  }
  .left-col, .right-col {
    align-items: center;
    text-align: center;
    width: 100%;
  }
  .left-col .feature-card {
    flex-direction: row;
    max-width: 450px;
  }
  .feature-card {
    max-width: 450px;
  }
  .left-col .feature-card::after, .right-col .feature-card::after {
    display: none;
  }
  .features-center {
    order: -1;
    margin-bottom: 3rem;
    flex: 0 0 auto;
  }
}


@media (max-width: 1024px) { .products-header h2 { font-size: 3.5rem; } }
@media (max-width: 768px) { .products-header h2 { font-size: 2.8rem; } }
@media (max-width: 480px) { .products-header h2 { font-size: 2.5rem; } }
