/* /assets/style.css */
/* Global foundation — reset, variables, buttons, inputs, cards,
   modal, toast, badges, spinner, header, footer, sidebar.
   Rarely edited. Page-specific styles go in /assets/css/{page}.css */

:root {
  --bg:         #0a0a0a;
  --bg-card:    #1a1a2e;
  --bg-input:   #0f0f22;
  --bg-hover:   #16213e;
  --border:     #2a2a4e;
  --text:       #e8e8f0;
  --text-dim:   #8a8aa0;
  --primary:    #e50914;
  --primary-2:  #b80710;
  --green:      #2ecc71;
  --green-2:    #27ae60;
  --yellow:     #f39c12;
  --red:        #e74c3c;
  --blue:       #3498db;
  --radius:     12px;
  --radius-lg:  20px;
  --shadow:     0 10px 40px rgba(0,0,0,.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .85; }

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 30px;
  padding: 12px 22px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  transition: all .2s;
}
button:hover:not(:disabled) { background: var(--primary-2); transform: translateY(-1px); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

input, textarea, select {
  font: inherit;
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  margin: 4px 0 12px;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(229,9,20,.1);
}

label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 6px;
  margin-bottom: 2px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}

.container { max-width: 900px; margin: 0 auto; padding: 20px; }
.container-narrow { max-width: 440px; margin: 0 auto; padding: 20px; }

.muted { color: var(--text-dim); font-size: 13px; }
.text-center { text-align: center; }

h1, h2, h3, h4 { color: #fff; font-weight: 700; margin-bottom: 12px; line-height: 1.25; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }

/* ============ HEADER (public pages) ============ */
.site-header {
  background: rgba(26,26,46,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .logo {
  font-weight: 700;
  font-size: 18px;
  color: var(--primary);
  text-decoration: none;
}
.site-header nav {
  display: flex;
  gap: 18px;
  align-items: center;
}
.site-header nav a {
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
}
.site-header nav a:hover { color: var(--primary); }

/* ============ MODAL ============ */
.cm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
  z-index: 99999;
  opacity: 0;
  transition: opacity .2s;
}
.cm-overlay.active { display: flex; opacity: 1; }

.cm-box {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-hover));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  animation: cmIn .25s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes cmIn {
  from { transform: scale(.9); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}
.cm-box.cm-success { border-color: var(--green); }
.cm-box.cm-error   { border-color: var(--red); }
.cm-box.cm-warning { border-color: var(--yellow); }

.cm-icon { font-size: 42px; margin-bottom: 10px; }
.cm-box h3 { font-size: 20px; margin-bottom: 8px; }
.cm-box p  { color: var(--text-dim); margin-bottom: 20px; line-height: 1.5; }
.cm-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cm-btn { padding: 11px 22px; font-size: 14px; }
.cm-btn-primary   { background: var(--primary); }
.cm-btn-danger    { background: var(--red); }
.cm-btn-secondary { background: rgba(255,255,255,.08); color: var(--text); }
.cm-btn-success   { background: var(--green); }

/* ============ TOAST ============ */
.toast-stack {
  position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 100000;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
  max-width: 90vw;
}
.toast {
  background: rgba(20,20,35,.95);
  color: #fff;
  padding: 12px 22px;
  border-radius: 30px;
  border: 1px solid var(--border);
  font-size: 14px;
  opacity: 0;
  transform: translateY(20px);
  transition: all .3s;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-color: var(--green); color: var(--green); }
.toast-error   { border-color: var(--red);   color: var(--red); }
.toast-info    { border-color: var(--blue);  color: var(--blue); }
.toast-warning { border-color: var(--yellow);color: var(--yellow); }

/* ============ SPINNER ============ */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ BADGE ============ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-success { background: rgba(46,204,113,.15); color: var(--green); }
.badge-danger  { background: rgba(231,76,60,.15);  color: var(--red); }
.badge-warning { background: rgba(243,156,18,.15); color: var(--yellow); }
.badge-info    { background: rgba(52,152,219,.15); color: var(--blue); }
.badge-muted   { background: rgba(255,255,255,.08); color: var(--text-dim); }

/* ============ GRID ============ */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

/* ============ SHARED ROW ITEM (cart, orders, wallet txns) ============ */
.row-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 16px;
  align-items: center;
}
.row-item .info .title {
  font-weight: 600;
  color: #fff;
  font-size: 14px;
  margin-bottom: 3px;
}
.row-item .info .sub { font-size: 12px; color: var(--text-dim); }
.row-item .qty { display: flex; align-items: center; gap: 8px; }
.row-item .qty button {
  width: 30px; height: 30px;
  padding: 0;
  background: rgba(255,255,255,.08);
  color: #fff;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
}
.row-item .qty button:hover:not(:disabled) { background: rgba(255,255,255,.15); }
.row-item .qty .n { min-width: 22px; text-align: center; font-weight: 700; font-size: 14px; }
.row-item .price { font-weight: 700; font-size: 15px; text-align: right; }
.row-item .remove {
  background: rgba(231,76,60,.15);
  color: var(--red);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
}
.row-item .remove:hover { background: var(--red); color: #fff; }

/* ============ EMPTY STATE ============ */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.empty .ico { font-size: 48px; margin-bottom: 14px; opacity: .5; display: block; }
.empty h3 { color: var(--text-dim); font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.empty p { font-size: 13px; margin-bottom: 18px; }

/* ============ SIDEBAR (shared by all authenticated pages) ============ */
.dash-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 20px;
  align-items: start;
}
.dash-side {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 14px;
  position: sticky;
  top: 80px;
  height: fit-content;
}
.dash-user {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.dash-user .avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #ff6b6b);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 22px; color: #fff;
  margin: 0 auto 10px;
}
.dash-user .name {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  margin-bottom: 2px;
  word-break: break-word;
}
.dash-user .email {
  font-size: 11px;
  color: var(--text-dim);
  word-break: break-all;
}
.dash-balance {
  margin: 14px 0;
  padding: 12px;
  background: rgba(46,204,113,.08);
  border: 1px solid rgba(46,204,113,.2);
  border-radius: 12px;
  text-align: center;
}
.dash-balance .label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.dash-balance .amt {
  font-size: 17px;
  font-weight: 700;
  color: var(--green);
}
.dash-nav { display: flex; flex-direction: column; gap: 2px; }
.dash-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  transition: all .2s;
}
.dash-nav a:hover {
  background: rgba(255,255,255,.05);
  color: #fff;
  opacity: 1;
}
.dash-nav a.active {
  background: rgba(229,9,20,.12);
  color: var(--primary);
}
.dash-nav a .ico {
  width: 20px;
  text-align: center;
  font-size: 15px;
}
.dash-nav .logout-link {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  color: var(--red);
}
.dash-nav .logout-link:hover {
  background: rgba(231,76,60,.1);
  color: var(--red);
}
.dash-main { min-width: 0; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-side { position: static; }
  .dash-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
    padding-bottom: 6px;
  }
  .dash-nav a {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 13px;
  }
  .dash-nav .logout-link {
    margin-top: 0;
    border-top: none;
    padding-top: 8px;
  }
  .row-item { grid-template-columns: 1fr; gap: 10px; }
  .row-item .price { text-align: left; }
}
@media (max-width: 640px) {
  .container { padding: 14px; }
  .card { padding: 18px; border-radius: 16px; }
  h1 { font-size: 22px; }
  .site-header { padding: 12px 14px; }
  .site-header nav { gap: 12px; font-size: 13px; }
}