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

:root {
  --background: #ffffff;
  --foreground: #1a1a1a;
  --card: #5E5EA1;
  --card-foreground: #ffffff;
  --primary: #d4a855;
  --purple: #5E5EA1;
}

html {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow-x: hidden !important;
  overflow-y: scroll !important;
  height: auto !important;
  position: relative !important;
}

body {
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  padding-top: 80px;
  min-height: 100vh;
  overflow-x: hidden !important;
  overflow-y: scroll !important;
  height: auto !important;
  position: relative !important;
}

.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px;
}

.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: visible;
  margin-bottom: 20px;
}

.card > .tabs + .tab-content,
.card > .tab-content {
  background: white;
  border-radius: 0 0 16px 16px;
  margin-top: -2px;
}

.section-header-bar {
  background: #5E5EA1;
  color: white;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  background: #5E5EA1;
  padding: 12px 16px;
  gap: 10px;
  min-height: 56px;
  border-radius: 16px;
  border: 2px solid gold;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  margin-bottom: 0;
}

.tab-btn {
  padding: 10px 20px;
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 8px;
}

.tab-btn:hover {
  color: white;
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
}

.tab-btn.active {
  color: #5E5EA1;
  background: white;
  border-color: gold;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.sub-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  background: #4a4a8a;
  padding: 8px 16px;
  gap: 8px;
  margin-top: -2px;
}

.sub-tab-btn {
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 6px;
}

.sub-tab-btn:hover {
  color: white;
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
}

.sub-tab-btn.active {
  color: #4a4a8a;
  background: white;
  border-color: gold;
}

.subtitle {
  color: #666;
  font-size: 12px;
  padding: 12px 16px;
  border-bottom: none;
}

.sort-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 10px 12px;
  background: #5E5EA1;
  border-radius: 16px 16px 0 0;
}

.sort-buttons-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-stats {
  color: white;
  font-size: 14px;
  font-weight: 500;
}

.sort-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 12px 16px;
  border-bottom: 1px solid #eee;
}

.sort-label {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  margin-right: 4px;
}

.sort-btn {
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 3px;
}

.sort-btn:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
  color: white;
}

.sort-btn.active {
  background: white;
  color: #5E5EA1;
  border-color: white;
}

.sort-arrow {
  font-size: 10px;
  min-width: 10px;
}

.host-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
}

.host-card {
  position: relative;
  display: grid;
  grid-template-rows: 160px auto auto;
  align-items: center;
  justify-items: center;
  padding: 16px 16px 12px 16px;
  background: #E6E6F8;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  height: auto;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.host-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.host-edit-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 10;
  transition: transform 0.2s, background 0.2s;
}
.host-edit-icon:hover {
  transform: scale(1.1);
  background: #f0f0f0;
}
.host-edit-icon svg {
  width: 14px;
  height: 14px;
  color: #5E5EA1;
}

.host-camera-icon {
  position: absolute;
  top: 8px;
  right: 44px;
  width: 28px;
  height: 28px;
  background: #1e90ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 10;
}
.host-camera-icon svg {
  width: 14px;
  height: 14px;
  color: white;
}

.host-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 160px;
  min-height: 160px;
  max-height: 160px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.hit-count-badge {
  position: absolute;
  bottom: 11px;
  right: calc(10% + 6px);
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
}

.hit-count-badge svg {
  width: 11px;
  height: 11px;
}

.host-logo {
  max-width: 90%;
  max-height: 140px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 8px rgba(94, 94, 161, 0.4));
  border: 1px solid #ccc;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.host-edit-icon.large-logo {
  background: #e74c3c;
}
.host-edit-icon.large-logo svg {
  color: white;
}
.host-edit-icon.large-logo:hover {
  background: #c0392b;
}

.host-edit-icon.small-logo {
  background: #f1c40f;
}
.host-edit-icon.small-logo svg {
  color: #333;
}
.host-edit-icon.small-logo:hover {
  background: #d4ac0d;
}

.host-logo-placeholder {
  width: 120px;
  height: 120px;
  min-width: 120px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 8px;
  color: transparent;
  font-weight: bold;
  font-size: 14px;
  text-align: center;
  padding: 8px;
  box-sizing: border-box;
}

/* Image overlays placeholder - placeholder always visible behind */
.host-logo-container .host-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.host-name {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  text-align: center;
  margin-bottom: 4px;
  line-height: 1.3;
  align-self: end;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
  box-sizing: border-box;
}

.host-affiliate {
  font-size: 11px;
  text-align: center;
  margin-bottom: 2px;
}

.host-affiliate a {
  color: #5E5EA1;
  text-decoration: none;
}

.host-affiliate a:hover {
  text-decoration: underline;
}

.host-count {
  font-size: 12px;
  color: #666;
}

.host-contact {
  font-size: 12px;
  color: #000;
  text-align: center;
  word-break: break-all;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: background 0.2s;
}

.host-contact:hover {
  background: rgba(0,0,0,0.1);
}

.host-contact.copied {
  background: #d4edda;
}

.loading-message {
  padding: 40px 20px;
  text-align: center;
  color: #666;
}

@media (max-width: 1000px) {
  .host-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .host-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 500px) {
  .host-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .host-card { padding: 10px 10px 6px 10px; height: auto; grid-template-rows: 120px auto auto; }
  .host-logo-container { height: 120px; min-height: 120px; max-height: 120px; }
  .host-logo { max-width: 90%; max-height: 100px; width: auto; height: auto; }
  .host-logo-placeholder { width: 90px; height: 90px; font-size: 12px; }
  .host-name { font-size: 12px; margin-bottom: 2px; }
  .host-location { font-size: 10px; }
  .host-events { font-size: 10px; }
  .host-count { font-size: 10px; margin-bottom: 0; }
  .sort-header { flex-wrap: nowrap; gap: 6px; padding: 8px 10px; }
  .sort-buttons-left { flex-wrap: nowrap; gap: 4px; }
  .sort-stats { font-size: 10px; white-space: nowrap; }
}

/* Hide sub-tabs on mobile to simplify the interface */
@media (max-width: 768px) {
  .sub-tabs {
    display: none !important;
  }

  /* Make main tabs more compact on mobile */
  .tabs {
    padding: 10px 12px;
    gap: 6px;
  }

  .tab-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* When podcast name wraps to multiple lines - keep count visible */
.host-card.text-wrapped .host-logo {
  max-height: 100px;
  max-width: 50%;
  width: auto;
  height: auto;
}
.host-card.text-wrapped .host-logo-placeholder {
  width: 60px;
  height: 60px;
  font-size: 10px;
}

.promo-section {
  text-align: center;
  padding: 40px 20px;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.8;
  color: #444;
  font-size: 14px;
}
.promo-section h2 {
  color: #5E5EA1;
  font-size: 22px;
  margin-bottom: 20px;
}
.promo-section h3 {
  color: #5E5EA1;
  font-size: 18px;
  margin: 25px 0 15px 0;
}
.promo-section p {
  margin: 12px 0;
}
.promo-section .join-btn {
  display: inline-block;
  background: #5E5EA1;
  color: white;
  padding: 12px 30px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  margin: 15px 0;
  transition: background 0.2s;
}
.promo-section .join-btn:hover {
  background: #4a4a8a;
}
.promo-features {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  margin-top: 20px;
  font-weight: 600;
  color: #5E5EA1;
}

.footer {
  text-align: center;
  padding: 30px 20px;
  font-size: 11px;
  color: #666;
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto;
}
.footer p {
  margin: 8px 0;
}
.footer a {
  color: #5E5EA1;
  text-decoration: none;
}
.footer a:hover {
  text-decoration: underline;
}
