/* dashboard-v2.css — interactive radar dashboard embedded on the homepage */

.dashboard-block {
  background: var(--cream-50, #FFFFFF);
  padding: clamp(3rem, 7vw, 5rem) clamp(1rem, 4vw, 2.5rem);
}
.dashboard-block .section-heading {
  max-width: 44rem;
  margin: 0 0 2rem;
}

.dashboard-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: stretch;
  background: var(--green-700, #12525C);
  color: #fff;
  padding: 1.25rem;
  border-radius: 1.4rem;
  box-shadow: 0 24px 60px -32px rgba(13, 50, 40, 0.55);
  max-width: 1320px;
  margin-inline: auto;
}
@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

.dashboard-tracks,
.dashboard-needs {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 36rem;
}
.dashboard-tracks .eyebrow,
.dashboard-needs .eyebrow {
  font-family: "Alexandria", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--gold-500, #C9A227);
  margin: 0;
}
.dashboard-tracks .portal-track-grid {
  display: grid; gap: 0.5rem;
}
.dashboard-tracks .portal-track-grid button,
.dashboard-tracks .portal-track-grid > * {
  width: 100%;
  text-align: start;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  font-family: "Alexandria", sans-serif;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 0.2rem;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.dashboard-tracks .portal-track-grid button:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--gold-500, #C9A227);
}
.dashboard-tracks .portal-track-grid button.is-active {
  background: var(--gold-500, #C9A227);
  color: #1f1f23;
  border-color: var(--gold-500, #C9A227);
}

.dashboard-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 1rem;
  overflow: hidden;
  min-height: 36rem;
}
.dashboard-stage .globe-stage {
  flex: 1;
  position: relative;
  width: 100%;
  min-height: 30rem;
}
.dashboard-stage canvas.globe-webgl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.dashboard-stage .globe-status-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.25);
}
.dashboard-stage .globe-hint { margin: 0; color: rgba(255, 255, 255, 0.78); }
.dashboard-stage .globe-back-button {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.75rem;
}
.dashboard-stage .globe-back-button[hidden] { display: none; }

.dashboard-needs-head {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 0.85rem;
}
.dashboard-needs-head h3 {
  font-family: "Alexandria", sans-serif;
  font-size: 1.4rem;
  margin: 0.3rem 0;
}
.dashboard-need-line {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
}
.dashboard-urgency {
  display: inline-block;
  margin-top: 0.55rem;
  padding: 0.3rem 0.7rem;
  background: var(--gold-500, #C9A227);
  color: #1f1f23;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.dashboard-urgency:empty { display: none; }

.dashboard-destinations {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 14rem;
  overflow-y: auto;
  padding-inline-end: 0.25rem;
}
.dashboard-destinations:empty::before {
  content: "اختر المسار أولا.";
  display: block;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}
.dashboard-destinations .destination-button {
  display: flex; flex-direction: column; gap: 0.1rem;
  padding: 0.6rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.7rem;
  color: #fff;
  cursor: pointer;
  font-family: "Alexandria", sans-serif;
  text-align: start;
  transition: background-color 180ms ease, border-color 180ms ease;
}
.dashboard-destinations .destination-button:hover { background: rgba(255, 255, 255, 0.1); }
.dashboard-destinations .destination-button.is-active {
  background: rgba(200, 169, 58, 0.16);
  border-color: var(--gold-500, #C9A227);
}
.dashboard-destinations .destination-button span { font-size: 0.7rem; opacity: 0.7; }
.dashboard-destinations .destination-button b { font-size: 0.95rem; }
.dashboard-destinations .destination-button small { font-size: 0.72rem; opacity: 0.7; line-height: 1.4; }

/* Side-list of needs (replacing the old "random blocks" grid) */
.dashboard-need-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.4rem;
}
.dashboard-need-list:empty::before {
  content: "اختر وجهة لعرض الاحتياجات المتاحة.";
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
  padding: 0.4rem 0;
  display: block;
}
.dashboard-need-list .need-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.7rem;
  transition: background-color 180ms ease, border-color 180ms ease;
}
.dashboard-need-list .need-row:hover {
  background: rgba(200, 169, 58, 0.08);
  border-color: rgba(200, 169, 58, 0.4);
}
.dashboard-need-list .need-bullet {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--gold-500, #C9A227);
  flex: 0 0 auto;
}
.dashboard-need-list .need-body {
  display: flex; flex-direction: column; gap: 0.15rem; min-width: 0;
}
.dashboard-need-list .need-title {
  font-family: "Alexandria", sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.3;
  margin: 0;
}
.dashboard-need-list .need-meta {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  line-height: 1.5;
}
.dashboard-need-list .need-cta {
  flex: 0 0 auto;
  background: var(--gold-500, #C9A227);
  color: #1f1f23;
  border: 0;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-family: "Alexandria", sans-serif;
  font-weight: 700;
  font-size: 0.74rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.dashboard-need-list .need-cta:hover { transform: translateY(-1px); }

/* Header switch button (between v3.5-codex / homev2) */
.site-header .home-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0.2rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}
.site-header .home-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.85rem;
  min-width: 3rem;
  padding: 0 0.7rem;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  font-family: "Alexandria", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease;
}
.site-header .home-switch a:hover { color: #fff; }
.site-header .home-switch a.is-active {
  background: #fff;
  color: var(--green-700, #12525C);
}
@media (max-width: 640px) {
  .site-header .home-switch { display: none; }
}

/* Live donation ticker (polls /api/feed every 8s in Phase 1; SSE in Phase 3) */
.dashboard-live-feed {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.dashboard-live-feed-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
}
.dashboard-live-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--gold-500, #C9A227);
  box-shadow: 0 0 0 0 rgba(200, 169, 58, 0.7);
  animation: dashboard-live-pulse 1.6s infinite;
}
.dashboard-live-feed-head strong {
  margin-inline-start: auto;
  font-family: "Alexandria", sans-serif;
  color: var(--gold-500, #C9A227);
  font-size: 0.95rem;
}
.dashboard-live-feed-head small { color: rgba(255, 255, 255, 0.65); }

@keyframes dashboard-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(200, 169, 58, 0.65); }
  70% { box-shadow: 0 0 0 0.55rem rgba(200, 169, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(200, 169, 58, 0); }
}

.dashboard-live-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 12rem;
  overflow-y: auto;
}
.dashboard-live-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.6rem;
  animation: dashboard-live-in 380ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes dashboard-live-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.dashboard-live-heart {
  width: 1.6rem; height: 1.6rem;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  background: rgba(216, 75, 66, 0.18);
  color: #ffb1aa;
  font-size: 0.85rem;
}
.dashboard-live-name {
  margin: 0;
  font-family: "Alexandria", sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  color: #fff;
}
.dashboard-live-meta {
  margin: 0.05rem 0 0;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.4;
}
.dashboard-live-amount {
  font-family: "Alexandria", sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gold-500, #C9A227);
}

/* Urgency level color coding (Phase 2 mechanics, Phase 1 wires the data) */
.dashboard-destinations .destination-button[data-urgency="critical"] {
  border-color: #ff8b80;
  background: rgba(255, 139, 128, 0.08);
}
.dashboard-destinations .destination-button[data-urgency="critical"]::after {
  content: "حرجة";
  font-size: 0.66rem;
  color: #ffb1aa;
  letter-spacing: 0.1em;
  margin-top: 0.1rem;
}
.dashboard-destinations .destination-button[data-urgency="high"] {
  border-color: rgba(232, 200, 70, 0.6);
}
.dashboard-destinations .destination-button[data-urgency="critical"]::before {
  content: "";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: -2px;
  transform: translateY(-50%);
  width: 4px; height: 60%;
  border-radius: 4px;
  background: #ff8b80;
  animation: dashboard-pulse-critical 1.4s infinite;
}
.dashboard-destinations .destination-button {
  position: relative;
}
@keyframes dashboard-pulse-critical {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; box-shadow: 0 0 12px 1px rgba(255, 139, 128, 0.6); }
}

/* Hero live strip on the homepage */
.hero-live-strip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-block-start: 1.2rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.84rem;
  backdrop-filter: blur(6px);
}
.hero-live-strip strong {
  font-family: "Alexandria", sans-serif;
  color: var(--gold-500, #C9A227);
  font-weight: 700;
}
.hero-live-strip .hero-live-dot {
  width: 0.5rem; height: 0.5rem;
  border-radius: 999px;
  background: var(--gold-500, #C9A227);
  animation: dashboard-live-pulse 1.6s infinite;
}
.hero-live-sep { color: rgba(255, 255, 255, 0.4); }

.hero-streak-strip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-block-start: 0.6rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, rgba(200, 169, 58, 0.22), rgba(200, 169, 58, 0.08));
  border: 1px solid rgba(200, 169, 58, 0.4);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.84rem;
}
.hero-streak-strip strong {
  font-family: "Alexandria", sans-serif;
  color: var(--gold-500, #C9A227);
}
.hero-streak-strip a {
  color: var(--gold-500, #C9A227);
  text-decoration: underline;
}

/* Droplet animation when a new donation lands */
@keyframes droplet-rise {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-3.5rem) scale(1.1); }
}
.droplet-burst {
  position: fixed;
  z-index: 1500;
  width: 1.6rem; height: 1.6rem;
  border-radius: 50% 50% 50% 0;
  background: radial-gradient(circle at 30% 30%, var(--gold-500, #C9A227), #6f5414);
  transform: rotate(-45deg);
  pointer-events: none;
  animation: droplet-rise 1.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  box-shadow: 0 4px 14px rgba(200, 169, 58, 0.55);
}
.droplet-burst::after {
  content: "";
  position: absolute;
  inset: 30%;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 50%;
}

/* AI case chat panel */
.case-chat {
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.85rem;
}
.case-chat-head {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem;
  margin-bottom: 0.65rem;
  color: var(--gold-500, #C9A227);
  font-family: "Alexandria", sans-serif;
  font-weight: 700;
}
.case-chat-log {
  display: flex; flex-direction: column; gap: 0.5rem;
  max-height: 12rem;
  overflow-y: auto;
  margin-bottom: 0.6rem;
}
.case-chat-msg {
  padding: 0.55rem 0.75rem;
  border-radius: 0.6rem;
  font-size: 0.84rem;
  line-height: 1.6;
}
.case-chat-msg.user {
  align-self: flex-start;
  background: rgba(200, 169, 58, 0.18);
  color: #fff;
}
.case-chat-msg.bot {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
}
.case-chat-form {
  display: flex; gap: 0.4rem;
}
.case-chat-form input {
  flex: 1;
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.55rem;
  color: #fff;
  font-family: "Alexandria", "Noto Kufi Arabic", sans-serif;
  font-size: 0.84rem;
  outline: 0;
}
.case-chat-form input::placeholder { color: rgba(255, 255, 255, 0.5); }
.case-chat-form input:focus { border-color: var(--gold-500, #C9A227); }
.case-chat-form button {
  padding: 0.55rem 0.95rem;
  background: var(--gold-500, #C9A227);
  color: #1f1f23;
  border: 0;
  border-radius: 0.55rem;
  font-family: "Alexandria", sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}
.case-chat-form button:disabled { opacity: 0.6; cursor: not-allowed; }
.case-chat-suggest {
  display: flex; flex-wrap: wrap; gap: 0.3rem;
  margin-bottom: 0.55rem;
}
.case-chat-suggest button {
  padding: 0.3rem 0.65rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: background-color 180ms ease;
}
.case-chat-suggest button:hover {
  background: var(--gold-500, #C9A227);
  color: #1f1f23;
  border-color: var(--gold-500, #C9A227);
}
