@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
  /* Core Brand Colors */
  --primary-color: #0a1628;
  --primary-light: #152540;
  --accent-color: #1565C0;
  --accent-light: #1976D2;
  --cyan-color: #00B4D8;
  --cyan-dark: #0096B7;

  /* Neutrals */
  --secondary-color: #f3f4f6;
  --text-dark: #1f2937;
  --text-mid: #374151;
  --text-light: #6b7280;
  --text-muted: #9ca3af;
  --white: #ffffff;
  --border-color: #e5e7eb;

  /* Role Colors */
  --role-attendee: #1565C0;
  --role-vip: #B8860B;
  --role-speaker: #8B1A1A;
  --role-chairperson: #6B21A8;
  --role-clt: #065F46;
  --role-organizer: #1E293B;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.92);
  --glass-bg-dark: rgba(10, 22, 40, 0.85);
  --glass-border: rgba(255, 255, 255, 0.25);
  --glass-border-dark: rgba(255, 255, 255, 0.1);

  /* Shadows */
  --shadow-xs: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 10px 30px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.06);
  --shadow-xl: 0 30px 70px rgba(0,0,0,0.18), 0 12px 24px rgba(0,0,0,0.08);

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Outfit', sans-serif;
  background-color: #f0f4f8;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(21,101,192,0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(0,180,216,0.03) 0%, transparent 50%),
    radial-gradient(#e2e8f0 1px, transparent 1px);
  background-size: auto, auto, 22px 22px;
  color: var(--text-dark);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .fw-bold { font-family: 'Montserrat', sans-serif; }

/* ============================================
   GLASSMORPHISM CARDS
   ============================================ */
.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-glass:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-flat {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.text-primary-custom { color: var(--primary-color) !important; }
.text-accent { color: var(--accent-color) !important; }
.text-cyan { color: var(--cyan-color) !important; }
.bg-primary-custom { background-color: var(--primary-color) !important; }

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary-custom {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--white);
  font-weight: 600;
  padding: 11px 26px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(21, 101, 192, 0.3);
  letter-spacing: 0.3px;
}
.btn-primary-custom:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(21, 101, 192, 0.4);
  color: var(--white);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-light) 100%);
}
.btn-primary-custom:active { transform: translateY(0); }

.btn-cyan {
  background: linear-gradient(135deg, var(--cyan-color), var(--accent-color));
  border: none;
  border-radius: var(--radius-sm);
  color: var(--white);
  font-weight: 600;
  padding: 11px 26px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(0, 180, 216, 0.3);
}
.btn-cyan:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0, 180, 216, 0.4);
  color: var(--white);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  padding: 11px 16px;
  font-size: 0.93rem;
  transition: all 0.25s ease;
  background: var(--white);
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1);
  outline: none;
}
.form-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 6px;
}
.input-group-text {
  border: 1.5px solid var(--border-color);
  background: #f8fafc;
}

/* ============================================
   NAVBAR — DESKTOP
   ============================================ */
.navbar-custom {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--border-color), var(--shadow-xs);
  padding: 0.7rem 0;
}
.navbar-brand img { height: 38px; margin-right: 10px; }
.navbar-brand span {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: var(--primary-color);
  font-size: 1.05rem;
}
.nav-link {
  color: var(--text-light) !important;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 14px !important;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.nav-link:hover { color: var(--primary-color) !important; background: rgba(21,101,192,0.06); }
.nav-link.active { color: var(--primary-color) !important; background: rgba(21,101,192,0.08); }

/* ============================================
   BOTTOM NAV — MOBILE
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0;
  width: 100%;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 -1px 0 var(--border-color), 0 -4px 20px rgba(0,0,0,0.06);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 12px 0;
  z-index: 1000;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.25s;
  padding: 4px 16px;
  border-radius: var(--radius-pill);
}
.bottom-nav-item i {
  font-size: 1.3rem;
  margin-bottom: 3px;
  transition: transform 0.25s;
}
.bottom-nav-item.active { color: var(--accent-color); }
.bottom-nav-item.active i { transform: translateY(-2px); }

/* ============================================
   STATS CARDS
   ============================================ */
.stat-card {
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.stat-card::after {
  content: '';
  position: absolute;
  bottom: -20px; right: 20px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.stat-card h3 { font-size: 2.2rem; margin: 0; font-weight: 800; line-height: 1; }
.stat-card p { margin: 4px 0 0 0; opacity: 0.85; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.3px; }
.stat-card .stat-icon { font-size: 2.5rem; opacity: 0.3; z-index: 1; }
.stat-bg-blue   { background: linear-gradient(135deg, #0d47a1, #1976D2); box-shadow: 0 8px 24px rgba(21,101,192,0.3); }
.stat-bg-green  { background: linear-gradient(135deg, #065F46, #10b981); box-shadow: 0 8px 24px rgba(16,185,129,0.3); }
.stat-bg-purple { background: linear-gradient(135deg, #4c1d95, #8b5cf6); box-shadow: 0 8px 24px rgba(139,92,246,0.3); }

/* ============================================
   ROLE BADGES
   ============================================ */
.role-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.role-attendee    { background: rgba(21,101,192,0.1);  color: #1565C0; border: 1px solid rgba(21,101,192,0.2); }
.role-vip         { background: rgba(184,134,11,0.12); color: #92660a; border: 1px solid rgba(184,134,11,0.3); }
.role-speaker     { background: rgba(139,26,26,0.1);   color: #8B1A1A; border: 1px solid rgba(139,26,26,0.2); }
.role-organizer   { background: rgba(30,41,59,0.08);   color: #1E293B; border: 1px solid rgba(30,41,59,0.2); }
.role-chairperson { background: rgba(107,33,168,0.1);  color: #6B21A8; border: 1px solid rgba(107,33,168,0.2); }
.role-clt         { background: rgba(6,95,70,0.1);     color: #065F46; border: 1px solid rgba(6,95,70,0.2); }

/* ============================================
   TABLE ENHANCEMENTS
   ============================================ */
.table { font-size: 0.87rem; }
.table th {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 10px 16px;
  border-bottom: 2px solid var(--border-color);
  background: #f8fafc;
}
.table td { padding: 13px 16px; vertical-align: middle; border-color: var(--border-color); }
.table-hover tbody tr:hover { background-color: rgba(21,101,192,0.025); }
.table-hover tbody tr { transition: background 0.15s; }

/* Search box */
.search-box { position: relative; }
.search-box .search-icon {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}
.search-box input { padding-left: 38px; }

/* ============================================
   ANIMATIONS
   ============================================ */
.animate-fade-in { animation: fadeInUp 0.5s ease-out both; }
.animate-fade-in-delay { animation: fadeInUp 0.5s ease-out 0.15s both; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(21,101,192,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(21,101,192,0); }
}
.pulse { animation: pulse-glow 2s infinite; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 6px;
  display: block;
}
@keyframes skeleton-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ============================================
   TIMELINE
   ============================================ */
.timeline {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 0;
}
.timeline::after {
  content: '';
  position: absolute;
  width: 3px;
  background: linear-gradient(to bottom, var(--accent-color), var(--cyan-color));
  top: 0; bottom: 0; left: 50%;
  margin-left: -1.5px;
  border-radius: 4px;
}
.timeline-item {
  padding: 10px 44px;
  position: relative;
  background: inherit;
  width: 50%;
}
.timeline-item::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  right: -8px;
  background: var(--white);
  border: 3px solid var(--accent-color);
  top: 18px;
  border-radius: 50%;
  z-index: 1;
  box-shadow: 0 0 0 4px rgba(21,101,192,0.12);
}
.left  { left: 0; }
.right { left: 50%; }
.right::after { left: -8px; }
.timeline-content {
  padding: 18px 22px;
  background: var(--white);
  position: relative;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s;
}
.timeline-content:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.timeline-content h5 { font-size: 0.95rem; }

@media screen and (max-width: 768px) {
  .timeline::after { left: 24px; }
  .timeline-item { width: 100%; padding-left: 62px; padding-right: 16px; }
  .timeline-item::after { left: 16px; }
  .right { left: 0%; }
}

/* ============================================
   INFO CARDS (Homepage)
   ============================================ */
.info-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s;
}
.info-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.info-card .info-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 12px;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
  background: linear-gradient(145deg, var(--primary-color) 0%, #0f2547 50%, #0d47a1 100%);
  color: var(--white);
  padding: 90px 0 130px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom-left-radius: 50% 8%;
  border-bottom-right-radius: 50% 8%;
  margin-bottom: -70px;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -50%; left: -20%;
  width: 60%; height: 200%;
  background: radial-gradient(ellipse, rgba(0,180,216,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.hero-section::after {
  content: '';
  position: absolute;
  bottom: -10%; right: -10%;
  width: 50%; height: 80%;
  background: radial-gradient(ellipse, rgba(21,101,192,0.2) 0%, transparent 70%);
  pointer-events: none;
}
.hero-logo {
  height: 80px;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3)) brightness(1.05);
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================
   ACTION BUTTONS
   ============================================ */
.btn-icon {
  width: 34px; height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--white);
  color: var(--text-light);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  vertical-align: middle;
}
.btn-icon:hover { background: var(--secondary-color); color: var(--text-dark); border-color: #d1d5db; }
.btn-icon.danger:hover { background: #fef2f2; color: #dc2626; border-color: #fca5a5; }
.btn-icon.success:hover { background: #f0fdf4; color: #16a34a; border-color: #86efac; }
.btn-icon.primary:hover { background: rgba(21,101,192,0.08); color: var(--accent-color); border-color: rgba(21,101,192,0.3); }

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-header h5 {
  margin: 0;
  font-size: 0.93rem;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Empty state */
.empty-state { padding: 60px 20px; text-align: center; color: var(--text-muted); }
.empty-state i { font-size: 3rem; opacity: 0.2; margin-bottom: 14px; display: block; }
.empty-state p { font-size: 0.9rem; }

/* ============================================
   IPHONE / IOS SAFE AREA
   ============================================ */
@supports (padding: env(safe-area-inset-bottom)) {
  .bottom-nav {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
  /* scanner page uses padding-bottom:90px — extend it */
  body.scanner-page { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
}

/* ============================================
   TOUCH TARGETS — MINIMUM 44px (Apple HIG)
   ============================================ */
.btn-icon {
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
}
/* Revert to design size on desktop */
@media (min-width: 768px) {
  .btn-icon { width: 34px; height: 34px; min-width: 34px; min-height: 34px; }
}

/* Prevent accidental text-selection on tap */
.action-btn, .btn-icon, .bottom-nav-item, .nav-link {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Momentum scrolling on iOS */
.table-responsive, .tab-content, body {
  -webkit-overflow-scrolling: touch;
}

/* ============================================
   MOBILE — phones < 576 px
   ============================================ */
@media (max-width: 575.98px) {

  /* --- Stats cards --- */
  .stat-card { padding: 14px 16px; }
  .stat-card h3 { font-size: 1.6rem; }
  .stat-card p  { font-size: 0.72rem; }
  .stat-card .stat-icon { font-size: 1.8rem; }

  /* --- Admin tabs: horizontal scroll instead of wrapping --- */
  #adminTabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
    gap: 6px !important;
  }
  #adminTabs::-webkit-scrollbar { display: none; }
  #adminTabs .nav-link {
    white-space: nowrap;
    padding: 8px 14px !important;
    font-size: 0.8rem;
  }

  /* --- Section header: buttons wrap below title --- */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .section-header > div { width: 100%; }

  /* --- Participants table: hide Specialty column --- */
  .table-participants td:nth-child(3),
  .table-participants th:nth-child(3) { display: none; }

  /* --- Cards padding --- */
  .card-glass { padding: 16px !important; }
  .card-flat  { padding: 14px !important; }

  /* --- Reduce hero padding --- */
  .hero-section { padding: 60px 0 100px 0; }
  .hero-logo { height: 60px; }

  /* --- Pill buttons bar wrapping gap --- */
  .d-flex.gap-2.flex-wrap { gap: 6px !important; }

  /* --- Admin bottom padding so content clears bottom-nav --- */
  .container-fluid.pb-5 { padding-bottom: 100px !important; }
}

/* ============================================
   TABLET — 576px to 991px (iPad, iPad Mini)
   ============================================ */
@media (min-width: 576px) and (max-width: 991.98px) {

  .stat-card h3 { font-size: 1.85rem; }

  /* Two-column tabs on tablet */
  #adminTabs { gap: 8px !important; }
  #adminTabs .nav-link { padding: 9px 20px !important; }

  /* Form and table side by side starting at md */
  .col-lg-4, .col-lg-8 { width: 100%; }
}

/* ============================================
   LARGE SCREENS — iPads landscape / laptops
   ============================================ */
@media (min-width: 992px) {
  .stat-card h3 { font-size: 2.2rem; }
}

/* ============================================
   FOCUS ACCESSIBILITY
   ============================================ */
.btn-primary-custom:focus-visible,
.btn-icon:focus-visible,
.btn-login:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}
