/* Base Styles */
:root {
  --primary: #9d00ff;
  --secondary: #00e5ff;
  --accent: #ff00e5;
  --background: #050510;
  --card-bg: rgba(20, 20, 40, 0.7);
  --text-primary: #ffffff;
  --text-secondary: #b8b8ff;
  --glow-primary: 0 0 10px rgba(157, 0, 255, 0.7), 0 0 20px rgba(157, 0, 255, 0.5);
  --glow-secondary: 0 0 10px rgba(0, 229, 255, 0.7), 0 0 20px rgba(0, 229, 255, 0.5);
  --glow-accent: 0 0 10px rgba(255, 0, 229, 0.7), 0 0 20px rgba(255, 0, 229, 0.5);
  --card-width: 300px;
  --card-height: 420px;
  --carousel-radius: 400px;
  --transition-speed: 0.5s;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
html {
  min-height: 100%;
  font-family: "Chakra Petch", sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
}

.title {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 15px rgba(157, 0, 255, 0.5);
  animation: pulse 3s infinite alternate;
}

/* Cosmic Background */
.cosmos-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
  overflow: hidden;
}

.stars-container {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(1px 1px at 25% 25%, white, rgba(0, 0, 0, 0)),
    radial-gradient(1px 1px at 50% 50%, white, rgba(0, 0, 0, 0)),
    radial-gradient(2px 2px at 75% 75%, white, rgba(0, 0, 0, 0)),
    radial-gradient(2px 2px at 100% 100%, white, rgba(0, 0, 0, 0));
  background-size: 200px 200px, 300px 300px, 400px 400px, 600px 600px;
  background-repeat: repeat;
  animation: twinkle 10s linear infinite;
}

@keyframes twinkle {
  0% {
    background-position: 0 0, 0 0, 0 0, 0 0;
  }
  100% {
    background-position: 200px 200px, 300px 300px, 400px 400px, 600px 600px;
  }
}

/* Carousel Container */
.carousel-container {
  position: relative;
  width: 100%;
  height: 500px;
  perspective: 1000px;
  transform-style: preserve-3d;
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: none;
  margin-top: 96px;
}

.carousel {
  position: relative;
  width: var(--carousel-radius);
  height: var(--carousel-radius);
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
  cursor: grab;
}

/* Memory Cards */
.memory-card {
  position: absolute;
  width: var(--card-width);
  height: var(--card-height);
  left: 50%;
  top: 50%;
  margin-left: calc(var(--card-width) / -2);
  margin-top: calc(var(--card-height) / -2);
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.memory-card:hover .card-inner { transform: translateZ(20px); }
.dragging { cursor: grabbing !important; }

.memory-card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.card-front {
  background: linear-gradient(135deg, rgba(30, 30, 60, 0.8), rgba(20, 20, 40, 0.9));
  border: 1px solid rgba(157, 0, 255, 0.3);
  transform-style: preserve-3d;
}

.card-back {
  background: linear-gradient(135deg, rgba(20, 20, 40, 0.9), rgba(30, 30, 60, 0.8));
  border: 1px solid rgba(0, 229, 255, 0.3);
  transform: rotateY(180deg);
}

.card-content {
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.memory-date {
  font-family: "Orbitron", sans-serif;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 10px;
  text-shadow: 0 0 5px rgba(255, 0, 229, 0.7);
}

.memory-card h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.memory-image {
  width: 100%;
  height: 150px;
  margin-bottom: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
}

.memory-image i {
  color: var(--primary);
  font-size: 4rem;
  text-shadow: var(--glow-primary);
  animation: pulse 3s infinite alternate;
  z-index: 2;
}

.glitch-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent 65%, rgba(157, 0, 255, 0.3) 70%, transparent 75%);
  background-size: 200% 200%;
  animation: glitch 3s linear infinite;
  z-index: 1;
}

@keyframes glitch {
  0% { background-position: 0 0; }
  25% { background-position: 100% 0; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0 100%; }
  100% { background-position: 0 0; }
}

.memory-preview {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 15px;
  flex-grow: 1;
}

.card-back .card-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
  flex-grow: 1;
}

.memory-coordinates {
  font-family: "Orbitron", sans-serif;
  font-size: 0.8rem;
  color: var(--secondary);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.time-stamp { color: var(--accent); }

.card-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 15px;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(157, 0, 255, 0.1), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.memory-card:hover .card-glow { opacity: 1; }

/* Carousel Controls */
.carousel-controls {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 10;
}

.control-btn {
  background: rgba(20, 20, 40, 0.7);
  border: 1px solid var(--primary);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--glow-primary);
}

.control-btn:hover {
  background: rgba(30, 30, 60, 0.9);
  transform: scale(1.1);
}

/* Footer */
footer { position: relative; z-index: 10; }

.instructions { font-size: 0.8rem; color: var(--text-secondary); opacity: 0.7; }

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  :root {
    --card-width: 250px;
    --card-height: 350px;
    --carousel-radius: 300px;
  }
  .title { font-size: 1.8rem; }
  .carousel-container { height: 400px; }
  .memory-card h3 { font-size: 1.2rem; }
  .memory-image { height: 120px; }
}

@media (max-width: 576px) {
  :root {
    --card-width: 220px;
    --card-height: 320px;
    --carousel-radius: 250px;
  }
  .title { font-size: 1.5rem; }
  .carousel-container { height: 350px; }
}

/* Layout overrides to keep categories fixed at top and allow page scroll */
body { display: block; overflow-y: auto; }
main { padding-top: 18px; padding-bottom: 140px; }

/* Products hero */
.products-hero { max-width:1100px; margin: 28px auto 6px; padding: 0 20px; }
.products-hero h1 { font-size: clamp(2.2rem, 4.8vw, 3.2rem); line-height:1.08; color: var(--accent); letter-spacing:-0.5px; margin-bottom:8px; }
.products-hero p { color: var(--muted); }

/* Fashionable scrollbars */
/* WebKit-based browsers */
html::-webkit-scrollbar { width: 10px; }
html::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); }
html::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 10px;
}
html::-webkit-scrollbar-thumb:hover { filter: brightness(1.1); }

/* Firefox */
html { scrollbar-width: thin; scrollbar-color: var(--accent) rgba(255,255,255,0.06); }

/* Option: Hide scrollbar entirely but keep scrolling */
/* Comment out the 3 rules below if you prefer visible styled scrollbar */
html { scrollbar-width: none; }
html::-webkit-scrollbar { width: 0; height: 0; }
body { -ms-overflow-style: none; }

