/* InstaQR AI — Custom Styles */

* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body { font-feature-settings: "kern" 1, "liga" 1; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg,#a855f7,#06b6d4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg,#c084fc,#22d3ee); }

/* Glass effect */
.glass {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
}

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fadeIn .25s ease;
}
.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(30,27,75,0.95), rgba(15,23,42,0.95));
  border: 1px solid rgba(168,85,247,0.3);
  border-radius: 24px;
  padding: 2rem;
  animation: slideUp .35s ease;
  box-shadow: 0 25px 50px -12px rgba(168,85,247,0.25);
}
.modal-card.wide { max-width: 800px; }
.modal-card.xl { max-width: 1000px; }

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

/* Form inputs */
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.85rem; color: #cbd5e1; margin-bottom: 0.4rem; font-weight: 600; }
.input, .textarea, .select {
  width: 100%;
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  color: #f1f5f9;
  font-size: 0.95rem;
  transition: all .2s ease;
  font-family: inherit;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168,85,247,0.15);
}
.textarea { resize: vertical; min-height: 80px; }
.input::placeholder, .textarea::placeholder { color: #64748b; }

.file-drop {
  border: 2px dashed rgba(168,85,247,0.3);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: rgba(15,23,42,0.4);
}
.file-drop:hover { border-color: #a855f7; background: rgba(168,85,247,0.05); }
.file-drop.has-file { border-style: solid; border-color: #10b981; background: rgba(16,185,129,0.05); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all .2s ease;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: white;
  box-shadow: 0 4px 14px rgba(168,85,247,0.4);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(168,85,247,0.6); }
.btn-secondary { background: rgba(255,255,255,0.06); color: #e2e8f0; border: 1px solid rgba(255,255,255,0.1); }
.btn-secondary:hover { background: rgba(255,255,255,0.12); }
.btn-danger { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-ghost { background: transparent; color: #cbd5e1; }
.btn-ghost:hover { background: rgba(255,255,255,0.05); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  border-radius: 999px;
  font-weight: 600;
}
.badge-purple { background: rgba(168,85,247,0.15); color: #d8b4fe; }
.badge-green { background: rgba(16,185,129,0.15); color: #6ee7b7; }
.badge-blue { background: rgba(59,130,246,0.15); color: #93c5fd; }
.badge-yellow { background: rgba(234,179,8,0.15); color: #fde047; }
.badge-red { background: rgba(239,68,68,0.15); color: #fca5a5; }

/* Cards */
.store-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 1rem;
  transition: all .25s;
}
.store-card:hover { border-color: rgba(168,85,247,0.4); background: rgba(168,85,247,0.05); transform: translateY(-2px); }
.store-thumb {
  width: 64px; height: 64px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid rgba(168,85,247,0.3);
}

/* Product card */
.product-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  transition: all .2s;
}
.product-card:hover { background: rgba(255,255,255,0.06); }
.product-img {
  width: 70px; height: 70px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: linear-gradient(135deg, #a855f7, #06b6d4);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.5rem;
}

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 0.9rem 1.4rem;
  background: rgba(15,23,42,0.95);
  border: 1px solid rgba(168,85,247,0.4);
  border-radius: 14px;
  color: #f1f5f9;
  font-weight: 500;
  z-index: 200;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  animation: slideUp .3s ease;
}
.toast.success { border-color: rgba(16,185,129,0.5); }
.toast.error { border-color: rgba(239,68,68,0.5); }
.toast.info { border-color: rgba(59,130,246,0.5); }

/* Tabs */
.tabs { display: flex; gap: 0.25rem; background: rgba(15,23,42,0.6); padding: 0.25rem; border-radius: 12px; margin-bottom: 1rem; }
.tab {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 10px;
  color: #94a3b8;
  cursor: pointer;
  text-align: center;
  font-weight: 600;
  transition: all .2s;
}
.tab.active { background: linear-gradient(135deg,#a855f7,#ec4899); color: white; }

/* 3D model card */
.model-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 0.5rem;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  font-size: 0.75rem;
}
.model-card:hover { border-color: #a855f7; transform: scale(1.05); }
.model-card.active { border-color: #a855f7; background: rgba(168,85,247,0.15); }
.model-emoji { font-size: 2rem; }

/* Public store page */
.public-hero {
  min-height: 40vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 5rem 1rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  color: #1e293b;
}
.public-hero h1, .public-hero h2, .public-hero h3 { color: #0f172a; }
.public-hero p, .public-hero .badge { color: #334155; }
.public-hero::before {
  content: ''; position: absolute; inset: 0;
  background: var(--hero-gradient, linear-gradient(135deg, #a855f7, #ec4899));
  opacity: 0.25;
  z-index: -1;
}
.public-logo {
  width: 110px; height: 110px;
  border-radius: 28px;
  object-fit: cover;
  border: 4px solid rgba(255,255,255,0.2);
  margin-bottom: 1.2rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.public-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}
.public-product {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  overflow: hidden;
  transition: all .3s;
}
.public-product:hover { transform: translateY(-4px); border-color: rgba(168,85,247,0.4); }
.public-product img { width: 100%; height: 180px; object-fit: cover; }
.public-product video { width: 100%; height: 180px; object-fit: cover; }
.public-product-body { padding: 1rem; }
.public-product-price { color: #34d399; font-weight: 800; font-size: 1.2rem; }

/* Animations */
.shimmer {
  background: linear-gradient(90deg, transparent, rgba(168,85,247,0.1), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }

/* Loader */
.loader {
  width: 40px; height: 40px;
  border: 3px solid rgba(168,85,247,0.2);
  border-top-color: #a855f7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Print */
@media print {
  body { background: white; color: black; }
  .no-print { display: none !important; }
  .print-only { display: block !important; }
  .qr-print-page { padding: 0; }
}
.print-only { display: none; }

/* Print QR card */
.qr-print-page {
  background: white;
  color: #0f172a;
  padding: 3rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Cairo', sans-serif;
}
.qr-print-card {
  border: 4px solid #0f172a;
  border-radius: 24px;
  padding: 2.5rem;
  max-width: 480px;
  text-align: center;
  background: white;
}
.qr-print-card img.qr-img {
  width: 280px; height: 280px;
  margin: 0 auto 1.5rem;
  display: block;
}
.qr-print-card h1 { font-size: 1.8rem; font-weight: 900; margin-bottom: 0.5rem; }
.qr-print-card p { color: #475569; margin-bottom: 1rem; }
.qr-print-card .url { background: #f1f5f9; padding: 0.5rem 1rem; border-radius: 8px; font-family: monospace; font-size: 0.85rem; word-break: break-all; }

/* Responsive */
@media (max-width: 640px) {
  .modal-card { padding: 1.25rem; border-radius: 20px; }
  .product-card { flex-direction: column; align-items: flex-start; }
  .product-img { width: 100%; height: 140px; }
}

/* Subscribe banner */
.subscribe-banner {
  background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(6,182,212,0.15));
  border: 1px solid rgba(168,85,247,0.3);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.subscribe-banner .icon {
  width: 50px; height: 50px;
  background: linear-gradient(135deg, #a855f7, #06b6d4);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
