/* ═══════════════════════════════════════════════════════════
   ACCOUNT PAGE STYLESHEET
   ═══════════════════════════════════════════════════════════ */

.account-page { background: var(--bg); min-height: 100vh; }
.account-shell { max-width: 1080px; margin: 0 auto; padding: 32px 20px 80px; }
.account-gate { padding: 0; }
.account-dashboard { display: flex; flex-direction: column; gap: 32px; }

/* ─── LOGIN / SIGNUP FORM ─── */
.login-form {
  display: flex; flex-direction: column; gap: 12px;
  max-width: 380px; margin: 60px auto; padding: 36px 32px;
  background: var(--panel); border-radius: 20px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  animation: auth-fade-in 0.3s ease;
}
@keyframes auth-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.login-form h2 {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.2rem; letter-spacing: 1.5px;
  text-align: center; margin: 0 0 8px;
  color: var(--ink); line-height: 1;
}
.login-form input {
  width: 100%; padding: 14px 16px;
  border: 2px solid var(--line); border-radius: 12px;
  font-size: 1rem; font-family: inherit;
  background: var(--bg); color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login-form input:focus {
  outline: none; border-color: var(--y);
  box-shadow: 0 0 0 4px rgba(255,184,0,0.18);
}
.login-form input::placeholder { color: var(--mut); opacity: 0.8; }
.login-form button[type="submit"] {
  width: 100%; padding: 14px;
  background: var(--y); color: var(--ink);
  border: none; border-radius: 12px;
  font-weight: 700; font-size: 1rem; font-family: inherit;
  cursor: pointer; transition: all 0.15s ease;
  margin-top: 4px;
}
.login-form button[type="submit"]:hover {
  background: var(--ink); color: var(--y);
  transform: translateY(-1px); box-shadow: var(--shadow);
}
.login-form button[type="submit"]:disabled {
  opacity: 0.6; cursor: not-allowed; transform: none;
}
.login-form .signup {
  text-align: center; margin-top: 12px;
  font-size: 0.9rem; color: var(--mut);
}
.login-form .signup a {
  color: var(--r); font-weight: 700;
  text-decoration: none; transition: color 0.15s;
}
.login-form .signup a:hover { color: var(--y); text-decoration: underline; }

/* ─── AUTH ERROR ─── */
.login-form .auth-error {
  padding: 10px 14px;
  background: rgba(230,57,70,0.1);
  border-left: 4px solid var(--r);
  border-radius: 8px;
  color: var(--r);
  font-size: 0.88rem; line-height: 1.4;
  white-space: pre-line;
  animation: error-shake 0.3s ease;
}
@keyframes error-shake {
  0%,100% { transform: translateX(0); }
  25%     { transform: translateX(-4px); }
  75%     { transform: translateX(4px); }
}

/* ─── DASHBOARD SHELL ─── */
.account-dashboard > * { animation: dash-fade-in 0.35s ease; }
@keyframes dash-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── PROFILE HEADER ─── */
.account-header {
  display: flex; align-items: center; gap: 20px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 28px;
  box-shadow: var(--shadow); flex-wrap: wrap;
}
.account-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--y); color: var(--ink);
  display: grid; place-items: center;
  font-size: 2rem; font-weight: 800; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255,184,0,0.3);
}
.account-info { flex: 1; min-width: 200px; }
.account-info h1 { font-size: 1.6rem; margin-bottom: 4px; line-height: 1.2; }
.account-info p { font-size: 0.9rem; margin-top: 2px; }

/* ─── TAB SYSTEM ─── */
.acc-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none; /* Hide scrollbar for clean look */
}
.acc-tabs::-webkit-scrollbar { display: none; }
.acc-tab {
  padding: 10px 20px;
  border-radius: 999px;
  background: transparent;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  color: var(--mut);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.acc-tab:hover { color: var(--ink); background: rgba(0,0,0,0.04); }
.acc-tab.on { background: var(--ink); color: var(--bg); }

/* ─── STATS ─── */
.account-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card span { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; color: var(--mut); }
.stat-card strong { font-size: 1.6rem; font-family: "Bebas Neue", sans-serif; letter-spacing: 1px; color: var(--ink); line-height: 1; }

/* ─── TICKET CARDS (NEW) ─── */
.ticket-card {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.ticket-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.ticket-left {
  background: var(--y);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 140px;
  color: var(--ink);
  text-align: center;
  border-right: 2px dashed rgba(0,0,0,0.1);
  position: relative;
}
/* Ticket cutout effects */
.ticket-left::before, .ticket-left::after {
  content: '';
  position: absolute;
  right: -10px;
  width: 20px;
  height: 20px;
  background: var(--panel);
  border-radius: 50%;
  border-left: 1px solid var(--line);
}
.ticket-left::before { top: -10px; }
.ticket-left::after { bottom: -10px; }

.ticket-left h3 {
  font-size: 1.3rem;
  margin: 0;
  line-height: 1.1;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.5px;
}
.ticket-left div {
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 4px;
}
.ticket-right {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.ticket-qr {
  margin-top: 12px;
  background: white;
  padding: 8px;
  border-radius: 8px;
  display: inline-block;
  align-self: flex-start;
}
.ticket-qr canvas {
  display: block;
}

/* ─── ACTIVE ORDER TRACKER ─── */
.active-order-card {
  background: var(--panel);
  border: 2px solid var(--y);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.active-order-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--y) 0%, var(--r) 100%);
  animation: tracker-shimmer 2s linear infinite;
}
@keyframes tracker-shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.active-order-head {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 16px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.active-order-head h2 { font-size: 1.4rem; margin: 4px 0; line-height: 1.2; }
.active-order-head p { font-size: 0.9rem; }
.active-order-head .section-eyebrow {
  color: var(--r); font-size: 0.75rem;
  font-weight: 800; letter-spacing: 2px;
}

/* ─── TRACKER MAP ─── */
.tracker-map {
  width: 100%; height: 340px; border-radius: 16px;
  overflow: hidden; background: var(--panel-2);
  border: 1px solid var(--line); position: relative; z-index: 1;
}
.tracker-map .leaflet-container { font-family: inherit; }
.tracker-map .leaflet-popup-content-wrapper { border-radius: 10px; box-shadow: var(--shadow-lg); }
.tracker-map .leaflet-popup-content { margin: 10px 14px; font-size: .85rem; font-weight: 600; }

.tracker-meta {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-top: 16px;
  padding-top: 16px; border-top: 1px solid var(--line);
}
.tracker-meta > div { display: flex; flex-direction: column; gap: 2px; }
.tracker-meta span { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; color: var(--mut); }
.tracker-meta strong { font-size: 1.05rem; color: var(--ink); font-family: "Bebas Neue", sans-serif; letter-spacing: 0.5px; }

/* Rider pulse */
@keyframes riderPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}
.rider-icon-marker { background: transparent; border: none; }

/* ─── ORDERS LIST ─── */
.orders-section { margin-top: 8px; }
.orders-section h2 { margin-bottom: 20px; font-size: 1.6rem; }
.orders-list { display: flex; flex-direction: column; gap: 12px; }
.order-row {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.order-row:hover { box-shadow: var(--shadow); border-color: var(--y); transform: translateY(-2px); }
.order-row-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.order-row-head b { font-size: 1.05rem; font-family: "Bebas Neue", sans-serif; letter-spacing: 1px; color: var(--ink); }
.order-row-items { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.88rem; color: var(--mut); line-height: 1.5; }
.order-row-foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
  padding-top: 8px; border-top: 1px solid var(--line);
}
.order-row-foot .total { font-weight: 800; font-size: 1.1rem; color: var(--ink); }
.order-row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.order-row-actions .btn { padding: 8px 16px; font-size: 0.82rem; min-height: 36px; }

/* ─── STATUS PILLS ─── */
.status-pill {
  display: inline-block; padding: 6px 14px;
  border-radius: 999px; font-weight: 700; font-size: 0.82rem;
  text-transform: uppercase; letter-spacing: 0.5px;
  line-height: 1; white-space: nowrap;
}
.status-pill.pending, .status-pill.paid, .status-pill.preparing { background: var(--y); color: var(--ink); }
.status-pill.accepted, .status-pill.delivering { background: var(--b); color: #fff; }
.status-pill.delivered { background: var(--g); color: #fff; }
.status-pill.cancelled { background: var(--r); color: #fff; }

.status-tag {
  display: inline-block; padding: 4px 10px;
  border-radius: 999px; font-size: 0.72rem;
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
  line-height: 1; white-space: nowrap;
}
.status-tag.pending    { background: var(--y); color: var(--ink); }
.status-tag.paid       { background: #10b981; color: #fff; }
.status-tag.accepted   { background: var(--b); color: #fff; }
.status-tag.delivering { background: #8b5cf6; color: #fff; }
.status-tag.delivered  { background: var(--g); color: #fff; }
.status-tag.cancelled  { background: var(--r); color: #fff; }

/* ─── EDIT PROFILE PANEL ─── */
.edit-profile-panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 28px;
  box-shadow: var(--shadow-lg); animation: dash-fade-in 0.25s ease;
}
.edit-profile-panel h2 { margin-bottom: 20px; font-size: 1.4rem; }
.edit-profile-panel .field { margin-bottom: 16px; }
.edit-profile-panel .field label { display: block; font-weight: 600; font-size: 0.87rem; margin-bottom: 6px; color: var(--ink); }
.edit-profile-panel .field input {
  width: 100%; padding: 12px 14px;
  border-radius: 12px; border: 2px solid var(--line);
  background: var(--bg); color: var(--ink);
  font-size: 0.95rem; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.edit-profile-panel .field input:focus { outline: none; border-color: var(--y); box-shadow: 0 0 0 4px rgba(255,184,0,0.18); }
.row-actions { display: flex; gap: 10px; margin-top: 20px; }
.row-actions .btn { flex: 1; }

/* ─── EMPTY ─── */
.order-empty {
  text-align: center; padding: 60px 20px; color: var(--mut);
  background: var(--panel); border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
}
.order-empty .em { font-size: 4rem; margin-bottom: 12px; opacity: 0.8; }
.order-empty p { font-size: 0.95rem; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .account-shell { padding: 24px 16px 60px; }
  .tracker-map { height: 300px; }
}
@media (max-width: 720px) {
  .login-form { margin: 30px auto; padding: 28px 22px; max-width: 100%; }
  .login-form h2 { font-size: 1.9rem; }
  .account-header { flex-direction: column; text-align: center; padding: 24px 20px; }
  .account-header .btn-outline { width: 100%; }
  
  /* Stack tabs on mobile */
  .acc-tabs { flex-direction: column; gap: 4px; border-bottom: none; }
  .acc-tab { text-align: left; border-radius: 12px; }
  
  .account-stats { grid-template-columns: 1fr; gap: 12px; }
  .stat-card { flex-direction: row; align-items: center; justify-content: space-between; padding: 16px 20px; }
  .stat-card strong { font-size: 1.4rem; }
  
  .active-order-card { padding: 20px 16px; }
  .active-order-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .active-order-head h2 { font-size: 1.2rem; }
  .tracker-map { height: 240px; border-radius: 12px; }
  .tracker-meta { grid-template-columns: 1fr; gap: 10px; }
  .tracker-meta > div { flex-direction: row; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
  .tracker-meta > div:last-child { border-bottom: none; }
  
  .order-row { padding: 16px; }
  .order-row-actions { width: 100%; }
  .order-row-actions .btn { flex: 1; }
  
  /* Ticket card mobile layout */
  .ticket-card { flex-direction: column; }
  .ticket-left { padding: 16px; min-width: auto; border-right: none; border-bottom: 2px dashed rgba(0,0,0,0.1); flex-direction: row; justify-content: space-between; align-items: center; text-align: left; }
  .ticket-left h3 { font-size: 1.1rem; }
  .ticket-left::before { top: auto; bottom: -10px; right: auto; left: 10%; border-left: none; border-top: 1px solid var(--line); }
  .ticket-left::after { top: auto; bottom: -10px; right: 10%; border-left: none; border-top: 1px solid var(--line); }
  .ticket-right { padding: 16px; }
  
  .edit-profile-panel { padding: 20px; }
  .row-actions { flex-direction: column-reverse; }
}
@media (max-width: 480px) {
  .account-shell { padding: 16px 12px 60px; }
  .login-form { padding: 24px 18px; border-radius: 16px; }
  .login-form h2 { font-size: 1.7rem; }
  .account-avatar { width: 60px; height: 60px; font-size: 1.6rem; }
  .account-info h1 { font-size: 1.3rem; }
  .orders-section h2 { font-size: 1.3rem; }
}

@media (hover: none) and (pointer: coarse) {
  .login-form input, .login-form button[type="submit"] { min-height: 48px; }
  .order-row-actions .btn { min-height: 40px; }
  .stat-card:hover, .order-row:hover { transform: none; }
}

/* ═══════════════════════════════════════════════════════════
   ORDER HISTORY ITEMS (WITH IMAGES)
   ═══════════════════════════════════════════════════════════ */

.order-items-container {
  background: var(--bg);
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.order-history-img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--panel-2);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 1.5rem;
}

.order-history-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-history-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.order-history-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-history-qty {
  font-size: 0.8rem;
  color: var(--mut);
}

.order-history-price {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE HEADER FIX (Back to Home & Sign Out)
   ═══════════════════════════════════════════════════════════ */

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-home-btn {
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  font-weight: 700;
  color: var(--ink);
  transition: all 0.2s;
}

.nav-home-btn:hover {
  background: var(--ink);
  color: #fff;
}

/* Hide the old desktop navigation links on mobile */
@media (max-width: 800px) {
  .desktop-nav, .desktop-only {
    display: none !important;
  }
}

/* Ensure the sign out button looks like a proper grid item on mobile */
#signOutBtn {
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  background: var(--ink);
  color: var(--y);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  border: none;
}