/* Dublogs Marketplace — blue & purple theme */
@import url('icons.css');
@import url('animations.css');
@import url('mobile.css');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --purple: #7c3aed;
  --blue: #2563eb;
  --accent: #6366f1;
  --gradient: linear-gradient(135deg, var(--purple) 0%, var(--blue) 100%);
  --bg: #f4f3ff;
  --surface: #ffffff;
  --border: #ddd6fe;
  --text: #1e1b4b;
  --muted: #6b7280;
  --success: #059669;
  --danger: #dc2626;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
  --max: 1140px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 18px; color: var(--text);
  text-decoration: none; white-space: nowrap;
}
.logo:hover { text-decoration: none; }
.logo img, .logo svg { height: 32px; width: auto; max-width: none; flex-shrink: 0; }
.logo-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav a {
  padding: 6px 12px; color: var(--muted); font-size: 14px;
  border-radius: var(--radius); text-decoration: none;
}
.nav a:hover, .nav a.active { color: var(--purple); background: #ede9fe; text-decoration: none; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; text-decoration: none;
  background: var(--gradient); color: #fff;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; color: #fff; box-shadow: var(--shadow); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-outline { background: var(--surface); color: var(--purple); border-color: var(--border); }
.btn-outline:hover { background: #ede9fe; color: var(--purple); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); }
.btn-block { width: 100%; justify-content: center; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0; color: var(--muted); font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.btn-google {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 10px 16px; border-radius: var(--radius);
  background: #fff; color: #1f2937; border: 1px solid #d1d5db;
  font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
  font-family: inherit;
}
.btn-google:hover { background: #f9fafb; border-color: #9ca3af; text-decoration: none; color: #1f2937; }
.btn-google img { width: 18px; height: 18px; }
.btn-google.hidden { display: none; }

.badge {
  background: var(--purple); color: #fff;
  font-size: 11px; padding: 1px 6px; border-radius: 10px; margin-left: 4px;
}

.hero {
  background: var(--gradient);
  color: #fff;
  padding: 56px 0;
}
.hero h1 { font-size: 30px; font-weight: 700; margin-bottom: 12px; }
.hero p { opacity: .92; max-width: 540px; font-size: 16px; }
.hero-actions { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn-outline { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.4); color: #fff; }
.hero .btn-outline:hover { background: rgba(255,255,255,.25); color: #fff; }
.hero .btn { background: #fff; color: var(--purple); }
.hero .btn:hover { color: var(--blue); }

.page { padding: 32px 0 48px; }
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 20px; color: var(--text); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
@media (max-width: 768px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--purple); }

.product-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; transition: box-shadow .15s, border-color .15s;
}
.product-card:hover { border-color: var(--purple); box-shadow: 0 4px 16px rgba(124, 58, 237, 0.15); }
.product-card img { aspect-ratio: 4/3; object-fit: cover; background: #ede9fe; }
.product-card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-cat { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--blue); font-weight: 600; }
.product-name { font-weight: 600; font-size: 14px; }
.product-desc { font-size: 13px; color: var(--muted); flex: 1; }
.product-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.price { font-weight: 700; font-size: 16px; color: var(--purple); }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: var(--muted); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font: inherit; background: var(--surface);
}
.form-group input:focus, .form-group select:focus {
  outline: 2px solid var(--purple); outline-offset: 0;
}
.form-narrow { max-width: 420px; width: 100%; }

/* Centered auth / create-account modal */
.auth-page {
  min-height: 100vh;
  background: var(--bg);
}
.auth-page .site-header { flex-shrink: 0; }
.auth-page-main {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.auth-modal-card {
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 48px rgba(30, 27, 75, 0.14);
}

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}
.auth-modal-overlay.hidden { display: none; }
body.modal-open { overflow: hidden; }

.auth-modal-panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px 24px;
  box-shadow: 0 24px 60px rgba(30, 27, 75, 0.22);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #f4f3ff;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.auth-modal-close:hover { background: #ede9fe; color: var(--purple); }
.auth-modal-panel .page-title { margin-bottom: 16px; text-align: center; }
.auth-modal-sub { text-align: center; font-size: 14px; color: var(--muted); margin: -8px 0 18px; }

/* Standalone auth pages + register modal (matches hero sign-in panel) */
.auth-standalone-card,
.auth-modal-panel.auth-form-panel {
  width: 100%;
  max-width: 420px;
  background: #f4f3ff;
  border: 1px solid #ddd6fe;
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 24px 48px rgba(30, 27, 75, 0.14);
}
.auth-modal-panel.auth-form-panel {
  max-width: 440px;
  padding: 36px 32px 28px;
}
.auth-standalone-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
  text-align: center;
}
.auth-standalone-card .lp-signin-sub,
.auth-modal-panel.auth-form-panel .lp-signin-sub {
  text-align: center;
}
.auth-standalone-card .lp-signin-pills,
.auth-modal-panel.auth-form-panel .lp-signin-pills {
  justify-content: center;
}
.auth-page.landing-page { background: var(--bg); }
.auth-page.landing-page .landing-header { background: #fff; }

.form-icon-field { position: relative; }
.form-icon-field .field-icon {
  position: absolute; left: 12px; bottom: 10px;
  width: 18px; height: 18px; opacity: 0.45; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.form-icon-field .field-icon img { width: 18px; height: 18px; }
.form-icon-field input { padding-left: 40px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 8px 12px; background: #ede9fe; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--purple); border-bottom: 1px solid var(--border); }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.stat-value {
  font-size: 24px; font-weight: 700; margin-top: 4px;
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  padding: 8px 14px; font-size: 14px; cursor: pointer;
  border: none; background: none; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--purple); border-bottom-color: var(--purple); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: var(--success); border: 1px solid #a7f3d0; }
.alert-info { background: #ede9fe; color: var(--purple); border: 1px solid #c4b5fd; }

.site-footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 24px 0; margin-top: 48px; font-size: 13px; color: var(--muted);
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-brand img { height: 22px; }

.cart-overlay { position: fixed; inset: 0; background: rgba(30, 27, 75, .45); z-index: 200; display: none; }
.cart-drawer {
  position: fixed; top: 0; right: -400px; width: 360px; max-width: 92vw;
  height: 100%; background: var(--surface); z-index: 201;
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column; transition: right .2s ease;
}
.cart-drawer.open { right: 0; }
.cart-overlay.open { display: block; }
.cart-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.cart-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.cart-footer { padding: 16px 20px; border-top: 1px solid var(--border); }
.cart-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.cart-item img { width: 48px; height: 48px; object-fit: cover; border-radius: var(--radius); }

.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #ede9fe; color: var(--purple); border: 1px solid var(--border); }
.tag-green { background: #ecfdf5; color: var(--success); border-color: #a7f3d0; }
.tag-yellow { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.tag-red { background: #fef2f2; color: var(--danger); border-color: #fecaca; }

.empty { text-align: center; padding: 40px; color: var(--muted); }
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 100px; }
.bar { flex: 1; background: var(--gradient); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .85; }

.hidden { display: none !important; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 13px; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mb-2 { margin-bottom: 16px; }
.flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
