/* ══════════════════════════════════════════════════════════════════════
   SHELL: mobile-topbar.css
   Mobile topbar + drawer lateral.

   Estado actual: el mobile topbar está OCULTO en mobile (Duolingo
   pattern — bottom nav es la única navegación visible). Pero las
   reglas están aquí porque podríamos reactivarlo, y el drawer sí se
   muestra cuando el usuario tap-hold para abrir un slide drawer.

   Elementos:
   - .mobile-topbar (fixed top container, currently pointer-events: none)
   - .drawer-overlay (full-screen dim) + .overlay-visible
   - .drawer-panel (slide-in panel) + .drawer-open
   - .drawer-header, .drawer-user-info, .drawer-avatar, .drawer-name,
     .drawer-plan
   - .drawer-nav, .drawer-link (+ :hover, .active)
   - .drawer-divider, .drawer-footer, .drawer-logout
   - @media (max-width: 768px) toggle visibility
   - Dark mode

   Extraído de components.css en Round 10.4.
   ══════════════════════════════════════════════════════════════════════ */

/* ─── 1. Topbar + Drawer (from components.css 175-266) ─────────────── */
/* ── Mobile Topbar ──────────────────────────────────────────────────── */
#mobile-topbar-container {
  display: none; /* hidden on desktop */
}
.mobile-topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 56px; background: var(--violet); color: white;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.topbar-icon-btn {
  background: transparent; border: none; color: white;
  width: 40px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.topbar-icon-btn:hover { background: rgba(255,255,255,0.1); }
.topbar-logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: var(--fw-bold); font-size: 1.1rem;
}
.topbar-logo-icon {
  width: 24px; height: 24px; border-radius: 6px;
  background: rgba(255,255,255,0.2); 
  display: flex; align-items: center; justify-content: center;
}
.topbar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: var(--fw-bold);
}

/* ── Mobile Drawer ──────────────────────────────────────────────────── */
#mobile-drawer-container {
  display: none; /* hidden on desktop */
}
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 1040; opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}
.drawer-overlay.overlay-visible {
  opacity: 1; pointer-events: auto;
}
.drawer-panel {
  position: fixed; top: 0; left: -280px; bottom: 0;
  width: 280px; background: white; z-index: 1050;
  box-shadow: 2px 0 12px rgba(0,0,0,0.15);
  display: flex; flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}
.drawer-open {
  transform: translateX(280px);
}
.drawer-header {
  padding: 20px 16px; background: var(--bg-primary);
  display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 1px solid var(--border);
}
.drawer-user-info { display: flex; align-items: center; gap: 12px; }
.drawer-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--violet); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: var(--fw-bold); font-size: 0.95rem;
}
.drawer-name { font-weight: var(--fw-bold); font-size: 0.95rem; color: var(--text-primary); }
.drawer-plan { font-size: 0.75rem; color: var(--text-secondary); }
.drawer-header .topbar-icon-btn { color: var(--text-secondary); width: 32px; height: 32px; margin-top: -4px; margin-right: -4px; }
.drawer-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.drawer-link {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: 12px; color: var(--text-secondary); font-weight: var(--fw-medium);
  font-size: 0.95rem; text-decoration: none; transition: background 0.2s;
}
.drawer-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.drawer-link.active { background: var(--violet-light); color: var(--violet); font-weight: var(--fw-semi); }
.drawer-link.active .icon-sm { font-variation-settings: 'FILL' 1; }
.drawer-divider { height: 1px; background: var(--border); margin: 12px 0; }
.drawer-footer { padding: 16px; border-top: 1px solid var(--border); }
.drawer-logout { width: 100%; border: none; background: transparent; cursor: pointer; text-align: left; }
.drawer-logout:hover { color: var(--red); background: var(--red-light); }

/* Enable on mobile — topbar hidden (Duolingo pattern: no top navbar on mobile) */
@media (max-width: 768px) {
  #mobile-topbar-container { display: block !important; pointer-events: none; }
  #mobile-drawer-container { display: block; }
  /* padding-top handled by responsive.css */
}

/* ─── Mobile Topbar: default mode ──────────────────────────────────── */
.mobile-topbar--default {
  position: relative !important;
  background: transparent !important;
  box-shadow: none !important;
  height: auto !important;
  padding: 0 0 16px 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px;
}

.mobile-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

/* Avatar circle */
.mobile-topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--violet);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.mobile-topbar-avatar:active { opacity: 0.75; }

/* Premium / Súper button */
.mobile-topbar-premium {
  position: relative;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease;
}

.mobile-topbar-premium:active {
  transform: scale(0.95);
  opacity: 0.9;
}

.mobile-topbar-premium img {
  height: 24px;
  width: auto;
  max-width: 115px;
  object-fit: contain;
  display: block;
}

/* Estado free: mantenemos el logo nítido para que atraiga la vista */
.mobile-topbar-premium--locked img {
  opacity: 0.95;
}
.mobile-topbar-premium-lock {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  background: var(--violet);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ─── Mobile Topbar: profile mode ───────────────────────────────────── */
.mobile-topbar--profile {
  position: relative !important;
  background: transparent !important;
  box-shadow: none !important;
  height: auto !important;
  padding: 0 0 12px 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 4px;
}

.mobile-topbar-profile-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mobile-topbar-gear {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
  color: var(--text-primary);
  opacity: 0.6;
  transition: opacity 0.15s;
  text-decoration: none;
}

.mobile-topbar-gear:hover,
.mobile-topbar-gear:active { opacity: 1; }

.mobile-topbar-gear .material-symbols-outlined { font-size: 22px; }

/* ─── Mobile Topbar: settings mode ──────────────────────────────────── */
.mobile-topbar--settings {
  position: relative !important;
  background: transparent !important;
  box-shadow: none !important;
  height: auto !important;
  padding: 4px 0 12px 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 8px;
}

.mobile-topbar-settings-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.mobile-topbar-back {
  position: absolute;
  left: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-primary);
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.18s ease,
              transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-topbar-back:hover { opacity: 1; background: rgba(0,0,0,0.04); }
.mobile-topbar-back:active { opacity: 1; transform: scale(0.92); background: rgba(0,0,0,0.06); }
.mobile-topbar-back .material-symbols-outlined { font-size: 22px; }

[data-theme="dark"] .mobile-topbar--settings { border-bottom-color: var(--border); }
[data-theme="dark"] .mobile-topbar-back:hover { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .mobile-topbar-back:active { background: rgba(255,255,255,0.1); }

/* ─── Dark mode overrides ───────────────────────────────────────────── */
[data-theme="dark"] .mobile-topbar--profile {
  border-bottom-color: var(--border);
}

[data-theme="dark"] .mobile-topbar-avatar {
  background: var(--violet);
}

/* ─── 2. Dark mode (from components.css 368-374) ──────────────────── */
[data-theme="dark"] .drawer-panel {
  background: var(--bg-white);
}

[data-theme="dark"] .drawer-link:hover {
  background: var(--bg-hover);
}

/* ─── Novedades en la barra del celular ───────────────────────────────
   Icono de megáfono entre Súper y el avatar. El punto (.nov-dot, en
   sidebar.css) se reubica aquí sobre la esquina del icono. 40 px de
   área táctil aunque el icono mida 26. */
.mobile-topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.mobile-topbar-nov {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-primary);
  text-decoration: none;
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}

.mobile-topbar-nov .material-symbols-outlined {
  font-size: 26px;
}

.mobile-topbar-nov:active {
  transform: scale(0.94);
}

.mobile-topbar-nov .nov-dot--topbar {
  top: 7px;
  left: auto;
  right: 6px;
  box-shadow: 0 0 0 2px var(--bg-primary, #F8F8F6);
}
