/* ═══════════════════════════════════════════════════════════
   THE TRUMP TRADE — mobile-ux.css
   Mobile UX enhancements: hamburger menu, back-to-top,
   reading progress bar, toast notifications, nav highlight
═══════════════════════════════════════════════════════════ */

/* ─── Reading Progress Bar ──────────────────────────────── */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #c8102e, #f5c518);
  z-index: 200;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ─── Hamburger Button ──────────────────────────────────── */
#mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
  /* Sits between logo and nav-right */
  margin-left: auto;
}

#mobile-menu-btn:hover {
  background: var(--bg-card);
  border-color: var(--border-light);
}

#mobile-menu-btn .bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease;
  transform-origin: center;
}

/* Animate to X when open */
#mobile-menu-btn.open .bar-top {
  transform: translateY(7px) rotate(45deg);
}

#mobile-menu-btn.open .bar-mid {
  opacity: 0;
  transform: scaleX(0);
}

#mobile-menu-btn.open .bar-bot {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 767px) {
  #mobile-menu-btn {
    display: flex;
  }
}

/* ─── Mobile Nav Drawer ─────────────────────────────────── */
#mobile-nav-drawer {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-0);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 90;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#mobile-nav-drawer.open {
  transform: translateX(0);
}

#mobile-nav-drawer .drawer-inner {
  display: flex;
  flex-direction: column;
  padding: 24px 0 40px;
}

#mobile-nav-drawer .drawer-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-3);
  text-transform: uppercase;
  padding: 0 24px;
  margin-bottom: 8px;
  margin-top: 24px;
}

#mobile-nav-drawer .drawer-section-label:first-child {
  margin-top: 0;
}

#mobile-nav-drawer .drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  line-height: 1;
}

#mobile-nav-drawer .drawer-link:hover,
#mobile-nav-drawer .drawer-link:active {
  color: var(--text-1);
  background: var(--bg-card);
  border-left-color: var(--red);
}

#mobile-nav-drawer .drawer-link .drawer-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

#mobile-nav-drawer .drawer-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 24px;
}

/* Hide drawer on desktop */
@media (min-width: 768px) {
  #mobile-nav-drawer {
    display: none;
  }
}

/* ─── Back-to-Top Button ────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-2);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, background 0.2s, color 0.2s, transform 0.2s;
  box-shadow: var(--shadow-card);
}

#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

#back-to-top:hover {
  background: var(--red);
  color: #fff;
  transform: translateY(-2px);
}

#back-to-top:active {
  transform: translateY(0);
}

/* ─── Toast Container ───────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  z-index: 999;
  pointer-events: none;
}

/* ─── Toast Item ────────────────────────────────────────── */
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-1);
  min-width: 200px;
  max-width: 320px;
  pointer-events: auto;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
  border-left: 3px solid var(--border-light);
  animation: toast-slide-in 0.25s ease forwards;
}

.toast.toast-hide {
  animation: toast-slide-out 0.25s ease forwards;
}

.toast-success {
  border-left-color: var(--green);
}

.toast-error {
  border-left-color: var(--danger);
}

.toast-info {
  border-left-color: var(--gold);
}

.toast-icon {
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-message {
  flex: 1;
}

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-slide-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-20px);
  }
}

/* ─── Active Nav Link ───────────────────────────────────── */
.nav-link-active {
  color: var(--text-1) !important;
  background: rgba(200, 16, 46, 0.1);
  position: relative;
}

.nav-link-active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--red);
}

/* ─── Smooth scroll nudge: body no-scroll when drawer open ─ */
body.drawer-open {
  overflow: hidden;
}
