:root {
  --bg-color: #0f172a; 
  --surface-color: #1e293b;
  --text-primary: #f8fafc; 
  --text-secondary: #94a3b8;
  --accent-color: #10b981; 
  --accent-hover: #059669;
  --danger: #ef4444;
  --success: #34d399;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.hidden {
  display: none !important;
}

html {
  background: #0f172a;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: #0f172a;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

#app {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1200px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.hero {
  text-align: center;
  animation: fadeIn 0.8s ease-out;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: #000000;
  margin-bottom: 1rem;
  letter-spacing: -0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #000000;
  letter-spacing: -0.02em;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.search-box-row {
  display: flex;
  gap: 0.75rem;
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
  align-items: center;
  box-shadow: 0 15px 35px -5px rgba(16, 185, 129, 0.25);
  border-radius: 16px;
  padding: 8px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
  backdrop-filter: blur(16px);
  border: 1px solid rgba(16, 185, 129, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box-row:focus-within {
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.5);
  border-color: #10b981;
  transform: translateY(-2px);
}

#searchInput {
  flex: 1;
  padding: 1rem 1.4rem;
  font-size: 1.1rem;
  background-color: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  border-radius: 12px;
  color: #000000 !important;
  font-weight: 700;
  outline: none;
  transition: all 0.3s ease;
  font-family: inherit;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

#searchInput::placeholder {
  color: #64748b !important;
  font-weight: 500;
}

#districtFilter {
  padding: 0.9rem 1.2rem;
  border-radius: 10px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.95rem;
  background: #0f172a;
  color: #10b981;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: all 0.2s ease;
}

#districtFilter:hover {
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

#searchBtn {
  padding: 0.95rem 2rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  transition: all 0.3s ease;
  font-family: inherit;
}

#searchBtn:hover {
  background: linear-gradient(135deg, #34d399, #10b981);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
  transform: scale(1.03);
}

.hidden {
  display: none !important;
}

#loading {
  text-align: center;
  color: var(--text-secondary);
}

.spinner {
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem auto;
}

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

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background-color: var(--surface-color);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: slideUp 0.4s ease-out backwards;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.5);
  border-color: rgba(16, 185, 129, 0.5);
}

.card-title {
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.4;
  color: var(--text-primary);
}

.card-stockist {
  font-size: 0.85rem;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.card-prices {
  display: flex;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.price-item {
  display: flex;
  flex-direction: column;
}

.price-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.price-value {
  font-weight: 600;
  font-size: 1.1rem;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.5rem;
  width: fit-content;
}

.status-in-stock {
  background-color: rgba(34, 197, 94, 0.2);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-out {
  background-color: rgba(239, 68, 68, 0.2);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

footer {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: auto;
  padding-top: 2rem;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Premium Feature Styles */
.upload-btn {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.upload-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.scan-btn {
  background-color: var(--surface-color);
  color: var(--accent-color);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0 1rem;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.scan-btn:hover {
  background-color: var(--accent-color);
  color: white;
}

.scanner-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}
.scanner-box {
  width: 300px; height: 400px;
  border: 2px solid var(--accent-color);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 20px;
}
.scanner-box p {
  color: white;
  font-weight: bold;
  z-index: 10;
}
.scanner-line {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--accent-color);
  box-shadow: 0 0 20px var(--accent-color);
  animation: scan 2s infinite linear;
}
@keyframes scan {
  0% { top: 0; }
  50% { top: 100%; }
  100% { top: 0; }
}

.order-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-direction: column;
}
.btn-whatsapp {
  flex: 1;
  background-color: #25D366;
  color: white;
  border: none;
  padding: 0.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 0.9rem;
}
.btn-whatsapp:hover { background-color: #128C7E; color: white;}

.btn-email {
  flex: 1;
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 0.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 0.9rem;
}
.btn-email:hover { background-color: #e2e8f0; }

.btn-delivery {
  flex: 1;
  background-color: #fef08a;
  color: #854d0e;
  border: 1px solid #fde047;
  padding: 0.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 0.9rem;
}
.btn-delivery:hover { background-color: #fde047; }
.main-layout {
  display: block;
  margin-top: 2rem;
}

.register-card, .spotify-card {
  background: linear-gradient(135deg, #16a34a, #14532d);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 10px 25px -5px rgba(22, 163, 74, 0.4);
  color: white;
}

.register-card h3, .spotify-card h3 {
  margin-bottom: 0.5rem;
  color: white;
}

.register-card p, .spotify-card p {
  color: #dcfce7 !important;
}

.reg-input {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 0.8rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  font-family: inherit;
  outline: none;
}
.reg-input:focus {
  border-color: var(--accent-color);
}

.reg-btn {
  width: 100%;
  padding: 0.8rem;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}
.reg-btn:hover {
  background-color: var(--accent-hover);
}

/* --- New UI Overhaul Styles --- */

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  background: linear-gradient(135deg, #0f172a 0%, #064e3b 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

#webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  background: transparent;
  display: none;
}

.forest-bg {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: transparent;
  z-index: -1;
  pointer-events: none;
}

.floating-satire {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 50vw;
  max-width: 400px;
  opacity: 0.15;
  z-index: 1;
  pointer-events: none;
  border: none;
  box-shadow: none;
  animation: float-satire 8s ease-in-out infinite;
  mix-blend-mode: overlay;
}

@keyframes float-satire {
  0% { transform: translate(-50%, -50%) rotate(-2deg); }
  50% { transform: translate(-50%, -55%) rotate(3deg); }
  100% { transform: translate(-50%, -50%) rotate(-2deg); }
}

.text-3d {
  font-weight: 800;
  color: #000000;
  text-shadow: 
    0 1px 0 #cccccc, 
    0 2px 0 #c9c9c9, 
    0 3px 0 #bbb, 
    0 4px 0 #b9b9b9, 
    0 5px 0 #aaa, 
    0 6px 1px rgba(0,0,0,.1), 
    0 0 5px rgba(0,0,0,.1), 
    0 1px 3px rgba(0,0,0,.3), 
    0 3px 5px rgba(0,0,0,.2), 
    0 5px 10px rgba(0,0,0,.25), 
    0 10px 10px rgba(0,0,0,.2), 
    0 20px 20px rgba(0,0,0,.15);
}

.marquee-text {
  animation: scrollText 12s linear infinite;
}

@keyframes scrollText {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Cart Styles */
.cart-floating-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--accent-color);
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  cursor: pointer;
  z-index: 999;
  transition: transform 0.2s;
}

.cart-floating-btn:hover {
  transform: scale(1.1);
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--danger);
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  height: 100vh;
  background: var(--surface-color);
  box-shadow: -10px 0 30px rgba(0,0,0,0.2);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  color: var(--text-primary);
}

.cart-sidebar.hidden {
  transform: translateX(100%);
  display: flex !important; /* Override the universal hidden class so it slides out instead of instantly disappearing */
}

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f172a;
}

.close-cart {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #0f172a;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  background: #0f172a;
}

.delivery-section {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  color: var(--text-primary);
}

/* Floating Spotify Player */
.spotify-floating-container {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.spotify-bubble {
  width: 60px;
  height: 60px;
  background: #1db954; /* Spotify Green */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: white;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
}

.spotify-bubble:hover {
  transform: scale(1.1);
  background: #1ed760;
}

.spotify-player-card {
  position: absolute;
  bottom: 75px;
  left: 0;
  width: 300px;
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.spotify-player-card.hidden {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  visibility: hidden;
  pointer-events: none;
}

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

/* Delivery Marquee */
.delivery-marquee-container {
  position: fixed;
  bottom: 20px;
  left: 0;
  width: 100%;
  overflow: hidden;
  z-index: 1000;
  pointer-events: none;
}

.delivery-marquee {
  display: inline-block;
  white-space: nowrap;
  animation: drive 12s linear infinite;
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.8);
  padding: 8px 20px;
  border-radius: 30px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(74, 222, 128, 0.5);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

@keyframes drive {
  0% { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}

@media (max-width: 600px) {
  .cart-sidebar {
    width: 100vw;
  }
  .close-cart {
    font-size: 2.5rem;
    padding: 10px;
  }
}

/* Gently floating 3D elements */
.floating-3d-left {
  position: fixed;
  left: 2%;
  top: 25%;
  width: 90px;
  height: auto;
  z-index: -5 !important;
  pointer-events: none;
  animation: floatUpAndDown 6s ease-in-out infinite;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.4));
  opacity: 0.3;
  display: none;
}

.floating-3d-right {
  position: fixed;
  right: 2%;
  top: 45%;
  width: 80px;
  height: auto;
  z-index: -5 !important;
  pointer-events: none;
  animation: floatUpAndDown 8s ease-in-out infinite alternate;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.4)) rotate(45deg);
  opacity: 0.3;
  display: none;
}

@keyframes floatUpAndDown {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(10deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

@media (max-width: 1024px) {
  .floating-3d-left, .floating-3d-right {
    display: none;
  }
}

/* ── Global Marquee Ticker (always visible, above login) ── */
.marquee-container-global {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9998;
  overflow: hidden;
  white-space: nowrap;
  background: rgba(6, 98, 59, 0.88);
  backdrop-filter: blur(4px);
  padding: 6px 0;
  border-bottom: 1px solid rgba(74, 222, 128, 0.4);
}

.marquee-text-global {
  display: inline-block;
  animation: globalMarqueeScroll 30s linear infinite;
  white-space: nowrap;
  padding-left: 100%;
}

@keyframes globalMarqueeScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* push login overlay down so it doesn't overlap the ticker */
#loginOverlay {
  top: 34px !important;
  height: calc(100vh - 34px) !important;
  z-index: 999999 !important;
  background: #0f172a !important;
}



/* --- Comic Search Animations --- */

@keyframes comic-spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes speed-rush {
  0% { transform: translateY(0); }
  100% { transform: translateY(-40px); }
}

@keyframes comic-pop {
  0% { transform: rotate(-5deg) scale(0); opacity: 0; }
  50% { transform: rotate(5deg) scale(1.2); opacity: 1; }
  100% { transform: rotate(-5deg) scale(1); opacity: 1; }
}

.comic-burst {
  top: 50%;
  left: 50%;
}



/* --- Cybernetic Third Eye Scanner Animations --- */

@keyframes cyber-grid-pan {
  0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
  100% { transform: perspective(500px) rotateX(60deg) translateY(40px); }
}

@keyframes radar-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes radar-spin-reverse {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

@keyframes eye-pulse {
  0% { transform: scale(1); opacity: 0.8; box-shadow: inset 0 0 20px #000, 0 0 30px #34d399; }
  100% { transform: scale(1.1); opacity: 1; box-shadow: inset 0 0 10px #000, 0 0 70px #10b981; }
}

@keyframes scan-bar {
  0% { transform: translateX(0); }
  100% { transform: translateX(400%); }
}

@keyframes blink-cursor {
  50% { border-color: transparent; }
}



@keyframes comic-pop {
  0% { transform: scale(0); opacity: 0; }
  80% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  #app {
    padding: 1rem;
    gap: 1.5rem;
  }
  
  .search-box-row {
    flex-direction: column;
    align-items: stretch;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.2);
    gap: 0.65rem;
    padding: 10px;
    border-radius: 16px;
  }

  #searchInput, #districtFilter, #searchBtn, #thirdEyeBtn {
    width: 100%;
    margin: 0;
    border-radius: 10px;
  }
  
  #searchInput {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
    color: #000000 !important;
  }

  h1 {
    font-size: 1.8rem;
  }
  
  .logo {
    font-size: 1.2rem;
  }
}
