:root {
  --cf-primary: #2563eb;
  --cf-primary-dark: #1d4ed8;
  --cf-secondary: #f59e0b;
  --cf-success: #10b981;
  --cf-warning: #f59e0b;
  --cf-danger: #ef4444;
  --cf-light: #f8fafc;
  --cf-dark: #0f172a;
  --cf-gray-50: #f9fafb;
  --cf-gray-100: #f3f4f6;
  --cf-gray-200: #e5e7eb;
  --cf-gray-300: #d1d5db;
  --cf-gray-400: #9ca3af;
  --cf-gray-500: #6b7280;
  --cf-gray-600: #4b5563;
  --cf-gray-700: #374151;
  --cf-gray-800: #1f2937;
  --cf-gray-900: #111827;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow:
    0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background: linear-gradient(
    135deg,
    var(--cf-gray-50) 0%,
    var(--cf-gray-100) 100%
  );
  color: var(--cf-gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── TOP NAV ── */
.top-nav {
  background: var(--cf-dark);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}

.top-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.top-nav-brand {
  color: white;
  font-weight: 700;
  font-size: 1rem;
  padding: 1rem 1.5rem 1rem 0;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  margin-right: 1rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.nav-tabs {
  display: flex;
  gap: 0;
}

.nav-tab {
  color: rgba(255, 255, 255, 0.65);
  padding: 1rem 1.5rem;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}

.nav-tab:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: white;
  border-bottom-color: var(--cf-primary);
}

/* ── CONTAINER ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ── TAB PANELS ── */
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* ── EXISTING HEADER (sessions) ── */
.header {
  background: linear-gradient(
    135deg,
    var(--cf-primary) 0%,
    var(--cf-primary-dark) 100%
  );
  color: white;
  padding: 2rem 0;
  margin-bottom: 2rem;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 100%;
  height: 200%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: rotate(15deg);
}

.header-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.header p {
  font-size: 1.125rem;
  opacity: 0.95;
  font-weight: 300;
}

/* ── SEARCH SECTION (sessions) ── */
.search-section {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--cf-gray-200);
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.form-group {
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--cf-gray-700);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group select,
.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--cf-gray-200);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  transition: all 0.2s ease;
  background: white;
}

.form-group select:focus,
.form-group input:focus {
  outline: none;
  border-color: var(--cf-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

.keyword-search {
  position: relative;
}

.keyword-search::before {
  content: "\f002";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cf-gray-400);
  pointer-events: none;
}

.keyword-search input {
  padding-left: 2.5rem;
}

.button-group {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  align-items: center;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--cf-primary) 0%,
    var(--cf-primary-dark) 100%
  );
  color: white;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: white;
  color: var(--cf-gray-600);
  border: 2px solid var(--cf-gray-200);
}

.btn-secondary:hover {
  background: var(--cf-gray-50);
  border-color: var(--cf-gray-300);
}

/* ── RESULTS SECTION (sessions) ── */
.results-section {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--cf-gray-200);
}

.results-header {
  background: var(--cf-gray-50);
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--cf-gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.results-title {
  font-weight: 600;
  color: var(--cf-gray-800);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.session-count {
  background: var(--cf-primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.results-container {
  max-height: 600px;
  overflow-y: auto;
  padding: 1rem;
}

/* ── SESSION CARDS ── */
.session-card {
  border: 1px solid var(--cf-gray-200);
  border-radius: 12px;
  margin-bottom: 1rem;
  padding: 1.5rem;
  transition: all 0.2s ease;
  background: white;
}

.session-card:hover {
  border-color: var(--cf-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.session-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.session-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--cf-gray-900);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.session-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--cf-gray-600);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.meta-item i {
  width: 16px;
  text-align: center;
}

.session-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-stage {
  background: var(--cf-primary);
  color: white;
}
.badge-format {
  background: var(--cf-secondary);
  color: white;
}
.badge-partner {
  background: var(--cf-success);
  color: white;
}

.session-content {
  margin-top: 1rem;
}
.session-abstract {
  color: var(--cf-gray-700);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.session-speakers {
  padding: 1rem;
  background: var(--cf-gray-50);
  border-radius: 8px;
  border-left: 4px solid var(--cf-primary);
}

.speakers-label {
  font-weight: 600;
  color: var(--cf-gray-800);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}
.speakers-list {
  color: var(--cf-gray-700);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
}

/* ── STATS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--cf-gray-200);
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: var(--cf-gray-50);
  border-radius: 8px;
}
.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cf-primary);
  display: block;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--cf-gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.export-btn {
  background: var(--cf-success);
  color: white;
}
.export-btn:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ── SPEAKER SECTION ── */
.speaker-controls {
  background: white;
  border-radius: 16px;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--cf-gray-200);
}

.speaker-search-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
  gap: 1rem;
  align-items: flex-end;
}

.speaker-count-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--cf-gray-200);
  font-size: 0.875rem;
  color: var(--cf-gray-600);
}

/* ── SPEAKER CARDS GRID ── */
.speaker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.speaker-card {
  background: white;
  border: 1px solid var(--cf-gray-200);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.speaker-card:hover {
  border-color: var(--cf-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.speaker-card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--cf-gray-100);
  display: block;
}

.speaker-card-image-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(
    135deg,
    var(--cf-gray-100),
    var(--cf-gray-200)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cf-gray-400);
  font-size: 2.5rem;
}

.speaker-card-body {
  padding: 0.75rem;
}

.speaker-card-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--cf-gray-900);
  line-height: 1.3;
  margin-bottom: 0.2rem;
}

.speaker-card-speaking-type {
  font-size: 0.7rem;
  color: white;
  background: var(--cf-primary);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  display: inline-block;
  margin-bottom: 0.3rem;
  font-weight: 500;
}

.speaker-card-title {
  font-size: 0.75rem;
  color: var(--cf-gray-600);
  line-height: 1.3;
  margin-bottom: 0.2rem;
  /* Clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.speaker-card-company {
  font-size: 0.75rem;
  color: var(--cf-gray-500);
  font-weight: 500;
}

/* ── SPEAKER MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: white;
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: fadeIn 0.2s ease;
}

.modal-header {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  border-bottom: 1px solid var(--cf-gray-200);
  align-items: flex-start;
}

.modal-image {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--cf-gray-100);
}

.modal-image-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    var(--cf-gray-100),
    var(--cf-gray-200)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cf-gray-400);
  font-size: 2rem;
  flex-shrink: 0;
}

.modal-header-info {
  flex: 1;
  min-width: 0;
}

.modal-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cf-gray-900);
  margin-bottom: 0.25rem;
}
.modal-speaking-type {
  font-size: 0.75rem;
  color: white;
  background: var(--cf-primary);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  display: inline-block;
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.modal-title {
  font-size: 0.9rem;
  color: var(--cf-gray-700);
  margin-bottom: 0.2rem;
}
.modal-company {
  font-size: 0.875rem;
  color: var(--cf-gray-500);
  font-weight: 500;
}

.modal-body {
  padding: 1.5rem;
}

.modal-section {
  margin-bottom: 1.25rem;
}
.modal-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cf-gray-400);
  margin-bottom: 0.4rem;
}

.modal-section-value {
  font-size: 0.875rem;
  color: var(--cf-gray-700);
  line-height: 1.6;
}

.modal-social-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.modal-social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid var(--cf-gray-200);
  color: var(--cf-gray-700);
}

.modal-social-link:hover {
  background: var(--cf-gray-50);
  border-color: var(--cf-gray-300);
}
.modal-social-link.twitter {
  color: #1da1f2;
  border-color: #1da1f2;
}
.modal-social-link.twitter:hover {
  background: #e8f5fe;
}
.modal-social-link.instagram {
  color: #e1306c;
  border-color: #e1306c;
}
.modal-social-link.instagram:hover {
  background: #fde8ef;
}
.modal-social-link.linkedin {
  color: #0a66c2;
  border-color: #0a66c2;
}
.modal-social-link.linkedin:hover {
  background: #e8f0fa;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--cf-gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.btn-download {
  background: var(--cf-success);
  color: white;
}
.btn-download:hover {
  background: #059669;
  transform: translateY(-1px);
}
.btn-download:disabled {
  background: var(--cf-gray-300);
  cursor: not-allowed;
  transform: none;
}

.btn-close {
  background: white;
  color: var(--cf-gray-600);
  border: 2px solid var(--cf-gray-200);
}
.btn-close:hover {
  background: var(--cf-gray-50);
}

/* ── LOADING / EMPTY STATES ── */
.loading {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--cf-gray-500);
}

.loading i {
  font-size: 2rem;
  margin-bottom: 1rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.no-results {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--cf-gray-500);
}
.no-results i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--cf-gray-300);
}

/* ── ANIMATIONS ── */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

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

.slide-in {
  animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  .header h1 {
    font-size: 2rem;
  }
  .search-grid {
    grid-template-columns: 1fr;
  }
  .button-group {
    flex-direction: column;
    align-items: stretch;
  }
  .session-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .session-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
  .speaker-search-row {
    grid-template-columns: 1fr;
  }
  .speaker-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .modal-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .modal-footer {
    flex-direction: column;
  }
}

/* ── SESSION SELECT / CHECKBOX ── */
.session-card {
  position: relative;
}
.session-checkbox-wrap {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
}
.session-checkbox-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--cf-primary);
}
.session-card.selected {
  border-color: var(--cf-primary);
  background: #eff6ff;
}
.select-all-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--cf-gray-600);
}
.select-all-bar input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--cf-primary);
  cursor: pointer;
}
.btn-export-selected {
  background: var(--cf-gray-100);
  color: var(--cf-gray-700);
  border: 2px solid var(--cf-gray-300);
}
.btn-export-selected:hover {
  background: var(--cf-gray-200);
}

/* ── LOADING + LOGIN OVERLAYS (Vercel version) ── */
.app-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}
.app-overlay[hidden] {
  display: none;
}
.login-overlay {
  background: linear-gradient(135deg, var(--cf-dark) 0%, var(--cf-gray-800) 100%);
  z-index: 2100;
}
.overlay-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  animation: fadeIn 0.2s ease;
}
.overlay-icon {
  font-size: 2rem;
  color: var(--cf-primary);
  margin-bottom: 0.75rem;
}
.overlay-icon .fa-spinner {
  animation: spin 1s linear infinite;
}
.overlay-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--cf-gray-900);
  margin-bottom: 0.25rem;
}
.overlay-text {
  font-size: 0.875rem;
  color: var(--cf-gray-600);
}
.login-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  margin: 1.25rem 0 0.5rem;
  border: 2px solid var(--cf-gray-200);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}
.login-form input:focus {
  outline: none;
  border-color: var(--cf-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.login-error {
  min-height: 1.25rem;
  font-size: 0.8rem;
  color: var(--cf-danger);
  margin-bottom: 0.75rem;
}
.login-form .btn {
  width: 100%;
  justify-content: center;
}
.login-form .btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
