/* ═══════════════════════════════════════════════════════════
   EasyEvent — Tenant Client Stylesheet
   Mobile-first, themed via CSS custom properties.
   ═══════════════════════════════════════════════════════════ */

/* ── Base / Reset ─────────────────────────────────────── */
html { font-size: 14px; height: 100%; overflow: hidden; }
@media (min-width: 768px) { html { font-size: 16px; } }

*, *::before, *::after { box-sizing: border-box; }

/* Suppress focus outlines on elements that are only programmatically
   focusable (tabindex="-1"). These are never reached by keyboard Tab,
   so an outline provides no accessibility benefit. Blazor sets focus
   on headings after enhanced navigation / page reload, which triggers
   the browser's :focus-visible outline — this rule prevents that. */
[tabindex="-1"]:focus {
  outline: none;
}

body {
  margin: 0; padding: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: #1d1d1f;
  background: #f8f9fa;
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
}

/* Blazor mounts inside #app — it must fill the body flex container
   so the .app-shell → .ee-main overflow chain works correctly. */
#app { display: flex; flex-direction: column; flex: 1; overflow: hidden; }

.app-shell { display: flex; flex-direction: column; flex: 1; overflow: hidden; }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(var(--ee-primary-rgb), .45);
}

a { color: var(--ee-primary); }
a:hover { color: var(--ee-accent); }

/* ── Themed buttons ───────────────────────────────────── */
.ee-btn-primary {
  background: var(--ee-primary); color: #fff; border: none;
  padding: .5rem 1.25rem; border-radius: .375rem; text-decoration: none;
  display: inline-flex; align-items: center; gap: .4rem;
  transition: opacity .15s;
}
.ee-btn-primary:hover { opacity: .88; color: #fff; }

.ee-btn-outline {
  background: transparent; color: var(--ee-primary);
  border: 1.5px solid var(--ee-primary);
  padding: .5rem 1.25rem; border-radius: .375rem; text-decoration: none;
  display: inline-flex; align-items: center; gap: .4rem;
  transition: background .15s, color .15s;
}
.ee-btn-outline:hover { background: var(--ee-primary); color: #fff; }

/* ═══════════════════════════════════════════════════════════
   NAVBAR (simplified top header)
   ═══════════════════════════════════════════════════════════ */
.ee-navbar {
  background: var(--ee-primary); color: #fff;
  flex-shrink: 0; z-index: 1030;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.ee-navbar-inner {
  display: flex; align-items: center; justify-content: center;
  padding: .5rem 1rem;
  position: relative;
}
.ee-navbar-actions {
  position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: .5rem;
}
.ee-header-action-btn {
  background: transparent; border: none; color: #fff;
  font-size: 1.15rem; padding: .35rem; border-radius: .375rem;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.ee-header-action-btn:hover { background: rgba(255,255,255,.15); }
.ee-brand {
  color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem;
  display: flex; align-items: center; gap: .5rem;
  white-space: nowrap; overflow: hidden;
}
.ee-brand:hover { color: rgba(255,255,255,.85); }
.ee-brand-logo { height: 28px; width: auto; border-radius: 4px; flex-shrink: 0; }
.ee-brand-titles { display: flex; flex-direction: column; line-height: 1.2; overflow: hidden; text-align: center; align-items: center; }
.ee-brand-title { overflow: hidden; text-overflow: ellipsis; }
.ee-brand-subtitle {
  font-weight: 400; font-size: .7rem; opacity: .7;
  overflow: hidden; text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════════════
   BOTTOM TAB BAR
   ═══════════════════════════════════════════════════════════ */
.ee-tab-bar {
  flex-shrink: 0; z-index: 1030;
  background: #fff; border-top: 1px solid #dee2e6;
  display: flex; justify-content: space-around; align-items: stretch;
  height: 56px;
  box-shadow: 0 -2px 8px rgba(0,0,0,.06);
}
.ee-tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: #6c757d;
  font-size: .7rem; font-weight: 500;
  transition: color .15s;
}
.ee-tab i { font-size: 1.25rem; }
.ee-tab:hover { color: var(--ee-primary); }
.ee-tab.active { color: var(--ee-primary); font-weight: 700; }

/* ═══════════════════════════════════════════════════════════
   MAIN (account for bottom tab bar)
   ═══════════════════════════════════════════════════════════ */
.ee-main {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  /* Prevent native browser pull-to-refresh so our custom gesture takes over */
  overscroll-behavior-y: contain;
  position: relative; /* anchor for the pull-to-refresh indicator */
}

/* ═══════════════════════════════════════════════════════════
   PULL-TO-REFRESH
   ═══════════════════════════════════════════════════════════ */
.ee-ptr-indicator {
  position: absolute;
  top: -48px; left: 50%; margin-left: -20px;
  width: 40px; height: 40px;
  z-index: 1040;
  opacity: 0;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.ee-ptr-spinner {
  width: 28px; height: 28px;
  border: 3px solid rgba(var(--ee-primary-rgb, 13,110,253), .25);
  border-top-color: var(--ee-primary, #0d6efd);
  border-radius: 50%;
  transition: none;
}
.ee-ptr-ready .ee-ptr-spinner {
  border-color: var(--ee-primary, #0d6efd);
  border-top-color: transparent;
}
.ee-ptr-refreshing .ee-ptr-spinner {
  animation: ee-ptr-spin .6s linear infinite;
}
@keyframes ee-ptr-spin {
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════
   EVENT PICKER (Home)
   ═══════════════════════════════════════════════════════════ */
.ee-event-card {
  border: 1px solid #dee2e6; border-radius: .5rem;
  transition: transform .15s, box-shadow .15s; cursor: pointer;
}
.ee-event-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }

/* ═══════════════════════════════════════════════════════════
   SCHEDULE VIEWPORT & DAY NAVIGATION FABs
   ═══════════════════════════════════════════════════════════ */
.ee-schedule-viewport { position: relative; }

.ee-day-fab {
  position: fixed; z-index: 1020;
  bottom: 76px; /* above tab bar */
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(var(--ee-primary-rgb), .55);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
  transition: background .15s;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.ee-day-fab:hover { background: rgba(var(--ee-primary-rgb), .8); color: #fff; }
.ee-day-fab-prev { left: 12px; }
.ee-day-fab-next { right: 12px; }

.ee-schedule-fab-spacer { height: 80px; /* room so FABs don't cover last cards */ }

/* ═══════════════════════════════════════════════════════════
   FILTER TOGGLE & TRACK FILTER
   ═══════════════════════════════════════════════════════════ */
.ee-filter-toggle-row { display: flex; }
.ee-filter-toggle-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .75rem; border-radius: .375rem;
  border: 1.5px solid #dee2e6; background: #fff;
  font-size: .82rem; cursor: pointer; color: #495057;
  transition: all .15s;
}
.ee-filter-toggle-btn:hover { border-color: var(--ee-primary); color: var(--ee-primary); }

.ee-track-filter {
  display: flex; gap: .4rem; flex-wrap: wrap;
  overflow: hidden; transition: max-height .25s ease, opacity .2s ease;
  max-height: 200px; opacity: 1;
}
.ee-track-filter-collapsed {
  max-height: 0; opacity: 0; margin-bottom: 0 !important;
}

.ee-filter-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .7rem; border-radius: 2rem;
  border: 1.5px solid #dee2e6; background: #fff;
  font-size: .82rem; cursor: pointer; color: #495057;
  transition: all .15s;
}
.ee-filter-btn:hover { border-color: var(--ee-primary); color: var(--ee-primary); }
.ee-filter-btn.active {
  background: var(--ee-primary); color: #fff;
  border-color: var(--ee-primary);
}
.ee-filter-btn.active .ee-filter-dot { background: #fff !important; }
.ee-filter-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   SCHEDULE GROUPS & SESSION CARDS
   ═══════════════════════════════════════════════════════════ */
.ee-schedule-group { margin-bottom: 1.5rem; }
.ee-group-header {
  position: sticky; top: 17px; z-index: 10;
  background: var(--ee-primary); color: #fff;
  padding: .5rem 1rem; border-radius: .375rem;
  margin-bottom: .5rem;
}
.ee-group-header h3 { margin: 0; font-size: 1rem; font-weight: 600; }

.ee-session-list { display: flex; flex-direction: column; gap: .5rem; }

/* ── Swipe-to-reveal container ────────────────────────── */
.ee-swipe-container {
  position: relative;
  overflow: hidden;
  border-radius: .5rem;
}

.ee-swipe-actions {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 90px;
  display: flex; align-items: stretch;
}

.ee-swipe-btn {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .25rem;
  width: 100%; border: none; cursor: pointer;
  font-size: .72rem; font-weight: 600;
  color: #fff;
  padding: 0 .5rem;
}

.ee-swipe-remind {
  background: var(--ee-primary, #1a5276);
}

.ee-swipe-cancel {
  background: #dc3545;
}

.ee-swipe-btn i {
  font-size: 1.25rem;
}

.ee-swipe-content {
  position: relative;
  z-index: 1;
  /* will-change set by JS during gesture */
}

/* Reminder badge shown on the card itself */
.ee-session-reminder-badge {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  font-size: .85rem;
  color: var(--session-accent, var(--ee-primary));
  opacity: .7;
  align-self: center;
}

.ee-session-card {
  display: flex; gap: .75rem; padding: .75rem 1rem;
  background: #fff; border-radius: .5rem;
  border-left: 4px solid var(--session-accent, var(--ee-primary));
  text-decoration: none; color: inherit;
  transition: box-shadow .15s, transform .1s;
}
.ee-session-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  transform: translateY(-1px); color: inherit;
}

.ee-session-time {
  flex-shrink: 0; width: 70px;
  display: flex; flex-direction: column; align-items: center;
  font-size: .78rem; color: #6c757d;
  padding-top: .15rem;
}
.ee-session-time-sep { font-size: .65rem; line-height: 1; }

.ee-session-body { flex: 1; min-width: 0; }
.ee-session-title {
  margin: 0 0 .25rem; font-size: .95rem; font-weight: 600;
  color: #1d1d1f;
}
.ee-session-location, .ee-session-speakers {
  margin: 0 0 .2rem; font-size: .8rem; color: #6c757d;
}
.ee-session-tracks { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }

/* ── Track badge ──────────────────────────────────────── */
.ee-track-badge {
  display: inline-block;
  padding: .15rem .55rem; border-radius: 2rem;
  font-size: .72rem; font-weight: 600;
  background: color-mix(in srgb, var(--badge-color, var(--ee-primary)) 15%, transparent);
  color: var(--badge-color, var(--ee-primary));
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   SESSION DETAIL
   ═══════════════════════════════════════════════════════════ */
.ee-session-detail-header {
  border-left: 5px solid var(--session-accent, var(--ee-primary));
  padding-left: 1rem; margin-bottom: 1.5rem;
}

.ee-speaker-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .4rem .75rem; background: #f0f2f5; border-radius: .5rem;
  color: inherit; transition: background .15s;
}
.ee-speaker-chip:hover { background: #e4e7eb; color: inherit; }
.ee-speaker-chip-photo {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
}
.ee-speaker-chip-placeholder {
  width: 36px; height: 36px; border-radius: 50%;
  background: #dee2e6; display: flex; align-items: center; justify-content: center;
  color: #6c757d; font-size: .9rem;
}

/* ═══════════════════════════════════════════════════════════
   HANDBOOK
   ═══════════════════════════════════════════════════════════ */
.ee-handbook-layout {
  display: flex; min-height: calc(100vh - 110px);
}
.ee-handbook-sidebar {
  width: 260px; flex-shrink: 0;
  background: #fff; border-right: 1px solid #dee2e6;
  padding: 1rem 0; overflow-y: auto;
}
.ee-handbook-sidebar-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 1rem .75rem; border-bottom: 1px solid #eee;
}
.ee-handbook-content { flex: 1; padding: 1.5rem 2rem; max-width: 850px; }
.ee-handbook-toc-toggle {
  position: fixed; bottom: 72px; left: 1.25rem; z-index: 1020;
  background: var(--ee-primary); color: #fff;
  border: none; padding: .5rem 1rem; border-radius: 2rem;
  box-shadow: 0 3px 10px rgba(0,0,0,.2);
  font-size: .85rem; cursor: pointer;
  display: none;
}
.ee-toc-item {
  display: block; padding: .4rem 1rem;
  color: #495057; text-decoration: none;
  font-size: .88rem; transition: background .1s;
}
a.ee-toc-item:hover { background: #f0f2f5; color: var(--ee-primary); }
.ee-toc-item.active { color: var(--ee-primary); font-weight: 600; background: rgba(var(--ee-primary-rgb), .08); border-right: 3px solid var(--ee-primary); }
.ee-toc-child { padding-left: 2rem; font-size: .82rem; }
.ee-toc-children { margin: 0; }
.ee-toc-heading { color: #6c757d; font-weight: 600; cursor: default; }

/* Handbook – full-page TOC (root page) */
.ee-handbook-toc-page { padding: 1.5rem 2rem; max-width: 700px; margin: 0 auto; }
.ee-handbook-toc-page h1 { margin-bottom: 1.25rem; }
.ee-handbook-toc-full { display: flex; flex-direction: column; }
.ee-toc-full-item {
  display: block; padding: .6rem 1rem;
  color: #212529; text-decoration: none;
  font-size: 1rem; border-bottom: 1px solid #f0f2f5;
  transition: background .1s;
}
.ee-toc-full-item:hover { background: #f0f2f5; color: var(--ee-primary); }
.ee-toc-full-heading {
  display: block; padding: .6rem 1rem;
  color: #6c757d; font-weight: 600; font-size: 1rem;
  border-bottom: 1px solid #f0f2f5; cursor: default;
}
.ee-toc-full-child { padding-left: 2.25rem; font-size: .92rem; }
.ee-toc-full-children { margin: 0; }

@media (max-width: 767.98px) {
  .ee-handbook-toc-page { padding: 1rem; }
  .ee-handbook-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    z-index: 1040; width: 280px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,.15);
  }
  .ee-handbook-sidebar.open { transform: translateX(0); }
  .ee-handbook-toc-toggle { display: inline-flex; align-items: center; gap: .35rem; }
  .ee-handbook-content { padding: 1rem; }
}

/* ═══════════════════════════════════════════════════════════
   SPEAKERS
   ═══════════════════════════════════════════════════════════ */
.ee-speaker-card { display: block; color: inherit; }
.ee-speaker-card:hover { color: var(--ee-primary); }
.ee-speaker-card-photo {
  width: 100%; aspect-ratio: 1; border-radius: .5rem; object-fit: cover;
  background: #eee;
}
.ee-speaker-card-placeholder {
  width: 100%; aspect-ratio: 1; border-radius: .5rem;
  background: #e9ecef; display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; color: #adb5bd;
}
.ee-speaker-card-name { font-size: .88rem; font-weight: 600; }

.ee-speaker-detail-photo {
  width: 140px; height: 140px; border-radius: .5rem; object-fit: cover;
}
.ee-speaker-detail-placeholder {
  width: 140px; height: 140px; border-radius: .5rem;
  background: #e9ecef; display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: #adb5bd;
}

/* ═══════════════════════════════════════════════════════════
   MAPS
   ═══════════════════════════════════════════════════════════ */
.ee-map-tabs { display: flex; gap: .5rem; flex-wrap: wrap; }
.ee-map-tab {
  padding: .4rem .85rem; border-radius: .375rem;
  border: 1.5px solid #dee2e6; background: #fff;
  color: #495057; text-decoration: none; font-size: .88rem;
  transition: all .15s;
}
.ee-map-tab:hover { border-color: var(--ee-primary); color: var(--ee-primary); }
.ee-map-tab.active { background: var(--ee-primary); color: #fff; border-color: var(--ee-primary); }

.ee-map-container {
  width: 100%; height: 500px; border-radius: .5rem;
  border: 1px solid #dee2e6; overflow: hidden;
}
@media (max-width: 767.98px) {
  .ee-map-container { height: 350px; }
}

.ee-map-pin div {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

/* Pin list below map */
.ee-pin-list { display: flex; flex-direction: column; gap: .5rem; }
.ee-pin-list-item {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .65rem .75rem; border-radius: .5rem;
  border: 1px solid var(--bs-border-color, #dee2e6);
  cursor: pointer; transition: background .2s, box-shadow .2s;
}
.ee-pin-list-item:hover { background: rgba(var(--bs-primary-rgb, 13,110,253), .06); }
.ee-pin-list-color {
  flex-shrink: 0; width: 14px; height: 14px; border-radius: 50%;
  margin-top: 3px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15);
}
.ee-pin-list-content { min-width: 0; }
.ee-pin-list-label { font-weight: 600; font-size: .95rem; }
.ee-pin-list-desc { font-size: .85rem; margin-top: .15rem; }

/* Highlight flash when a map pin is tapped */
@keyframes ee-pin-flash {
  0%   { background: rgba(255, 193, 7, .35); }
  100% { background: transparent; }
}
.ee-pin-highlight { animation: ee-pin-flash 1.5s ease-out; }

/* Custom image map viewer/editor */
.ee-custom-map-viewport {
  position: relative; transform-origin: 0 0;
  width: 100%; will-change: transform;
}
.ee-custom-map-image {
  display: block; width: 100%; height: auto;
  user-select: none; -webkit-user-select: none;
  pointer-events: none;
}
.ee-custom-map-pins {
  position: absolute; inset: 0;
  pointer-events: none;
}
.ee-custom-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: auto; cursor: pointer;
  z-index: 2;
}
.ee-custom-pin-dot {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  transition: box-shadow .15s;
}
.ee-custom-pin:hover .ee-custom-pin-dot {
  box-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.ee-custom-map-popup {
  position: absolute;
  transform: translate(-50%, calc(-100% - 28px));
  background: #fff; border-radius: .5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  padding: .5rem .75rem; min-width: 140px; max-width: 240px;
  z-index: 10; pointer-events: auto;
  font-size: .85rem;
}
.ee-custom-map-popup-close {
  position: absolute; top: 2px; right: 6px;
  background: none; border: none; font-size: 1rem;
  color: #666; cursor: pointer; line-height: 1;
}
.ee-map-container { touch-action: none; }

/* ═══════════════════════════════════════════════════════════
   ABOUT
   ═══════════════════════════════════════════════════════════ */
.ee-about-logo { max-height: 80px; width: auto; }

/* ═══════════════════════════════════════════════════════════
   MARKDOWN CONTENT
   ═══════════════════════════════════════════════════════════ */
.ee-markdown-content { line-height: 1.7; }
.ee-markdown-content h1 { font-size: 1.6rem; margin-bottom: 1rem; }
.ee-markdown-content h2 { font-size: 1.3rem; margin-top: 1.5rem; margin-bottom: .75rem; }
.ee-markdown-content h3 { font-size: 1.1rem; margin-top: 1.25rem; margin-bottom: .5rem; }
.ee-markdown-content p { margin-bottom: .75rem; }
.ee-markdown-content ul, .ee-markdown-content ol { margin-bottom: .75rem; padding-left: 1.5rem; }
.ee-markdown-content table { border-collapse: collapse; margin: 1rem 0; width: 100%; }
.ee-markdown-content th, .ee-markdown-content td { border: 1px solid #dee2e6; padding: .5rem .75rem; }
.ee-markdown-content th { background: #f8f9fa; font-weight: 600; }
.ee-markdown-content blockquote {
  border-left: 4px solid var(--ee-accent); padding: .5rem 1rem;
  margin: 1rem 0; background: #fefcf7; color: #555;
}
.ee-markdown-content img { max-width: 100%; height: auto; border-radius: .375rem; }
.ee-markdown-content code {
  background: #f0f2f5; padding: .15rem .35rem; border-radius: .25rem;
  font-size: .88em;
}
.ee-markdown-content pre {
  background: #1e1e2e; color: #cdd6f4; padding: 1rem;
  border-radius: .5rem; overflow-x: auto; margin: 1rem 0;
}
.ee-markdown-content pre code { background: none; padding: 0; }