/* dashboard.css
   Consolidated user-facing CSS (merged + deduplicated)
   Place at: /assets/css/dashboard.css
   NOTE: Preview background uses local uploaded file available in your environment:
   --card-bg-url: "/mnt/data/err.jpg"
*/

/* ---------- Theme tokens (Tesla-like) ---------- */
:root{
  --bg: #f5f7fb;
  --card: #ffffff;
  --muted: #6b7280;
  --text: #0f1724;

  /* Tesla-like primary: deep charcoal + red accent */
  --brand-dark: #111214;
  --accent: #cc0000;
  --accent-600: #9a0000;
  --success: #16a34a;
  --danger: #ef4444;

  --radius: 12px;
  --container: 1180px;

  --shadow: 0 16px 40px rgba(16,18,21,0.08);
  --shadow-sm: 0 8px 22px rgba(16,18,21,0.06);

  /* Preview background image (use a real web path in production) */
  --card-bg-url: "/mnt/data/err.jpg";
}

/* ---------- Base / typography ---------- */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial;
  background: linear-gradient(180deg,#f7f9fc 0%, var(--bg) 100%);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.45;
}
.container{max-width:var(--container); margin:0 auto; padding:24px}

/* ---------- Layout grid / topbar / layout ---------- */
.topbar { background: #fff; border-bottom:1px solid #eef2f7; padding:10px 14px; display:flex; align-items:center; gap:12px; position:sticky; top:0; z-index:60 }
.brand { font-weight:800; color:var(--accent); font-size:18px }
.top-actions { margin-left:auto; display:flex; gap:8px; align-items:center }
.icon-btn { background:transparent; border:0; padding:8px; border-radius:8px; cursor:pointer }
.avatar { width:36px;height:36px;border-radius:999px;background:#feeef2;display:inline-flex;align-items:center;justify-content:center;font-weight:700;color:var(--accent) }

.layout { display:flex; gap:18px; max-width:1200px; margin:12px auto; padding:0 12px; align-items:flex-start; }
.main { flex:1; min-width:0 }
aside.drawer { width:300px; min-width:0; }

/* ---------- Cards (default) ---------- */
.card{
  background:var(--card);
  border-radius:var(--radius);
  padding:18px;
  box-shadow:var(--shadow-sm);
  overflow:hidden;
  border: 1px solid rgba(17,18,20,0.04);
}

/* ---------- Global buttons ---------- */
.btn{
  background:var(--accent);
  color:#fff;
  padding:8px 12px;
  border-radius:10px;
  display:inline-block;
  font-weight:700;
  border:0;
  cursor:pointer;
  transition:transform .12s ease, box-shadow .12s ease, opacity .12s ease;
  box-shadow: 0 6px 18px rgba(204,0,0,0.12);
}
.btn:hover{ transform:translateY(-2px); }
.btn.secondary{
  background:transparent;
  color:var(--brand-dark);
  border:1px solid rgba(17,18,20,0.06);
  box-shadow:none;
}
.btn:disabled{ opacity:0.6; cursor:default }

/* ---------- Cars grid ---------- */
#cars-grid,
.cars-grid{
  display:grid !important;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap:16px;
  overflow:visible !important;
  margin-top:14px;
}
@media (max-width: 600px){
  #cars-grid, .cars-grid{ grid-template-columns: repeat(2, 1fr); gap:12px; }
}
@media (max-width: 380px){
  #cars-grid, .cars-grid{ grid-template-columns: 1fr; }
}

/* ---------- Car card ---------- */
.car-card{
  display:flex; flex-direction:column;
  background:#fff; border:1px solid #e7e9ee; border-radius:10px;
  overflow:hidden; transition:transform .18s ease, box-shadow .18s ease;
  box-shadow:var(--shadow-sm);
}
.car-card:hover{ transform:translateY(-4px); box-shadow:var(--shadow); }

.car-media{ position:relative; aspect-ratio:16/9; overflow:hidden; background:#eef2ff; }
.car-media img{ width:100%; height:100%; object-fit:cover; display:block; }

.price-badge{
  position:absolute; top:12px; right:12px;
  background:var(--brand-dark); color:#fff; font-size:13px;
  padding:6px 10px; border-radius:6px; font-weight:700;
}

.car-body{
  padding:14px;
  display:flex; flex-direction:column; gap:8px;
  justify-content:space-between;
  height:100%;
}
.car-body h4{ margin:0 0 6px 0; font-size:16px; color: var(--brand-dark); }
.car-body p{
  margin:0 0 8px 0; font-size:14px; color:#444;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}

/* ---------- Requests list ---------- */
.requests-list{ display:flex; flex-direction:column; gap:12px }
.request-row{
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  padding:12px; border-radius:10px; background:#fff;
  border:1px solid rgba(14,20,40,.04);
  transition: box-shadow .12s ease, transform .12s ease;
}
.request-row:hover{ transform:translateY(-3px); box-shadow:0 14px 32px rgba(12,18,35,.06) }
.request-row strong{ font-size:14px }
.request-row .muted{ color:var(--muted); font-size:13px }

/* ---------- ATM / Fan Card visuals ---------- */
.atm-swipe {
  display:flex;
  gap:14px;
  overflow-x:auto;
  padding-bottom:8px;
  -webkit-overflow-scrolling:touch;
  scroll-snap-type:x mandatory;
}
.atm-swipe::-webkit-scrollbar { height:8px }
.atm-swipe::-webkit-scrollbar-thumb { background:rgba(0,0,0,0.12); border-radius:8px }

.atm-card {
  flex:0 0 520px;
  scroll-snap-align:center;
  width:520px; height:210px; border-radius:18px; color:#fff; padding:18px; position:relative;
  display:flex; flex-direction:column; justify-content:space-between; box-shadow:0 12px 30px rgba(225,29,72,0.12);
  background: linear-gradient(135deg, var(--accent-600), var(--accent));
  overflow:hidden;
}
.atm-card .chip { width:48px;height:36px;border-radius:6px;background:rgba(255,255,255,0.95); display:inline-block }
.atm-card .card-top { display:flex; justify-content:space-between; align-items:flex-start; gap:12px }
.atm-card .card-number { font-family: 'Roboto Mono', monospace; letter-spacing:3px; font-size:20px; font-weight:700; margin-top:6px }
.atm-card .card-holder { font-size:13px; opacity:0.95 }
.atm-card .card-btm { display:flex; justify-content:space-between; align-items:center; gap:12px }
.atm-card .balance { text-align:right }
.atm-card .balance .amount { font-size:20px; font-weight:800 }
.atm-card .bg-deco { position:absolute; right:-80px; top:-40px; opacity:0.12; width:260px; height:260px; border-radius:50%; background:#ffffff; filter: blur(18px) }

/* carousel controls */
.atm-controls { display:flex; gap:10px; align-items:center; margin-top:8px }
.atm-arrow { background:transparent; border:1px solid rgba(0,0,0,0.06); width:36px; height:36px; border-radius:8px; display:inline-flex; align-items:center; justify-content:center; cursor:pointer }
.atm-arrow svg { fill:var(--accent); width:18px; height:18px }

/* fallback for small widths */
@media (max-width:560px) {
  .atm-card { flex:0 0 92%; width:92% }
}

/* ---------- Lucky Box small wheel + modal ---------- */
.lucky-modal-backdrop{ position:fixed; inset:0; background:rgba(0,0,0,0.45); display:none; align-items:center; justify-content:center; z-index:1200; padding:18px; }
.lucky-modal{ background:#fff; border-radius:10px; max-width:540px; width:100%; padding:18px; box-shadow:0 20px 40px rgba(0,0,0,0.25); text-align:left; }
.prize-tile { display:flex; gap:12px; align-items:center; padding:10px; border:1px solid #f1f5f9; border-radius:8px; background:#fbfdff; }
.prize-thumb { width:86px; height:64px; border-radius:6px; object-fit:cover; background:#eef2ff }

/* ---------- Fan-card compact visuals (mini list) ---------- */
.fan-card {
  width:320px;
  max-width:100%;
  border-radius:14px;
  color:#fff;
  padding:18px;
  position:relative;
  overflow:hidden;
  box-shadow:0 18px 36px rgba(17,18,20,0.16);
  background: linear-gradient(135deg, rgba(17,18,20,0.96) 0%, rgba(34,34,34,0.92) 100%);
  display:flex;
  flex-direction:column;
  gap:12px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}
.fan-card.has-bg {
  background-image: linear-gradient(180deg, rgba(17,18,20,0.75), rgba(0,0,0,0.35)), url(var(--card-bg-url));
  background-size: cover;
  background-position: center;
}
.fan-card .card-top { display:flex; align-items:center; justify-content:space-between; }
.fan-card .brand { display:flex; align-items:center; gap:8px; }
.fan-card .brand .logo { width:42px; height:28px; border-radius:6px; background:rgba(255,255,255,0.06); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:14px; }
.fan-card .brand .name { font-weight:700; font-size:14px; color: #fff; opacity:.95; }
.fan-card .chip { width:44px; height:34px; border-radius:4px; background:linear-gradient(180deg,#ffd27b,#ff8b3d); box-shadow: inset 0 1px 0 rgba(255,255,255,.4); border:1px solid rgba(0,0,0,0.12); }
.fan-card .card-number { font-family: "Courier New", monospace; font-size:18px; letter-spacing:2px; margin-top:6px; opacity:.98;}
.fan-card .card-meta { display:flex; justify-content:space-between; align-items:center; margin-top:auto; gap:12px; }
.fan-card .card-balance { font-size:15px; font-weight:800; color:#fff; }
.fan-card .card-exp { font-size:12px; color:rgba(255,255,255,0.85); }
.fan-card .masked { letter-spacing:2px; opacity:.92; font-weight:700; }
.fan-card .card-actions { display:flex; gap:8px; margin-top:8px; }
.fan-card .card-actions .btn { padding:8px 12px; border-radius:10px; font-weight:700; }

/* small mini card */
.fan-card-mini {
  display:flex; align-items:center; gap:12px; padding:10px; border-radius:12px;
  background:linear-gradient(90deg,#111 0%, #1a1a1a 100%);
  color:#fff; box-shadow:var(--shadow-sm);
}
.fan-card-mini .num { font-family: monospace; font-weight:700; letter-spacing:2px; }

/* ---------- Pagination ---------- */
.pagination{ display:flex; gap:8px; margin-top:14px; flex-wrap:wrap }
.page-link{
  display:inline-block; padding:8px 10px; background:#fff; border-radius:8px;
  border:1px solid #eef2f6; color:var(--muted); text-decoration:none
}
.page-link.active{ background:var(--accent); color:#fff; border-color:var(--accent) }

/* ---------- Misc polish ---------- */
.small-muted{ color:var(--muted); font-size:.95rem; }
.welcome h2{ margin:0 0 6px 0; font-size:20px }
.status-pill{ padding:6px 10px; border-radius:999px; font-weight:700; font-size:13px; min-width:92px; text-align:center; }

/* accessibility focus */
a:focus, button:focus, input:focus{ outline:3px solid rgba(204,0,0,0.12); outline-offset:2px; }

/* responsive adjustments */
@media (max-width:900px) {
  .layout { flex-direction:column; padding:0 10px }
  aside.drawer { display:none }
  .atm-card { width:92% }
}
