/* ============================================================
   HKR BAKING ACADEMY – USER SESSION ADDITIONS
   Paste this at the END of main.css
   ============================================================ */

/* ── Header User Button ───────────────────────────────────── */
.header-user-btn {
  position: relative;
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 50%;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.header-user-btn:hover { background: rgba(255,255,255,0.22); }
.header-user-btn.logged-in { background: var(--gold); }
.header-user-btn.logged-in:hover { background: var(--gold-dark); }

.user-avatar-initials {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: 0.3px;
  line-height: 1;
}

/* ── User Bottom Sheet ────────────────────────────────────── */
.user-bottom-sheet {
  max-height: 90vh;
}

.user-sheet-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}

.user-sheet-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
}

/* ── OTP Login ────────────────────────────────────────────── */
.otp-box {
  width: 42px;
  height: 48px;
  border: 2px solid var(--border-dark);
  border-radius: 10px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.otp-box:focus {
  border-color: var(--primary);
  background: #fff;
}
.otp-box:not(:placeholder-shown) {
  border-color: var(--primary);
  background: rgba(85,0,0,0.04);
}

/* ── Profile Avatar Large ─────────────────────────────────── */
.profile-avatar-lg {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

/* ── Profile Menu Items ───────────────────────────────────── */
.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
}
.profile-menu-item:last-child { border-bottom: none; }
.profile-menu-item:hover { background: var(--bg); }
.profile-menu-item span:first-child + span { flex: 1; }
.profile-menu-item.profile-menu-danger { color: var(--error); }

.profile-menu-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── Address Cards ────────────────────────────────────────── */
.address-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}
.address-card.address-default {
  border-color: rgba(85,0,0,0.25);
  background: rgba(85,0,0,0.02);
}
.address-card-left { flex: 1; min-width: 0; }
.address-label-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.address-text {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 4px;
}
.address-default-tag {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.address-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.addr-action-btn {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 1.5px solid var(--border-dark);
  background: var(--bg);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  transition: 0.15s;
}
.addr-action-btn:hover { border-color: var(--primary); }
.addr-delete-btn:hover { border-color: var(--error); background: #ffebee; }

/* ============================================================
   SUCCESS SCREEN — Impressive order placed UI (Issue #7)
   ============================================================ */

.success-screen-bg {
  background: var(--bg);
  align-items: center;
  justify-content: center;
}

.success-screen-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 40px;
  text-align: center;
  width: 100%;
  min-height: 100vh;
  justify-content: center;
}

/* Animated checkmark */
.success-check-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 24px;
}

.success-check-svg {
  width: 100px;
  height: 100px;
}

.success-circle {
  stroke-dasharray: 226;
  stroke-dashoffset: 226;
  animation: drawCircle 0.6s ease-out 0.1s forwards;
  transform-origin: center;
  transform: rotate(-90deg);
}

.success-tick {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: drawTick 0.4s ease-out 0.7s forwards;
}

@keyframes drawCircle {
  to { stroke-dashoffset: 0; }
}

@keyframes drawTick {
  to { stroke-dashoffset: 0; }
}

.success-confetti-wrap {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
}

@keyframes confettiBurst {
  0%   { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  60%  { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1); opacity: 0; }
}

.confetti-piece {
  pointer-events: none;
}

/* Heading */
.success-heading {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--primary);
  margin: 0 0 6px;
  animation: fadeInUp 0.5s ease 0.9s both;
}

.success-order-tag {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 4px 14px;
  border-radius: 50px;
  margin-bottom: 20px;
  animation: fadeInUp 0.5s ease 1s both;
}

/* Details card */
.success-card {
  width: 100%;
  max-width: 320px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 16px;
  animation: fadeInUp 0.5s ease 1.1s both;
}

.success-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.success-card-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.success-card-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.success-card-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.success-sub-msg {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
  animation: fadeInUp 0.5s ease 1.15s both;
}

.success-account-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  background: rgba(85,0,0,0.05);
  border: 1.5px solid rgba(85,0,0,0.15);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.72rem;
  color: var(--primary);
  text-align: left;
  margin-bottom: 16px;
  line-height: 1.4;
  animation: fadeInUp 0.5s ease 1.2s both;
}

.success-contact {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 20px;
  animation: fadeInUp 0.5s ease 1.3s both;
}

.success-contact a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

/* ============================================================
   DRAG-TO-CLOSE SHEETS — Visual handle enhancement (Issue #6)
   ============================================================ */

.sheet-drag-handle {
  width: 40px;
  height: 5px;
  background: #ddd;
  border-radius: 3px;
  margin: 10px auto 6px;
  cursor: grab;
  flex-shrink: 0;
  transition: background 0.2s;
}

.sheet-drag-handle:active,
.sheet-drag-handle:hover {
  background: var(--border-dark);
  cursor: grab;
}

/* Smoother sheet transitions */
.bottom-sheet {
  will-change: transform;
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1) !important;
}

/* ============================================================
   PROFILE MENU ICON — Professional SVG styling (Issue #4)
   ============================================================ */

.profile-menu-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(85,0,0,0.06);
  border: 1px solid rgba(85,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.profile-menu-item:hover .profile-menu-icon {
  background: rgba(85,0,0,0.1);
}

.profile-menu-item.profile-menu-danger .profile-menu-icon {
  background: rgba(198,40,40,0.06);
  border-color: rgba(198,40,40,0.12);
}

/* ============================================================
   EXISTING ACCOUNT PROMPT (Issue 1)
   ============================================================ */

#existing-account-prompt {
  animation: fadeInUp 0.25s ease;
}
