/* ═══════════════════════════════════════════════════
   ELITEVIEW.SHOP — Global Stylesheet
   Tokens + Base styles only. NO page-specific logic.
   Themes: rose (default), teal, sea, gold
   ═══════════════════════════════════════════════════ */

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html, body { min-height: 100%; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ═══════════ THEMES ═══════════ */

/* ─── ROSE (default) ─── */
:root,
[data-theme="rose"] {
  --primary:        #e11d48;
  --primary-dark:   #be123c;
  --primary-light:  #fecdd3;
  --primary-soft:   #fff1f2;
  --accent:         #f43f5e;

  --bg:             #fff8f9;
  --surface:        #ffffff;
  --surface-2:      #fdf2f4;
  --border:         #fecdd3;

  --text:           #1f1114;
  --text-muted:     #6b4a52;
  --text-dim:       #9c8088;

  --success:        #16a34a;
  --warn:           #d97706;
  --error:          #dc2626;
  --info:           #0284c7;

  --shadow-sm:      0 1px 2px rgba(225,29,72,.06);
  --shadow:         0 4px 14px rgba(225,29,72,.10);
  --shadow-lg:      0 10px 30px rgba(225,29,72,.14);

  --radius-sm:      8px;
  --radius:         12px;
  --radius-lg:      18px;
  --radius-xl:      24px;

  --gradient:       linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
}

/* ─── TEAL ─── */
[data-theme="teal"] {
  --primary:        #0d9488;
  --primary-dark:   #0f766e;
  --primary-light:  #99f6e4;
  --primary-soft:   #f0fdfa;
  --accent:         #14b8a6;

  --bg:             #f6fefc;
  --surface:        #ffffff;
  --surface-2:      #ecfdf5;
  --border:         #99f6e4;

  --text:           #0f1f1d;
  --text-muted:     #4c6a66;
  --text-dim:       #7d9692;

  --gradient:       linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
  --shadow-sm:      0 1px 2px rgba(13,148,136,.06);
  --shadow:         0 4px 14px rgba(13,148,136,.10);
  --shadow-lg:      0 10px 30px rgba(13,148,136,.14);
}

/* ─── SEA ─── */
[data-theme="sea"] {
  --primary:        #0369a1;
  --primary-dark:   #075985;
  --primary-light:  #bae6fd;
  --primary-soft:   #f0f9ff;
  --accent:         #0ea5e9;

  --bg:             #f7fbfd;
  --surface:        #ffffff;
  --surface-2:      #eff6ff;
  --border:         #bae6fd;

  --text:           #0c1a2b;
  --text-muted:     #4a6278;
  --text-dim:       #7a8ca0;

  --gradient:       linear-gradient(135deg, #0369a1 0%, #0ea5e9 100%);
  --shadow-sm:      0 1px 2px rgba(3,105,161,.06);
  --shadow:         0 4px 14px rgba(3,105,161,.10);
  --shadow-lg:      0 10px 30px rgba(3,105,161,.14);
}

/* ─── GOLD ─── */

/* ═══════════ BASE ═══════════ */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; color: var(--text); }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }
p  { color: var(--text-muted); }

/* ═══════════ CONTAINERS ═══════════ */
.container { width: 100%; max-width: 560px; margin: 0 auto; padding: 16px; }
.container-lg { max-width: 900px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.card-grad {
  background: var(--gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
}
.card-grad p, .card-grad h1, .card-grad h2, .card-grad h3 { color: #fff; }

/* ═══════════ BUTTONS ═══════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
  min-height: 46px;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-primary:hover { box-shadow: var(--shadow-lg); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--primary-dark);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--primary-light); }

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--primary-soft); }

.btn-danger {
  background: var(--error);
  color: #fff;
}

.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; min-height: 36px; font-size: 13px; }

/* ═══════════ FORMS ═══════════ */
.field { margin-bottom: 14px; }
.label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.input, .select, .textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
  min-height: 46px;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.input::placeholder { color: var(--text-dim); }
.textarea { min-height: 96px; resize: vertical; }

/* ═══════════ BADGES ═══════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warn    { background: #fef3c7; color: #b45309; }
.badge-error   { background: #fee2e2; color: #b91c1c; }
.badge-info    { background: #dbeafe; color: #1d4ed8; }

/* ═══════════ LAYOUT HELPERS ═══════════ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 12px; }

.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }

.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 22px; font-weight: 700; }

.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-error   { color: var(--error); }

.bold { font-weight: 700; }
.hide { display: none !important; }

/* ═══════════ SPINNER ═══════════ */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════ BOTTOM NAV ═══════════ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
}
.bottom-nav a {
  flex: 1;
  text-align: center;
  padding: 6px 4px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
}
.bottom-nav a.active { color: var(--primary); font-weight: 600; }
.bottom-nav a .ico { font-size: 20px; display: block; margin-bottom: 2px; }

.has-bottom-nav { padding-bottom: 80px; }

/* ═══════════ SCROLLBAR ═══════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ═══════════ UTILITY ═══════════ */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (min-width: 720px) {
  .container { padding: 24px; }
}

/* ═══════════ DARK MODE ═══════════ */
/* One data-mode="dark" block per theme. Variables only — no logic. */

/* Shared dark defaults (apply to all themes in dark mode) */
[data-mode="dark"] {
  --bg:             #0b0d10;
  --surface:        #14171c;
  --surface-2:      #1a1e24;
  --border:         #252a32;
  --text:           #e6e9ef;
  --text-muted:     #9aa3b2;
  --text-dim:       #6b7280;
  --shadow-sm:      0 1px 2px rgba(0,0,0,.35);
  --shadow:         0 6px 18px rgba(0,0,0,.45);
  --shadow-lg:      0 14px 34px rgba(0,0,0,.55);
}

/* ─── ROSE DARK ─── */
[data-mode="dark"][data-theme="rose"],
[data-mode="dark"]:not([data-theme]) {
  --primary:        #fb7185;
  --primary-dark:   #e11d48;
  --primary-light:  #881337;
  --primary-soft:   rgba(251,113,133,.12);
  --accent:         #fb7185;
  --gradient:       linear-gradient(135deg, #e11d48 0%, #fb7185 100%);
}

/* ─── TEAL DARK ─── */
[data-mode="dark"][data-theme="teal"] {
  --primary:        #2dd4bf;
  --primary-dark:   #0d9488;
  --primary-light:  #134e4a;
  --primary-soft:   rgba(45,212,191,.12);
  --accent:         #2dd4bf;
  --gradient:       linear-gradient(135deg, #0d9488 0%, #2dd4bf 100%);
}

/* ─── SEA DARK ─── */
[data-mode="dark"][data-theme="sea"] {
  --primary:        #38bdf8;
  --primary-dark:   #0284c7;
  --primary-light:  #0c4a6e;
  --primary-soft:   rgba(56,189,248,.12);
  --accent:         #38bdf8;
  --gradient:       linear-gradient(135deg, #0369a1 0%, #38bdf8 100%);
}

/* ─── GOLD DARK ─── */
[data-mode="dark"]

/* ─── COLOR ADJUSTMENTS FOR DARK ─── */
[data-mode="dark"] body { background: var(--bg); color: var(--text); }
[data-mode="dark"] .btn-secondary { background: var(--surface-2); color: var(--primary); border-color: var(--border); }
[data-mode="dark"] .input, [data-mode="dark"] .select, [data-mode="dark"] .textarea { background: var(--surface-2); color: var(--text); border-color: var(--border); }
[data-mode="dark"] .input::placeholder { color: var(--text-dim); }
[data-mode="dark"] ::-webkit-scrollbar-thumb { background: #2a2f37; }


/* ═══ SHIMMER PLACEHOLDERS for loading data ═══ */
.shim-text {
  display: inline-block;
  background: linear-gradient(90deg, #eef0f3 0%, #e2e8f0 50%, #eef0f3 100%);
  background-size: 200% 100%;
  animation: shim 1.4s ease-in-out infinite;
  border-radius: 6px;
  color: transparent !important;
  user-select: none;
  min-width: 60px;
  vertical-align: middle;
}
[data-mode="dark"] .shim-text {
  background: linear-gradient(90deg, #1a1e24 0%, #252a32 50%, #1a1e24 100%);
  background-size: 200% 100%;
}
.shim-circle {
  display: inline-block;
  background: linear-gradient(90deg, #eef0f3 0%, #e2e8f0 50%, #eef0f3 100%);
  background-size: 200% 100%;
  animation: shim 1.4s ease-in-out infinite;
  border-radius: 50%;
  color: transparent !important;
}
[data-mode="dark"] .shim-circle {
  background: linear-gradient(90deg, #1a1e24 0%, #252a32 50%, #1a1e24 100%);
  background-size: 200% 100%;
}
@keyframes shim { to { background-position: -200% 0; } }
