/* =======================================================
   🎮 CONTEXTO ACTIVE HOSTS STYLES
   ======================================================= */

:root {
  --bg-primary: #15202b;
  --bg-secondary: #1e2433;
  --bg-card: #252d3d;
  --bg-hover: rgba(255, 255, 255, 0.15);
  --orange-accent: #ff8c42;
  --pink-accent: #ff4081;
  --blue-accent: #4a90e2;
  --green-accent: #10b981;
  --text-primary: #1a1a2e;
  --text-dim: #5a5a7a;
  --border-color: rgba(255, 255, 255, 0.2);
  --success-color: #10b981;
  --warning-color: #fbbf24;
}

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

body {
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(135deg, #a8d8ea 0%, #d4e8f0 50%, #c9e4f5 100%);
  background-image: url('https://i.pinimg.com/originals/f1/a7/07/f1a707c5bad8b99796c8c4591d8fc6a2.gif');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text-primary);
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* Background overlay for readability */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(168, 216, 234, 0.7) 0%, rgba(212, 232, 240, 0.75) 50%, rgba(201, 228, 245, 0.7) 100%);
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

body[data-has-bg-image="true"]::before {
  opacity: 1;
}

.active-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* =======================================================
   HEADER
   ======================================================= */

.active-header {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.header-content {
  display: flex;
  justify-content: center;
  align-items: center;
}

.active-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--orange-accent);
  text-align: center;
  margin: 0;
}

/* =======================================================
   INFO BANNER
   ======================================================= */

.info-banner {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  padding: 12px 20px;
  margin-bottom: 20px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.info-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-weight: 700;
  font-size: 14px;
  color: #000000;
}

.divider {
  color: rgba(0, 0, 0, 0.5);
}

.auto-refresh-indicator {
  font-size: 12px;
  color: var(--green-accent);
  animation: pulse 2s ease-in-out infinite;
}

.click-to-join {
  font-size: 13px;
  font-weight: 800;
  color: var(--orange-accent);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* =======================================================
   HOSTS CONTAINER
   ======================================================= */

.hosts-container {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  padding: 30px;
  margin: 0 auto 20px;
  min-height: 400px;
  box-shadow: none;
  backdrop-filter: blur(10px);
}

.hosts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.host-card {
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.host-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--orange-accent), var(--pink-accent));
}

.host-card:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--orange-accent);
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.host-card-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: absolute;
  top: 12px;
  right: 12px;
}

.live-indicator {
  background: #ef4444;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.host-username {
  font-size: 22px;
  font-weight: 800;
  color: #000000;
  word-break: break-word;
  margin-top: 0;
}

.host-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.host-time {
  font-size: 14px;
  font-weight: 600;
  color: #333333;
  display: flex;
  align-items: center;
  gap: 6px;
}

.host-cta {
  font-size: 14px;
  font-weight: 700;
  color: var(--orange-accent);
  display: flex;
  align-items: center;
  gap: 6px;
}

.host-guess-count {
  font-size: 14px;
  font-weight: 600;
  color: #555555;
  display: flex;
  align-items: center;
  gap: 6px;
}

.time-badge {
  background: var(--green-accent);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.time-badge.warning {
  background: var(--warning-color);
  color: #000;
}

.time-badge.old {
  background: var(--text-dim);
}

/* =======================================================
   LOADING & EMPTY STATES
   ======================================================= */

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 20px;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--orange-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #000000;
}

.empty-state p {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}

.empty-state-hint {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.7);
  font-weight: 600;
}

.error-message {
  background: rgba(239, 68, 68, 0.2);
  border: 2px solid #ef4444;
  color: #dc2626;
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 600;
}

/* =======================================================
   FOOTER
   ======================================================= */

.page-footer {
  text-align: center;
  padding: 20px;
  margin-top: 20px;
}

.footer-link {
  display: inline-block;
  background: var(--bg-card);
  color: var(--orange-accent);
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.footer-link:hover {
  background: var(--orange-accent);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 140, 66, 0.4);
}

/* =======================================================
   RESPONSIVE DESIGN
   ======================================================= */

@media (max-width: 768px) {
  .active-page {
    padding: 10px;
  }

  .active-title {
    font-size: 20px;
  }

  .hosts-container {
    padding: 15px;
  }

  .hosts-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .host-card {
    padding: 15px;
  }

  .host-username {
    font-size: 18px;
  }

  .info-content {
    font-size: 12px;
    gap: 8px;
  }
}

@media (max-width: 500px) {
  .active-title {
    font-size: 18px;
  }

  .hosts-container {
    padding: 10px;
  }

  .host-card {
    padding: 12px;
  }

  .host-username {
    font-size: 16px;
  }

  .info-banner {
    padding: 10px 15px;
  }

  .footer-link {
    padding: 10px 20px;
    font-size: 14px;
  }
}
