/* ════════════════════════════════════════════════════════════════
   EventStrand — Logged-in App UI styles
   Dashboard · Subscriptions · Library · My Strands · Personal ·
   Braids · Workspaces · Account · Notifications · PWA banner ·
   Public strand/braid/profile views · Analytics
   Loaded after the inline <style> in index.html, so it inherits all
   design tokens (--bg, --surface, --primary, fonts, etc.).
   ════════════════════════════════════════════════════════════════ */

/* --amber is referenced in index.html but not defined in :root */
:root { --amber: #F0A46A; }

/* ── NAV: bell + avatar ── */
.nav-notif-btn {
  position: relative; width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border2);
  color: var(--text); font-size: 17px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
}
.nav-notif-btn:hover { border-color: var(--primary); background: var(--surface2); }
.nav-notif-dot {
  position: absolute; top: 7px; right: 8px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--red);
  border: 2px solid var(--bg); box-shadow: 0 0 6px var(--red);
}
.nav-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-size: 16px; font-weight: 700;
  color: #fff; cursor: pointer; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12); transition: transform 0.18s;
}
.nav-avatar:hover { transform: translateY(-1px); }

/* ── Back button on public views ── */
.app-back {
  background: var(--surface); border: 1px solid var(--border2);
  color: var(--text-dim); border-radius: 10px; padding: 8px 16px;
  font-family: 'Outfit', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.18s;
}
.app-back:hover { color: var(--text); border-color: var(--primary); background: var(--surface2); }

/* ════════ DASHBOARD TABS ════════ */
.dash-tabs {
  display: flex; gap: 4px; margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.dash-tabs::-webkit-scrollbar { display: none; }
.dash-tab {
  flex-shrink: 0; padding: 11px 16px; background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: 600;
  color: var(--text-dim); cursor: pointer; white-space: nowrap;
  transition: color 0.18s, border-color 0.18s;
}
.dash-tab:hover { color: var(--text); }
.dash-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.dash-panel { animation: esFade 0.25s ease; }
@keyframes esFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ════════ EMPTY STATES ════════ */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 48px 24px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.empty-state-icon { font-size: 44px; margin-bottom: 16px; line-height: 1; }
.empty-state-title { font-family: 'Fraunces', serif; font-size: 20px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state-sub { font-size: 14px; color: var(--text-dim); line-height: 1.65; max-width: 440px; margin-bottom: 20px; }
.empty-state .btn { margin-top: 4px; }

.empty-notes { width: 100%; max-width: 440px; margin-top: 24px; text-align: left; }
.empty-notes-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px;
}
.empty-notes textarea {
  width: 100%; min-height: 80px; resize: vertical; box-sizing: border-box;
  background: var(--bg2); border: 1.5px solid var(--border2); border-radius: 12px;
  padding: 12px 14px; color: var(--text); font-family: 'Outfit', sans-serif;
  font-size: 14px; line-height: 1.6; outline: none; transition: border-color 0.18s;
}
.empty-notes textarea:focus { border-color: var(--primary); }
.empty-notes textarea::placeholder { color: var(--text-faint); }

/* ════════ UPCOMING EVENT FEED ════════ */
.event-feed-item {
  display: flex; gap: 16px; padding: 16px; margin-bottom: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; transition: border-color 0.18s, transform 0.18s;
}
.event-feed-item:hover { border-color: var(--border2); transform: translateX(2px); }
.efi-date {
  flex-shrink: 0; width: 52px; height: 56px; border-radius: 12px;
  background: var(--primary-glow); border: 1px solid rgba(108,143,255,0.28);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.efi-date-day { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 700; color: var(--primary); line-height: 1; }
.efi-date-mon { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); margin-top: 2px; }
.efi-body { flex: 1; min-width: 0; }
.efi-name { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.efi-meta { font-size: 13px; color: var(--text-dim); }
.efi-strand { font-size: 12px; color: var(--primary); margin-top: 4px; }
.efi-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }

/* ════════ SUBSCRIPTIONS / INBOX ════════ */
.inbox-layout { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: start; }
.inbox-sidebar { display: flex; flex-direction: column; gap: 4px; }
.inbox-ws-tab {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-radius: 10px; cursor: pointer; font-size: 13px; color: var(--text-dim);
  transition: all 0.16s;
}
.inbox-ws-tab:hover { background: var(--surface); color: var(--text); }
.inbox-ws-tab.active { background: var(--primary-glow); color: var(--primary); font-weight: 600; }
.inbox-ws-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-main { display: flex; flex-direction: column; gap: 8px; }
.inbox-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  transition: border-color 0.18s;
}
.inbox-row:hover { border-color: var(--border2); }
.inbox-row.unread { border-color: rgba(108,143,255,0.4); background: var(--surface2); }
.inbox-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; transition: opacity 0.2s; }
.inbox-row-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-row-meta { font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.unsub-btn {
  flex-shrink: 0; background: none; border: 1px solid var(--border2);
  color: var(--text-faint); border-radius: 8px; padding: 5px 12px;
  font-size: 12px; font-family: 'Outfit', sans-serif; cursor: pointer; transition: all 0.16s;
}
.unsub-btn:hover { color: var(--red); border-color: var(--red); }

/* ════════ STRAND / BRAID MANAGEMENT CARDS ════════ */
#dash-my-strands .strand-card,
#dash-my-braids .strand-card,
#personal-strands-list .strand-card {
  padding: 18px; margin-bottom: 12px; cursor: default;
}
#dash-my-strands .strand-card:hover,
#dash-my-braids .strand-card:hover,
#personal-strands-list .strand-card:hover { transform: none; box-shadow: none; border-color: var(--border2); }
.strand-card-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.strand-card-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.strand-card-name { font-family: 'Fraunces', serif; font-size: 17px; font-weight: 600; color: var(--text); }
.strand-card-subs { margin-left: auto; font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.strand-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sc-btn {
  background: var(--surface2); border: 1px solid var(--border2); color: var(--text-dim);
  border-radius: 8px; padding: 7px 14px; font-size: 12.5px; font-weight: 600;
  font-family: 'Outfit', sans-serif; cursor: pointer; transition: all 0.16s;
}
.sc-btn:hover { color: var(--text); border-color: var(--primary); }
.sc-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.sc-btn.primary:hover { background: #8aaeff; color: #fff; }
.pub-status-badge {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
  letter-spacing: 0.3px; white-space: nowrap; border: 1px solid transparent;
}
.pub-status-badge.live { background: var(--green-glow); color: var(--green); border-color: rgba(17,219,166,0.32); }
.pub-status-badge.draft { background: var(--surface2); color: var(--text-faint); border-color: var(--border2); }

/* Personal-strand cards */
.my-strand-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin-bottom: 12px; }
.my-strand-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.my-strand-card-title { font-family: 'Fraunces', serif; font-size: 16px; font-weight: 600; color: var(--text); }
.my-strand-card-meta { font-size: 12px; color: var(--text-faint); }
.my-strand-card-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ════════ AI CALLOUT ════════ */
.ai-callout {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px;
  background: linear-gradient(135deg, var(--primary-glow), var(--violet-glow));
  border: 1px solid rgba(108,143,255,0.28); border-radius: 14px; margin-bottom: 20px;
}
.ai-callout-icon { font-size: 20px; line-height: 1.4; }
.ai-callout-text { font-size: 13.5px; color: var(--text-dim); line-height: 1.6; }
.ai-callout-text strong { color: var(--text); }
.ai-callout-text a { color: var(--primary); text-decoration: none; font-weight: 600; }
.ai-callout-text a:hover { text-decoration: underline; }

/* ════════ WORKSPACES ════════ */
.ws-card {
  display: flex; align-items: center; gap: 16px; padding: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.ws-icon {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  background: var(--surface2); border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.ws-name { font-size: 16px; font-weight: 600; color: var(--text); }
.ws-meta { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.ws-active-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.3px; padding: 4px 10px;
  border-radius: 20px; background: var(--green-glow); color: var(--green);
  border: 1px solid rgba(17,219,166,0.32);
}
.ws-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ════════ ACCOUNT / SETTINGS ════════ */
.settings-section { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin-bottom: 16px; }
.settings-section-title {
  font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 18px;
}
.profile-pic {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-size: 24px; font-weight: 700; color: #fff;
}
.profile-pic img { width: 100%; height: 100%; object-fit: cover; }
.settings-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 0;
  border-top: 1px solid var(--border); flex-wrap: wrap;
}
.settings-row:first-of-type { border-top: none; }
.settings-row-label { font-size: 14px; color: var(--text-dim); min-width: 110px; }
.settings-row-value { flex: 1; font-size: 14px; color: var(--text); }
.settings-row-value code { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--primary); }
.settings-edit-btn {
  margin-left: auto; background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text-dim); border-radius: 8px; padding: 7px 16px; font-size: 13px;
  font-weight: 600; font-family: 'Outfit', sans-serif; cursor: pointer; transition: all 0.16s;
}
.settings-edit-btn:hover { color: var(--text); border-color: var(--primary); }

/* ════════ STARRED / INTERESTED ════════ */
.interested-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px;
}
.interested-item-body { flex: 1; min-width: 0; }
.interested-item-name { font-size: 15px; font-weight: 600; color: var(--text); }
.interested-item-meta { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.interested-item-time { font-size: 12px; color: var(--primary); margin-top: 3px; }
.interested-item-remove {
  flex-shrink: 0; background: none; border: none; color: var(--text-faint);
  font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: all 0.16s;
}
.interested-item-remove:hover { color: var(--red); background: rgba(255,95,122,0.1); }
.interested-empty { text-align: center; padding: 48px 24px; color: var(--text-dim); font-size: 14px; line-height: 1.6; }

/* ════════ PUBLIC STRAND / BRAID / PROFILE ════════ */
.pub-strand-header { padding: 24px; border-radius: 16px; margin-bottom: 24px; background: var(--surface); border: 1px solid var(--border2); }
.passive-signup {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 32px; padding: 24px;
  background: linear-gradient(135deg, var(--primary-glow), var(--violet-glow));
  border: 1px solid rgba(108,143,255,0.28); border-radius: 16px;
}
.passive-signup-text { flex: 1; min-width: 220px; }
.passive-signup-text h4 { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.passive-signup-text p { font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.passcode-gate {
  max-width: 380px; margin: 40px auto; text-align: center; padding: 36px 28px;
  background: var(--surface); border: 1px solid var(--border2); border-radius: 18px;
}
.view-count-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  color: var(--text-faint); background: var(--surface2);
  border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px;
}

/* ════════ BRAID BUILDER PICKERS ════════ */
.vis-selector { display: flex; gap: 8px; flex-wrap: wrap; }
.vis-btn {
  flex: 1; min-width: 110px; padding: 11px; border-radius: 10px;
  background: var(--surface); border: 1.5px solid var(--border2); color: var(--text-dim);
  font-size: 13px; font-weight: 600; font-family: 'Outfit', sans-serif; cursor: pointer; transition: all 0.18s;
}
.vis-btn:hover { border-color: var(--primary); color: var(--text); }
.vis-btn.active { background: var(--primary-glow); border-color: var(--primary); color: var(--primary); }
.strand-picker-grid { display: flex; flex-direction: column; gap: 8px; }
.strand-picker-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--surface); border: 1.5px solid var(--border2); border-radius: 10px;
  cursor: pointer; transition: border-color 0.18s;
}
.strand-picker-row:hover { border-color: var(--primary); }
.strand-picker-check { width: 18px; height: 18px; accent-color: var(--primary); }

/* ════════ QR DISPLAY ════════ */
.qr-display {
  text-align: center; padding: 28px; background: var(--surface);
  border: 1px solid var(--border2); border-radius: 18px;
}
.qr-display img { background: #fff; padding: 12px; border-radius: 12px; }
.strand-url {
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--primary);
  background: var(--bg2); border: 1px solid var(--border2); border-radius: 8px;
  padding: 10px 14px; word-break: break-all; margin: 16px 0;
}

/* ════════ NOTIFICATIONS DRAWER ════════ */
#notif-drawer {
  position: fixed; top: 0; right: 0; z-index: 400;
  width: 360px; max-width: 90vw; height: 100vh;
  background: var(--bg2); border-left: 1px solid var(--border2);
  box-shadow: -20px 0 60px rgba(0,0,0,0.5);
  transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.22,1,0.36,1);
  display: flex; flex-direction: column; overflow-y: auto;
}
#notif-drawer.open { transform: translateX(0); }
.notif-header {
  position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 20px; background: var(--bg2); border-bottom: 1px solid var(--border);
}
.notif-title { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 600; color: var(--text); }
#notif-list { padding: 8px; }
.notif-empty { padding: 48px 24px; text-align: center; color: var(--text-faint); font-size: 14px; }
.notif-item { padding: 14px 16px; border-radius: 10px; cursor: pointer; transition: background 0.16s; }
.notif-item:hover { background: var(--surface); }
.notif-item.unread { background: var(--primary-glow); }
.notif-item-text { font-size: 14px; color: var(--text); line-height: 1.5; }
.notif-item-meta { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

/* ════════ ANALYTICS DRAWER ════════ */
#analytics-drawer {
  position: fixed; top: 0; right: 0; z-index: 400;
  width: 420px; max-width: 92vw; height: 100vh; padding: 24px;
  background: var(--bg2); border-left: 1px solid var(--border2);
  box-shadow: -20px 0 60px rgba(0,0,0,0.5);
  transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.22,1,0.36,1);
  overflow-y: auto;
}
#analytics-drawer.open { transform: translateX(0); }
.drawer-close {
  float: right; background: var(--surface); border: 1px solid var(--border2);
  color: var(--text-dim); width: 32px; height: 32px; border-radius: 8px;
  font-size: 14px; cursor: pointer; transition: all 0.16s;
}
.drawer-close:hover { color: var(--text); border-color: var(--primary); }
.analytics-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 16px 0 24px; }
.analytics-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.analytics-stat-num { font-family: 'Fraunces', serif; font-size: 26px; font-weight: 700; color: var(--primary); }
.analytics-stat-label { font-size: 12px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }
.analytics-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; color: var(--text-dim); }
.analytics-bar { flex: 1; height: 8px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.analytics-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--violet)); border-radius: 4px; }
.chart-area { display: flex; align-items: flex-end; gap: 6px; height: 120px; margin: 16px 0; }
.chart-bar { flex: 1; background: var(--primary-glow); border: 1px solid rgba(108,143,255,0.3); border-radius: 4px 4px 0 0; min-height: 4px; transition: height 0.4s; }

/* ════════ PWA INSTALL BANNER ════════ */
#pwa-banner {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 160%);
  z-index: 350; width: min(440px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--border2); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1);
}
#pwa-banner.show { transform: translate(-50%, 0); }

/* ════════ RESPONSIVE ════════ */
@media (max-width: 760px) {
  .app-view { padding: 20px 18px 60px; }
  .app-topbar { padding: 0 18px; }
  .inbox-layout { grid-template-columns: 1fr; }
  .inbox-sidebar { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .inbox-ws-tab { flex-shrink: 0; }
  .analytics-stat-grid { grid-template-columns: 1fr 1fr; }
}
