/* planner-mobile.css
 * Electric82 Planner — Phase 9I Mobile / Touch UX
 * Load AFTER tailwind CDN in index.html.
 *
 * Design principles:
 *   • Bottom toolbar — thumb-reachable, horizontally scrollable
 *   • 44×44px minimum touch targets (Apple HIG / WCAG 2.5.5)
 *   • Bottom-sheet right panel slides up over canvas
 *   • Topbar collapses to icon strip
 *   • canvas wrapper: touch-action:none to prevent page scroll during draw
 *   • Amber #E8A020 active state, dark #1a1a1a surfaces
 */

/* ─── Reset / base ─────────────────────────────────────────────────────────── */

.planner-canvas-wrap {
  /* Desktop: unrestricted */
  position: relative;
  flex: 1;
  overflow: hidden;
}

/* ─── Desktop topbar (unchanged) ───────────────────────────────────────────── */

.planner-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  min-height: 48px;
  flex-shrink: 0;
  z-index: 100;
}

/* ─── Desktop toolbar (left side) ──────────────────────────────────────────── */

.planner-toolbar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 8px;
  background: #1a1a1a;
  border-right: 1px solid #333;
  width: 56px;
  flex-shrink: 0;
  overflow-y: auto;
}

.planner-tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.planner-tool-btn:hover,
.planner-tool-btn:focus-visible {
  background: #2a2a2a;
  color: #e0e0e0;
}

.planner-tool-btn.active {
  background: #E8A02022;
  color: #E8A020;
  outline: 1.5px solid #E8A02066;
}

/* ─── Desktop right panel ──────────────────────────────────────────────────── */

.planner-right-panel {
  width: 220px;
  flex-shrink: 0;
  background: #1a1a1a;
  border-left: 1px solid #333;
  overflow-y: auto;
}

/* ─── Mobile overrides ─────────────────────────────────────────────────────── */

@media (max-width: 768px) {

  /* ── Canvas wrap: block native scroll/zoom so touch events reach canvas ── */
  .planner-canvas-wrap {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
  }

  /* ── Topbar: compact single row, no text labels ───────────────────────── */
  .planner-topbar {
    padding: 4px 8px;
    min-height: 44px;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .planner-topbar::-webkit-scrollbar { display: none; }

  /* Hide text labels in topbar buttons on mobile */
  .planner-topbar .planner-topbar-label { display: none; }

  /* ── Toolbar: fixed bottom strip, horizontal scroll ──────────────────── */
  .planner-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 6px 8px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
    background: #1a1a1a;
    border-right: none;
    border-top: 1px solid #333;
    height: auto;
    z-index: 200;
    gap: 6px;
    /* Prevent content from being obscured under toolbar */
  }

  .planner-toolbar::-webkit-scrollbar { display: none; }

  /* Canvas shrinks to leave room for bottom toolbar (~68px) */
  .planner-canvas-wrap {
    padding-bottom: 68px;
  }

  /* ── Tool buttons: 44×44 minimum touch target ─────────────────────────── */
  .planner-tool-btn {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 20px;
    flex-shrink: 0;
  }

  /* ── Right panel: bottom sheet ────────────────────────────────────────── */
  .planner-right-panel {
    position: fixed;
    bottom: 68px; /* above toolbar */
    left: 0;
    right: 0;
    width: 100%;
    max-height: 50vh;
    border-left: none;
    border-top: 1px solid #333;
    border-radius: 14px 14px 0 0;
    background: #1a1a1a;
    overflow-y: auto;
    z-index: 300;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .planner-right-panel.open {
    transform: translateY(0);
  }

  /* Drag handle indicator */
  .planner-right-panel::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: #444;
    border-radius: 2px;
    margin: 10px auto 6px;
  }

  /* ── Property panel hamburger trigger ─────────────────────────────────── */
  .planner-properties-trigger {
    display: flex;
    position: fixed;
    bottom: calc(68px + 12px);
    right: 12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #E8A020;
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
    cursor: pointer;
    z-index: 250;
    border: none;
  }

  /* ── Modals on mobile: full-screen friendly ───────────────────────────── */
  .planner-modal-box {
    max-width: 100vw !important;
    width: 100vw !important;
    border-radius: 14px 14px 0 0 !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    max-height: 92vh !important;
    margin: 0 !important;
  }

  /* ── Hide pro-only complexity on mobile (default simple mode) ─────────── */
  .planner-pro-only-mobile { display: none !important; }

  /* ── Touch-friendly form inputs ───────────────────────────────────────── */
  .planner-toolbar input,
  .planner-topbar input {
    min-height: 44px;
    font-size: 16px; /* prevents iOS zoom on focus */
  }
}

/* ─── Pinch-zoom cursor feedback ───────────────────────────────────────────── */

.planner-canvas-wrap.pinching {
  cursor: zoom-in;
}

/* ─── Onboarding spotlight (Phase 9K) ─────────────────────────────────────── */

.planner-spotlight-overlay {
  position: fixed;
  inset: 0;
  z-index: 8500;
  pointer-events: none;
}

.planner-spotlight-cutout {
  position: absolute;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.62);
  transition: all 0.3s ease;
  pointer-events: none;
}

.planner-tour-tooltip {
  position: absolute;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 14px 18px;
  max-width: 280px;
  min-width: 200px;
  font-family: 'Montserrat', sans-serif;
  color: #e0e0e0;
  font-size: 13px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
  z-index: 8600;
  pointer-events: all;
}

.planner-tour-tooltip::before {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  background: #E8A020;
  border-radius: 50%;
  top: -5px;
  left: 18px;
}
