/* ==========================================================================
   Halososial Meet Up — Welcome Screen Design System
   PRD v1.2.3 Approved | Phase 3 Production CSS
   Stack: Vanilla CSS3 — No framework dependencies
   ========================================================================== */

/* ─────────────────────────────────────────────
   0. CSS CUSTOM PROPERTIES (Design Tokens)
───────────────────────────────────────────── */
:root {
  /* Color palette */
  --clr-bg-start:       #0d0318;
  --clr-bg-end:         #1e0641;
  --clr-bg-mid:         #150529;
  --clr-surface-glass: rgba(255, 255, 255, 0.07);
  --clr-surface-border: rgba(255, 255, 255, 0.14);
  --clr-surface-hover:  rgba(255, 255, 255, 0.11);

  --clr-accent-primary:   #a855f7;
  --clr-accent-bright:    #c084fc;
  --clr-accent-electric:  #e879f9;
  --clr-accent-sky:       #38bdf8;
  --clr-accent-indigo:    #818cf8;
  --clr-accent-glow:      rgba(168, 85, 247, 0.35);
  --clr-accent-glow-soft: rgba(168, 85, 247, 0.12);

  --clr-text-primary:   #ffffff;
  --clr-text-secondary: rgba(255, 255, 255, 0.90);
  --clr-text-muted:     rgba(255, 255, 255, 0.72);
  --clr-text-code:      #ffffff;

  --clr-badge-bg:    rgba(255, 255, 255, 0.08);
  --clr-badge-border:rgba(255, 255, 255, 0.15);
  --clr-success:     #34d399;
  --clr-warn:        #f59e0b;
  --clr-error:       #f87171;

  /* Typography — Rubik as primary font */
  --font-display:  'Rubik', system-ui, sans-serif;
  --font-mono:     'Rubik', system-ui, sans-serif;

  /* Spacing */
  --gap-panel:   3rem;
  --gap-card:    2rem;
  --gap-meta:    1.25rem;
  --radius-xl:   24px;
  --radius-lg:   16px;
  --radius-md:   12px;
  --radius-pill: 999px;

  /* Glass effect */
  --glass-blur:    20px;
  --glass-blur-sm: 12px;

  /* Animation */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;
}

/* ─────────────────────────────────────────────
   1. RESET & BASE
───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-display);
  color: var(--clr-text-primary);
  background-color: var(--clr-bg-start);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;          /* Kiosk mode: no scrollbars */
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
}

/* ─────────────────────────────────────────────
   2. BACKGROUND LAYER
───────────────────────────────────────────── */
#bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: var(--clr-bg-start);
  background-image:
    radial-gradient(ellipse 80% 70% at 20% 30%, rgba(88, 28, 180, 0.45) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(56, 189, 248, 0.15) 0%, transparent 55%),
    linear-gradient(160deg, var(--clr-bg-start) 0%, #170432 40%, var(--clr-bg-end) 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  transition: opacity var(--transition-slow);
}

#bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(13, 3, 24, 0.80) 0%,
    rgba(21, 5, 41, 0.75) 50%,
    rgba(30, 6, 65, 0.80) 100%
  );
  transition: background var(--transition-slow);
}

/* When custom KV background image is active:
   Display pure KV artwork without overlays, tints, glow orbs, or blur filters */
#bg-layer.has-bg-image {
  background-color: transparent;
  filter: none;
  border: none;
  outline: none;
}

#bg-layer.has-bg-image #bg-overlay {
  display: none;
}

#bg-layer.has-bg-image .glow-orb {
  display: none;
}

/* Decorative glow orbs */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: orbFloat 8s ease-in-out infinite alternate;
  pointer-events: none;
}
.glow-orb--1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.4) 0%, transparent 70%);
  top: -20%; left: -10%;
  animation-duration: 9s;
}
.glow-orb--2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.25) 0%, transparent 70%);
  bottom: -15%; right: -5%;
  animation-duration: 11s;
  animation-delay: -4s;
}
.glow-orb--3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(232, 121, 249, 0.2) 0%, transparent 70%);
  top: 50%; right: 30%;
  animation-duration: 7s;
  animation-delay: -2s;
}

@keyframes orbFloat {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30px, -20px) scale(1.08); }
}

/* ─────────────────────────────────────────────
   3. MAIN APP CONTAINER (Two-Panel Split)
───────────────────────────────────────────── */
.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: var(--gap-panel);
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1800px;
  margin: 0 auto;
  padding: 2.5rem 2.5rem 2rem;

  /* Safe-area for notched devices */
  padding-top: max(2.5rem, env(safe-area-inset-top));
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
  padding-left: max(2.5rem, env(safe-area-inset-left));
  padding-right: max(2.5rem, env(safe-area-inset-right));
}

/* ─────────────────────────────────────────────
   4. PANELS
───────────────────────────────────────────── */
.panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

/* Left: ~45% width */
.panel--left {
  flex: 0 0 45%;
  max-width: 45%;
  gap: 1.25rem;
}

/* Right: ~55% width */
.panel--right {
  flex: 1;
  min-width: 0;
  gap: 1.5rem;
  align-items: flex-start;
}

/* ─────────────────────────────────────────────
   5. GLASSMORPHIC CARD UTILITY
───────────────────────────────────────────── */
.glass-card {
  background: var(--clr-surface-glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--clr-surface-border);
  border-radius: var(--radius-xl);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

.glass-pill {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(var(--glass-blur-sm));
  -webkit-backdrop-filter: blur(var(--glass-blur-sm));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  padding: 0.4rem 1rem;
}

/* ─────────────────────────────────────────────
   6. LEFT PANEL — BANNER CONTAINER
   (No glass card, no border/outline, no shadow, no blur)
───────────────────────────────────────────── */
.banner-card {
  position: relative;
  width: 100%;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
}

.banner-card:hover {
  box-shadow: none;
}

.banner-img {
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  display: block;
  transition: opacity var(--transition-base);
}

.banner-img[src=""], .banner-img:not([src]) {
  display: none;
}

/* Banner fallback placeholder */
.banner-placeholder {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 280px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.05);
  border: 2px dashed rgba(255, 255, 255, 0.20);
  padding: 2rem;
  text-align: center;
}

.banner-placeholder.is-visible {
  display: flex;
}

.banner-placeholder__icon {
  font-size: 3rem;
  line-height: 1;
}

.banner-placeholder__text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.04em;
}

/* Left panel live badge */
.left-panel-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.80);
  text-transform: uppercase;
}

.badge-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--clr-success);
  box-shadow: 0 0 8px var(--clr-success);
  flex-shrink: 0;
}

.badge-label {
  white-space: nowrap;
}

/* ─────────────────────────────────────────────
   7. RIGHT PANEL — WELCOME HEADLINE
   (Nomor 2: Putih solid 100%, tanpa gradient teks)
───────────────────────────────────────────── */
.welcome-headline {
  font-size: clamp(1.5rem, 2.5vw, 2.625rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.40);
  transition: opacity var(--transition-base);
  word-break: break-word;
  max-width: 100%;
}

/* ─────────────────────────────────────────────
   8. ATTENDEE GLASS CARD
───────────────────────────────────────────── */
.attendee-card {
  width: 100%;
  padding: 2.25rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition:
    box-shadow var(--transition-slow),
    border-color var(--transition-slow);
}

/* ── Welcome badge pill ── */
.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 1rem 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: fit-content;
  box-shadow: none;
}

.badge-icon {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1;
}

.badge-text {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #ffffff;
  text-transform: uppercase;
}

/* ── Attendee name section ── */
.attendee-name-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.attendee-name-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.attendee-name {
  font-size: clamp(1.875rem, 3.5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: #ffffff;
  word-break: break-word;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  transition: opacity 200ms ease;
}

/* ── Registered session ── */
.session-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  transition: background var(--transition-base);
}

.session-icon {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.80);
  margin-top: 2px;
}

.attendee-session {
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.90);
  line-height: 1.45;
  word-break: break-word;
  transition: opacity 200ms ease;
}

/* ── Metadata two-column grid ── */
.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.meta-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.72);
  text-transform: uppercase;
  white-space: nowrap;
}

.meta-icon {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.80);
}

/* Arrival time (Nomor 4: Putih solid, bukan cyan) */
.meta-value--time {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.375rem);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
  transition: opacity 200ms ease;
}

/* Unique code (Nomor 3: Putih solid, hilangkan background ungu, border, & shadow) */
.meta-value--code {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 1.6vw, 1.25rem);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;           /* Must NEVER wrap — PRD §10.4 */
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  transition: opacity 200ms ease;
}

/* ─────────────────────────────────────────────
   9. RIGHT PANEL — FOOTER
   (Nomor 5: Putih sekitar 80%)
───────────────────────────────────────────── */
.right-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-tagline {
  font-size: clamp(0.8rem, 1vw, 1rem);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.80);
  letter-spacing: 0.05em;
  transition: opacity var(--transition-base);
}

/* Connection status indicator */
.status-indicator {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.status-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: background-color var(--transition-base), box-shadow var(--transition-base);
}

.status-dot--ok {
  background: var(--clr-success);
  box-shadow: 0 0 8px var(--clr-success);
}

.status-dot--warn {
  background: var(--clr-warn);
  box-shadow: 0 0 8px var(--clr-warn);
}

.status-dot--error {
  background: var(--clr-error);
  box-shadow: 0 0 8px var(--clr-error);
  animation: dotPulse 1.5s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* ─────────────────────────────────────────────
   10. TEXT TRANSITION (micro-animation for DOM updates)
───────────────────────────────────────────── */
.text-updating {
  opacity: 0;
  transition: opacity 200ms ease;
}

/* ─────────────────────────────────────────────
   11. PULSE ANIMATION (live dot)
───────────────────────────────────────────── */
.pulse-dot {
  animation: pulseRing 2s ease-in-out infinite;
}

@keyframes pulseRing {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.70); }
  50%  { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.00); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.00); }
}

/* ─────────────────────────────────────────────
   12. RESPONSIVE BREAKPOINTS
   (PRD §11 — Viewport Breakpoints & Adaptation Matrix)
───────────────────────────────────────────── */

/* ── ≥ 1920px : Large / 4K / Stage Projectors ── */
@media (min-width: 1920px) {
  .app-container {
    padding: 3.5rem 4rem 3rem;
    gap: 4rem;
  }
  .welcome-headline {
    font-size: 2.75rem;
  }
  .attendee-name {
    font-size: 3.5rem;
  }
  .banner-img {
    max-height: 82vh;
  }
}

/* ── 1024–1919px : Standard Desktop ── */
@media (min-width: 1024px) and (max-width: 1919px) {
  /* Default — handled by root variables */
}

/* ── 900–1023px : Tablets Landscape ── */
@media (min-width: 900px) and (max-width: 1023px) {
  .app-container {
    gap: 2rem;
    padding: 2rem;
  }
  .panel--left {
    flex: 0 0 42%;
    max-width: 42%;
  }
  .attendee-card {
    padding: 1.75rem 2rem;
  }
}

/* ── 600–899px : Tablets Portrait — Stack vertically ── */
@media (min-width: 600px) and (max-width: 899px) {
  body {
    overflow: auto;         /* Allow scroll in portrait tablet */
  }
  .app-container {
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
    padding: 1.5rem;
    min-height: 100dvh;
  }
  .panel--left {
    flex: none;
    max-width: 100%;
    width: 100%;
  }
  .banner-card {
    width: 100%;
    overflow: visible;
  }
  .banner-img {
    max-height: 45vh;
    object-fit: contain;
  }
  .panel--right {
    width: 100%;
  }
  .welcome-headline {
    font-size: 1.6rem;
  }
  .attendee-name {
    font-size: 2rem;
  }
}

/* ── < 600px : Mobile Phones (e.g. 375x667) ── */
@media (max-width: 599px) {
  body {
    overflow: auto;
  }
  .app-container {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    padding: 1rem;
    min-height: 100dvh;
  }
  .panel--left {
    flex: none;
    max-width: 100%;
    width: 100%;
    height: auto;
  }
  .banner-card {
    width: 100%;
    height: auto;
    overflow: visible;
  }
  .banner-img {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
  }
  .panel--right {
    width: 100%;
  }
  .welcome-headline {
    font-size: clamp(1.125rem, 5vw, 1.5rem);
  }
  .attendee-name {
    font-size: clamp(1.5rem, 7vw, 2rem);
  }
  .attendee-card {
    padding: 1.25rem 1.25rem;
    gap: 1.1rem;
  }
  .meta-grid {
    grid-template-columns: 1fr;  /* Stack if needed */
  }
  .meta-value--code {
    white-space: nowrap;          /* Still no wrap even on mobile */
    font-size: 0.95rem;
  }
}

/* ── < 380px : Very small phones — stack metadata ── */
@media (max-width: 379px) {
  .meta-grid {
    grid-template-columns: 1fr;
  }
}
