/* ============================================================
   style.css — Global Styles for Amazon Affiliate Directory
   Theme: Dark Mode · Glassmorphism · Electric Blue Accents
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* ── CSS Custom Properties ────────────────────────────────── */
:root {
  /* Colors */
  --bg-void:       #06060e;
  --bg-deep:       #0c0c1a;
  --bg-surface:    #111128;
  --bg-card:       rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.07);

  --blue-glow:     #00b4ff;
  --blue-light:    #4dd9ff;
  --blue-dim:      rgba(0,180,255,0.12);
  --gold:          #f5c842;
  --gold-dim:      rgba(245,200,66,0.12);

  --text-primary:  #f0f0ff;
  --text-secondary:#9494b8;
  --text-muted:    #4a4a6a;

  --border:        rgba(255,255,255,0.07);
  --border-glow:   rgba(0,180,255,0.35);

  /* Radii */
  --r-sm:  10px;
  --r-md:  18px;
  --r-lg:  26px;
  --r-xl:  36px;

  /* Shadows */
  --shadow-card:  0 4px 32px rgba(0,0,0,0.45);
  --shadow-glow:  0 0 28px rgba(0,180,255,0.22);
  --shadow-gold:  0 0 22px rgba(245,200,66,0.28);

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  /* Transitions */
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  background-color: var(--bg-void);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated background grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,180,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,180,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* Ambient glow blobs */
body::after {
  content: '';
  position: fixed;
  top: -20%;
  right: -15%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(0,100,200,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Utility ──────────────────────────────────────────────── */
.container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.glass {
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.gold-text { color: var(--gold); }
.blue-text { color: var(--blue-glow); }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--blue-dim); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue-glow); }

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 0;
  background: rgba(6,6,14,0.82);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.navbar .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--blue-glow), #005fff);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.brand-name span { color: var(--blue-glow); }

.nav-pill {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid rgba(245,200,66,0.2);
  border-radius: 99px;
  padding: 4px 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Search Bar ───────────────────────────────────────────── */
.search-wrap {
  padding: 40px 0 28px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 14px 20px;
  backdrop-filter: blur(18px);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.search-box:focus-within {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.search-icon { color: var(--text-muted); font-size: 1.1rem; flex-shrink: 0; }

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
}

.search-input::placeholder { color: var(--text-muted); }

.search-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Hero Section ─────────────────────────────────────────── */
.hero {
  padding: 64px 0 24px;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue-dim);
  border: 1px solid rgba(0,180,255,0.2);
  border-radius: 99px;
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue-light);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero-badge .dot {
  width: 6px; height: 6px;
  background: var(--blue-glow);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
}

.hero h1 .accent { color: var(--blue-glow); }

.hero p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 540px;
  line-height: 1.65;
}

/* ── Section Labels ───────────────────────────────────────── */
.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Product Grid ─────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 60px;
}

/* ── Product Card ─────────────────────────────────────────── */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.3s;
  cursor: pointer;
  position: relative;
  animation: card-in 0.5s var(--ease) both;
}

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

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow), var(--shadow-card);
  border-color: rgba(0,180,255,0.25);
}

/* Top glow strip on hover */
.product-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue-glow), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

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

.card-image-wrap {
  position: relative;
  height: 220px;
  background: var(--bg-surface);
  overflow: hidden;
}

.card-image-wrap img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 16px;
  transition: transform 0.5s var(--ease);
}

.product-card:hover .card-image-wrap img { transform: scale(1.06); }

.card-badge {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--gold);
  color: #111;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 6px;
  padding: 3px 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.card-body { padding: 18px; }

.card-title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-price {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold);
}

.card-price .rupee { font-size: 1rem; opacity: 0.8; }

.card-stars {
  display: flex;
  gap: 2px;
  color: var(--gold);
  font-size: 0.75rem;
}

.btn-amazon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--blue-glow) 0%, #0056e0 100%);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.25s var(--ease), transform 0.2s var(--ease), box-shadow 0.25s;
  letter-spacing: 0.2px;
}

.btn-amazon:hover {
  filter: brightness(1.15);
  box-shadow: 0 6px 24px rgba(0,180,255,0.4);
  transform: translateY(-1px);
}

.btn-amazon:active { transform: scale(0.97); }

.btn-amazon svg { width: 16px; height: 16px; }

/* ── Skeleton Loaders ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-card-hover) 50%, var(--bg-surface) 75%);
  background-size: 400% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-sm);
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to   { background-position: -100% 0; }
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.sk-img  { height: 220px; }
.sk-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.sk-title { height: 14px; width: 85%; }
.sk-title2 { height: 14px; width: 60%; }
.sk-price { height: 22px; width: 40%; margin-top: 4px; }
.sk-btn   { height: 44px; width: 100%; margin-top: 8px; border-radius: var(--r-md) !important; }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
  text-align: center;
}

.empty-icon { font-size: 3.5rem; opacity: 0.25; }
.empty-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.empty-sub { font-size: 0.9rem; color: var(--text-muted); }

/* ── Toast Notification ───────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glow);
  border-radius: var(--r-md);
  padding: 14px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-glow);
  transform: translateY(80px);
  opacity: 0;
  transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
}

#toast.show {
  transform: translateY(0);
  opacity: 1;
}

#toast.success { border-color: #00e57a; }
#toast.error   { border-color: #ff4e4e; }

/* ── Footer ───────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

footer a { color: var(--blue-glow); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════
   ADMIN STYLES
   ════════════════════════════════════════════════════════════ */

.admin-body {
  background: var(--bg-void);
}

/* Login Overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,6,14,0.97);
  backdrop-filter: blur(30px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-card h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.login-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* Admin layout */
.admin-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 32px 0 60px;
}

@media (min-width: 900px) {
  .admin-layout {
    grid-template-columns: 420px 1fr;
    align-items: start;
  }
}

/* Admin Panel Card */
.admin-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 30px;
  backdrop-filter: blur(18px);
  position: sticky;
  top: 90px;
}

.admin-panel h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-panel h2 .icon-chip {
  width: 32px; height: 32px;
  background: var(--blue-dim);
  border: 1px solid rgba(0,180,255,0.2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

/* Form Fields */
.field-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }

.field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.field-input, .field-textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.93rem;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
  width: 100%;
}

.field-input:focus, .field-textarea:focus {
  border-color: var(--border-glow);
  box-shadow: 0 0 0 3px rgba(0,180,255,0.1);
}

.field-textarea { resize: vertical; min-height: 90px; line-height: 1.5; }

/* URL Converter Row */
.url-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.url-row .field-input { flex: 1; }

.btn-extract {
  padding: 12px 16px;
  background: var(--blue-dim);
  border: 1px solid rgba(0,180,255,0.25);
  border-radius: var(--r-md);
  color: var(--blue-light);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.25s, box-shadow 0.25s;
  flex-shrink: 0;
}

.btn-extract:hover {
  background: rgba(0,180,255,0.2);
  box-shadow: var(--shadow-glow);
}

/* Affiliate Link Preview */
.affiliate-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,180,255,0.06);
  border: 1px solid rgba(0,180,255,0.15);
  border-radius: var(--r-md);
  padding: 10px 14px;
  margin-bottom: 18px;
  font-size: 0.78rem;
  color: var(--blue-light);
  word-break: break-all;
  line-height: 1.4;
  transition: opacity 0.3s;
}

.affiliate-preview .label {
  font-weight: 700;
  color: var(--blue-glow);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Publish Button */
.btn-publish {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 20px;
  background: linear-gradient(135deg, var(--blue-glow) 0%, #004ccc 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: filter 0.25s var(--ease), transform 0.2s, box-shadow 0.25s;
  margin-top: 4px;
}

.btn-publish:hover {
  filter: brightness(1.12);
  box-shadow: 0 8px 28px rgba(0,180,255,0.45);
  transform: translateY(-2px);
}

.btn-publish:active { transform: scale(0.97); }

.btn-publish:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 22px 0;
}

/* Image Preview */
.img-preview-wrap {
  position: relative;
  height: 160px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.img-preview-wrap img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  padding: 10px;
  display: none;
}

.img-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.img-preview-placeholder .ph-icon { font-size: 2rem; opacity: 0.3; }

/* Product List (Admin right panel) */
.admin-product-list { display: flex; flex-direction: column; gap: 14px; }

.admin-product-list h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-product-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  backdrop-filter: blur(14px);
  transition: border-color 0.25s;
  animation: card-in 0.4s var(--ease) both;
}

.admin-product-item:hover { border-color: rgba(255,255,255,0.12); }

.admin-product-img {
  width: 72px; height: 72px;
  object-fit: contain;
  border-radius: var(--r-sm);
  background: var(--bg-surface);
  padding: 6px;
}

.admin-product-info .title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.admin-product-info .price {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 4px;
}

.admin-product-info .asin {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: monospace;
}

.btn-delete {
  background: rgba(255,80,80,0.1);
  border: 1px solid rgba(255,80,80,0.2);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  color: #ff6666;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.btn-delete:hover {
  background: rgba(255,80,80,0.2);
  box-shadow: 0 0 12px rgba(255,80,80,0.25);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero h1 { letter-spacing: -0.8px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
  .admin-panel { padding: 22px; }
  .login-card { padding: 32px 22px; }
}

@media (max-width: 400px) {
  .product-grid { grid-template-columns: 1fr; }
}

/* ── Print / perf hints ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
