/* ==========================================================================
   Spac2 Event — Minimalist White Portal Stylesheet
   Path: /event/css/event.css
   ========================================================================== */

:root {
  /* Canvas & Surfaces */
  --bg-root: #ffffff;
  --bg-surface: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.84);
  --bg-subtle: #f8fafc;
  --bg-pill: #f1f5f9;

  /* Borders */
  --border-glass: rgba(15, 23, 42, 0.08);
  --border-card: rgba(15, 23, 42, 0.07);
  --border-hover: rgba(15, 23, 42, 0.18);

  /* Typography */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;

  /* Accents (Neutral Monochrome / Slate Gray) */
  --accent: #0f172a;
  --accent-muted: #475569;
  --accent-soft: #64748b;
  --accent-gradient: linear-gradient(135deg, #0f172a 0%, #475569 55%, #64748b 100%);

  /* Radii */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.03);
  --shadow-header: 0 12px 36px -8px rgba(15, 23, 42, 0.09), 0 2px 8px -2px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 6px 24px -6px rgba(15, 23, 42, 0.06), 0 1px 4px rgba(15, 23, 42, 0.03);
  --shadow-card-hover: 0 20px 44px -12px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(15, 23, 42, 0.04);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: all 0.28s var(--ease-out);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background-color: var(--bg-root);
}

html,
body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

body {
  background-color: var(--bg-root);
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  border: none;
  outline: none;
  background: none;
  cursor: pointer;
}

img {
  -webkit-user-drag: none;
  user-select: none;
}

/* ==========================================================================
   Subtle Ambient White-Canvas Glow
   ========================================================================== */
.bg-ambient-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-ambient-layer::before {
  content: '';
  position: absolute;
  top: -12%;
  left: 14%;
  width: min(540px, 85vw);
  height: min(540px, 85vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(100, 116, 139, 0.06) 0%, transparent 70%);
  filter: blur(70px);
}

.bg-ambient-layer::after {
  content: '';
  position: absolute;
  top: 36%;
  right: 10%;
  width: min(460px, 75vw);
  height: min(460px, 75vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(148, 163, 184, 0.06) 0%, transparent 70%);
  filter: blur(70px);
}

/* ==========================================================================
   Big Rounded Fixed Floating Header
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 0;
  pointer-events: none;
}

@media (min-width: 640px) {
  .site-header {
    padding: calc(18px + env(safe-area-inset-top, 0px)) 24px 0;
  }
}

.header-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1120px;
  height: 64px;
  margin: 0 auto;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-header);
  transition: var(--transition);
}

@media (min-width: 640px) {
  .header-inner {
    height: 70px;
    padding: 10px 18px;
  }
}

.header-inner.is-scrolled {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.04);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-back {
  width: 42px;
  height: 42px;
  min-width: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--text-primary);
  font-size: 18px;
  transition: var(--transition);
}

.btn-back:hover {
  background: rgba(15, 23, 42, 0.08);
  transform: translateX(-2px);
}

.btn-back:active {
  transform: scale(0.94);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-right: 6px;
}

.brand-logo-card {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.06);
  padding: 4px;
  transition: var(--transition);
}

.brand-link:hover .brand-logo-card {
  transform: scale(1.04);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.brand-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 19px;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

.brand-divider {
  font-size: 15px;
  font-weight: 300;
  color: var(--text-tertiary);
}

.brand-app {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-muted);
  letter-spacing: -0.01em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-count-pill {
  display: none;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-pill);
  border: 1px solid rgba(15, 23, 42, 0.05);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

@media (min-width: 540px) {
  .header-count-pill {
    display: inline-flex;
  }
}

.header-count-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.btn-header-ctrl {
  width: 42px;
  height: 42px;
  min-width: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--text-primary);
  font-size: 18px;
  transition: var(--transition);
}

.btn-header-ctrl:hover {
  background: rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.btn-header-ctrl:active {
  transform: scale(0.94);
}

/* ==========================================================================
   Main Viewport & Hero
   ========================================================================== */
.event-viewport {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 112px 16px 48px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  .event-viewport {
    padding: 128px 24px 64px;
  }
}

.hero-section {
  text-align: center;
  max-width: 680px;
  margin: 56px auto 0;
  animation: fadeUp 0.6s var(--ease-out) both;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-pill);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 18px;
}

.hero-title {
  font-family: 'Outfit', 'Be Vietnam Pro', sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.35rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.hero-title .gradient-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  line-height: 1.65;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ==========================================================================
   Events Grid & Cards
   ========================================================================== */
.events-section {
  width: 100%;
  flex: 1;
}

.events-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

@media (min-width: 680px) {
  .events-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }
}

@media (min-width: 1024px) {
  .events-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
  }
}

.event-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp 0.55s var(--ease-out) forwards;
}

.event-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card-hover);
}

.event-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.event-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s var(--ease-out);
}

.event-card:hover .event-cover-img {
  transform: scale(1.04);
}

.event-cover-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 55%, #e2e8f0 100%);
  color: var(--text-secondary);
}

.event-cover-fallback-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--accent-muted);
}

.event-cover-fallback-label {
  font-family: 'Outfit', 'Be Vietnam Pro', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.event-cover-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.event-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.event-badge-date {
  color: var(--text-secondary);
  font-weight: 600;
}

.event-card-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.event-card-title {
  font-family: 'Outfit', 'Be Vietnam Pro', sans-serif;
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 8px;
  transition: color 0.2s ease;
}

.event-card:hover .event-card-title {
  color: var(--accent-muted);
}

.event-card-desc {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.event-card-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.event-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-pill);
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--text-primary);
  transition: var(--transition);
}

.event-card:hover .event-card-cta {
  background: var(--text-primary);
  color: #ffffff;
  border-color: var(--text-primary);
  gap: 9px;
}

/* Skeleton Loader */
.card-skeleton {
  height: 310px;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, #f8fafc 25%, #f1f5f9 50%, #f8fafc 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border: 1px solid var(--border-card);
}

/* Empty State */
.events-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  border: 1px dashed rgba(15, 23, 42, 0.12);
  color: var(--text-secondary);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.event-footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  text-align: center;
  font-size: 13.5px;
  color: var(--text-tertiary);
}

.event-footer a {
  color: var(--text-secondary);
  font-weight: 600;
  transition: color 0.2s ease;
}

.event-footer a:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   Modals (Event Quick View & Ecosystem)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.2);
  padding: 24px;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.26s var(--ease-out);
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-primary);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: rgba(15, 23, 42, 0.12);
}

.modal-event-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 18px;
  background: var(--bg-subtle);
}

.modal-event-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.modal-event-title {
  font-family: 'Outfit', 'Be Vietnam Pro', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 10px;
}

.modal-event-desc {
  font-size: 0.96rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.modal-head-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.modal-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-subheading {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.ecosystem-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.ecosystem-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid rgba(15, 23, 42, 0.05);
  text-align: center;
  transition: var(--transition);
}

.ecosystem-item:hover {
  background: #ffffff;
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.ecosystem-item img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
}

.ecosystem-item span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
