/* ============================================================
   REVIVE 2026 — CME Certificate Portal
   Color palette derived from brochure:
     Deep Purple (#3a1259), Plum (#7b3f9e), Mauve (#9b5ba5),
     Dark Navy (#1e0e33), White, Warm Gray
   ============================================================ */

/* ---------- Google Font ---------- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@700;800;900&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Brochure primary palette */
  --purple-deep: #1e0e33;
  --purple-900: #2a1245;
  --purple-800: #3a1259;
  --purple-700: #4e1d73;
  --purple-600: #6b2d94;
  --purple-500: #7b3f9e;
  --purple-400: #9b5ba5;
  --purple-300: #b87fc2;
  --purple-200: #d4a8db;
  --purple-100: #f0e0f5;
  --purple-50: #f9f2fb;

  /* Warm accents from brochure */
  --plum: #8b4b8e;
  --mauve: #c084c4;
  --rose: #d4729a;
  --warm-white: #faf7fc;

  /* Neutral */
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-800: #262626;
  --gray-900: #171717;

  /* Functional */
  --gold: #d4a24c;
  --success: #10b981;
  --white: #ffffff;
  --white-06: rgba(255, 255, 255, 0.06);
  --white-10: rgba(255, 255, 255, 0.10);
  --white-12: rgba(255, 255, 255, 0.12);
  --white-15: rgba(255, 255, 255, 0.15);
  --white-20: rgba(255, 255, 255, 0.20);
  --white-30: rgba(255, 255, 255, 0.30);
  --white-50: rgba(255, 255, 255, 0.50);
  --white-60: rgba(255, 255, 255, 0.60);
  --white-70: rgba(255, 255, 255, 0.70);
  --white-80: rgba(255, 255, 255, 0.80);
  --white-90: rgba(255, 255, 255, 0.90);

  /* Gradients (brochure-inspired) */
  --gradient-hero: linear-gradient(
    160deg,
    #1a0b2e 0%,
    #2a1245 20%,
    #3a1259 40%,
    #4e1d73 60%,
    #3a1259 80%,
    #1a0b2e 100%
  );
  --gradient-card: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.10) 0%,
    rgba(255, 255, 255, 0.04) 100%
  );
  --gradient-btn: linear-gradient(135deg, #7b3f9e 0%, #9b5ba5 100%);
  --gradient-btn-hover: linear-gradient(135deg, #8b4bae 0%, #ab6bb5 100%);
  --gradient-title: linear-gradient(135deg, #ffffff 0%, #d4a8db 40%, #b87fc2 70%, #ffffff 100%);
  --gradient-revive: linear-gradient(180deg, #c084c4 0%, #9b5ba5 30%, #7b3f9e 60%, #6b2d94 100%);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.20);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.30);
  --shadow-glow: 0 0 50px rgba(123, 63, 158, 0.25);
  --shadow-card-hover: 0 8px 32px rgba(123, 63, 158, 0.20);

  /* Radius */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 100px;

  /* Transition */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration: 250ms;
  --duration-slow: 400ms;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--white-90);
  background: var(--purple-deep);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 32px 16px 60px;
  background: var(--gradient-hero);
  overflow: hidden;
}

/* Brochure-style ambient blobs */
.hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(155, 91, 165, 0.25) 0%, transparent 70%);
  top: -200px;
  right: -150px;
  filter: blur(80px);
  animation: drift 16s ease-in-out infinite alternate;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(123, 63, 158, 0.2) 0%, transparent 70%);
  bottom: -150px;
  left: -120px;
  filter: blur(80px);
  animation: drift 16s ease-in-out 8s infinite alternate-reverse;
  pointer-events: none;
}

@keyframes drift {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(20px, -25px) scale(1.08);
  }
}

/* Subtle texture overlay */
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(155, 91, 165, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(123, 63, 158, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Header / Branding ---------- */
.header {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-bottom: 28px;
  animation: fadeInDown 0.7s var(--ease) both;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Top logos area — mimics brochure header */
.logo-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white-10);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--white-12);
  border-radius: var(--radius-pill);
  padding: 6px 16px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--white-70);
  text-transform: uppercase;
}

.logo-badge .icon {
  font-size: 0.9rem;
}

.logo-divider {
  width: 1px;
  height: 24px;
  background: var(--white-20);
}

/* Institution badge — mimics the rounded purple box on brochure */
.institution-badge {
  display: inline-block;
  background: var(--purple-800);
  border: 1px solid var(--white-12);
  border-radius: var(--radius-md);
  padding: 10px 28px;
  margin-bottom: 24px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--white-80);
  letter-spacing: 0.02em;
  line-height: 1.5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.institution-badge strong {
  display: block;
  font-weight: 700;
  color: var(--white);
  font-size: 0.88rem;
}

/* "presents" text */
.presents-text {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-style: italic;
  color: var(--white-50);
  margin-bottom: 4px;
  letter-spacing: 0.03em;
}

/* REVIVE 2026 — bold title like the brochure */
.event-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.5rem, 8vw, 4.2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  background: var(--gradient-revive);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
  filter: drop-shadow(0 2px 8px rgba(155, 91, 165, 0.3));
}

.event-year {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  background: var(--gradient-revive);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: -8px;
  margin-bottom: 14px;
  filter: drop-shadow(0 2px 8px rgba(155, 91, 165, 0.3));
}

/* Subtitle — matches brochure's CME description */
.event-subtitle {
  font-size: clamp(0.88rem, 2.5vw, 1.05rem);
  font-weight: 400;
  color: var(--white-60);
  letter-spacing: 0.01em;
  max-width: 480px;
  margin: 0 auto 4px;
}

.event-tagline {
  font-family: 'Playfair Display', serif;
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-style: italic;
  color: var(--mauve);
  margin-bottom: 16px;
}

/* Event meta — date & location like the brochure footer */
.event-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white-06);
  border: 1px solid var(--white-10);
  border-radius: var(--radius-pill);
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--white-60);
}

.meta-pill .icon {
  font-size: 0.85rem;
}

/* ---------- Search Card (Glassmorphism) ---------- */
.search-card {
  position: relative;
  z-index: 2;
  width: 92%;
  max-width: 700px;
  background: var(--gradient-card);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--white-12);
  border-radius: var(--radius-lg);
  padding: 28px 22px 24px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: fadeInUp 0.7s var(--ease) 0.25s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Card header */
.card-header {
  text-align: center;
  margin-bottom: 20px;
}

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white-90);
  margin-bottom: 2px;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--white-50);
}

/* ---------- Search Input ---------- */
.search-wrapper {
  position: relative;
  margin-bottom: 14px;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--white-30);
  pointer-events: none;
  transition: color var(--duration) var(--ease);
}

.search-input {
  width: 100%;
  padding: 15px 48px 15px 50px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--white);
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--white-12);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    background var(--duration) var(--ease);
}

.search-input::placeholder {
  color: var(--white-30);
  font-weight: 400;
}

.search-input:focus {
  border-color: var(--purple-400);
  box-shadow: 0 0 0 4px rgba(123, 63, 158, 0.2);
  background: rgba(0, 0, 0, 0.4);
}

.search-input:focus~.search-icon {
  color: var(--purple-300);
}

/* Clear button */
.clear-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  background: var(--white-12);
  color: var(--white-50);
  border-radius: 50%;
  font-size: 0.85rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background var(--duration) var(--ease),
    color var(--duration) var(--ease);
}

.clear-btn:hover {
  background: var(--white-20);
  color: var(--white);
}

.clear-btn.visible {
  display: flex;
}

/* ---------- Count Badge ---------- */
.count-badge {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--white-30);
  letter-spacing: 0.02em;
}

.count-badge span {
  color: var(--purple-300);
  font-weight: 700;
}

/* ---------- Results Container ---------- */
.results-container {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- Delegate Card ---------- */
.delegate-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--white-10);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: background var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    transform var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
  animation: cardSlideIn var(--duration) var(--ease) both;
}

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.delegate-card:hover {
  background: rgba(123, 63, 158, 0.12);
  border-color: var(--white-15);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.delegate-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.delegate-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(123, 63, 158, 0.35);
  font-family: 'Outfit', sans-serif;
}

.delegate-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.delegate-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--white-90);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.delegate-name .highlight {
  color: var(--gold);
  background: rgba(212, 162, 76, 0.15);
  border-radius: 3px;
  padding: 0 2px;
}

.delegate-label {
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--white-30);
  letter-spacing: 0.02em;
}

/* ---------- Action Buttons ---------- */
.delegate-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    background var(--duration) var(--ease);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.95);
}

.btn-view {
  background: var(--white-10);
  color: var(--white-70);
  border: 1px solid var(--white-12);
}

.btn-view:hover {
  background: var(--white-15);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn-download {
  background: var(--gradient-btn);
  color: var(--white);
}

.btn-download:hover {
  background: var(--gradient-btn-hover);
  box-shadow: 0 4px 16px rgba(123, 63, 158, 0.4);
  transform: translateY(-1px);
}

/* ---------- Empty State ---------- */
.empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 20px;
  text-align: center;
  animation: fadeInUp 0.4s var(--ease) both;
}

.empty-state.visible {
  display: flex;
}

.empty-icon {
  width: 72px;
  height: 72px;
  margin-bottom: 16px;
  opacity: 0.4;
  color: var(--purple-300);
}

.empty-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white-70);
  margin-bottom: 4px;
}

.empty-subtitle {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--white-30);
  max-width: 300px;
}

/* ---------- Initial State ---------- */
.initial-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  text-align: center;
  animation: fadeInUp 0.5s var(--ease) 0.4s both;
}

.initial-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
  opacity: 0.6;
}

.initial-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white-50);
  margin-bottom: 2px;
}

.initial-subtitle {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--white-30);
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 16px 16px;
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--white-30);
  border-top: 1px solid var(--white-06);
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.footer strong {
  color: var(--purple-300);
  font-weight: 600;
}

/* ---------- Scrollbar ---------- */
.results-container::-webkit-scrollbar {
  width: 5px;
}

.results-container::-webkit-scrollbar-track {
  background: transparent;
}

.results-container::-webkit-scrollbar-thumb {
  background: var(--white-12);
  border-radius: 3px;
}

/* ---------- Responsive ---------- */

/* Small phones */
@media (max-width: 480px) {
  .hero {
    padding: 24px 12px 36px;
  }

  .search-card {
    width: 96%;
    padding: 22px 14px 20px;
    border-radius: var(--radius-md);
  }

  .delegate-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
  }

  .delegate-actions {
    width: 100%;
  }

  .delegate-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .event-title {
    font-size: 2.2rem;
  }

  .event-year {
    font-size: 1.6rem;
  }

  .logo-bar {
    gap: 8px;
  }

  .logo-badge {
    font-size: 0.65rem;
    padding: 5px 12px;
  }

  .institution-badge {
    padding: 8px 20px;
    font-size: 0.75rem;
  }

  .meta-pill {
    font-size: 0.7rem;
    padding: 5px 12px;
  }
}

/* Tablets */
@media (min-width: 481px) and (max-width: 768px) {
  .search-card {
    width: 94%;
    padding: 26px 20px 22px;
  }
}

/* Desktop */
@media (min-width: 769px) {
  .hero {
    padding: 50px 24px 70px;
    justify-content: center;
  }

  .search-card {
    padding: 32px 28px 28px;
  }

  .results-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
  }
}

/* ---------- Stagger animation delays ---------- */
.delegate-card:nth-child(1) {
  animation-delay: 0ms;
}

.delegate-card:nth-child(2) {
  animation-delay: 40ms;
}

.delegate-card:nth-child(3) {
  animation-delay: 80ms;
}

.delegate-card:nth-child(4) {
  animation-delay: 120ms;
}

.delegate-card:nth-child(5) {
  animation-delay: 160ms;
}

.delegate-card:nth-child(6) {
  animation-delay: 200ms;
}

.delegate-card:nth-child(7) {
  animation-delay: 240ms;
}

.delegate-card:nth-child(8) {
  animation-delay: 280ms;
}

.delegate-card:nth-child(9) {
  animation-delay: 320ms;
}

.delegate-card:nth-child(10) {
  animation-delay: 360ms;
}