/* ============================================
   Freerolls Brasil v2 — Spotify Style
   ============================================ */

:root {
  --bg: #121212;
  --bg-elevated: #181818;
  --bg-highlight: #282828;
  --bg-press: #1a1a1a;
  --sidebar: #000000;
  --green: #1DB954;
  --green-hover: #1ed760;
  --green-dark: #169c46;
  --text: #ffffff;
  --text-sub: #b3b3b3;
  --text-muted: #6a6a6a;
  --border: rgba(255,255,255,0.08);
  --radius: 8px;
  --radius-lg: 12px;
  --font: 'Outfit', 'Inter', system-ui, sans-serif;
  --shadow: 0 8px 24px rgba(0,0,0,0.5);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ========== APP LAYOUT ========== */
.app {
  display: flex;
  min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: 240px;
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 16px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 28px;
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-icon {
  font-size: 1.6rem;
  color: var(--green);
}

.logo-text span {
  color: var(--green);
  font-weight: 800;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-sub);
  transition: all 0.2s;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.nav-item:hover {
  color: var(--text);
}

.nav-item.active {
  color: var(--text);
  background: var(--bg-highlight);
}

.sidebar-bottom {
  padding: 16px 8px 0;
}

.sponsor-mini {
  margin-bottom: 20px;
}

.sponsor-mini > span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
}

.sponsor-mini-box {
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: border-color 0.2s;
}

.sponsor-mini-box:hover {
  border-color: var(--green);
  color: var(--green);
}

.update-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pulse {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
  box-shadow: 0 0 6px var(--green);
}

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

/* ========== MAIN ========== */
.main {
  flex: 1;
  margin-left: 240px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========== TOPBAR ========== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(18,18,18,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 6px;
}

.menu-toggle svg { width: 24px; height: 24px; }

.search-box {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-highlight);
  border-radius: 500px;
  padding: 10px 16px;
  transition: box-shadow 0.2s;
}

.search-box:focus-within {
  box-shadow: 0 0 0 2px var(--green);
}

.search-box svg {
  width: 18px;
  height: 18px;
  color: var(--text-sub);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.tz-select {
  background: var(--bg-highlight);
  border: none;
  color: var(--text-sub);
  padding: 8px 12px;
  border-radius: 500px;
  font-size: 0.8rem;
  font-family: var(--font);
  cursor: pointer;
  outline: none;
}

.tz-select:hover { color: var(--text); }

.btn-icon {
  background: var(--bg-highlight);
  border: none;
  color: var(--text-sub);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon svg { width: 18px; height: 18px; }

.btn-icon:hover {
  color: var(--text);
  transform: scale(1.06);
}

.btn-icon.spinning svg {
  animation: spin 0.8s linear infinite;
}

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

/* ========== CONTENT ========== */
.content {
  padding: 0 24px 48px;
  flex: 1;
}

/* ========== HERO ========== */
.hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 24px 0 28px;
  padding: 48px 40px;
  background: linear-gradient(135deg, #1a3a2a 0%, #121212 60%);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(29,185,84,0.25) 0%, transparent 55%);
  pointer-events: none;
}

.hero-content { position: relative; }

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.hero p {
  color: var(--text-sub);
  font-size: 1.05rem;
  margin-bottom: 28px;
}

.stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--green);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========== FILTERS ========== */
.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-sub);
  padding: 7px 16px;
  border-radius: 500px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}

.pill:hover {
  border-color: var(--text-sub);
  color: var(--text);
}

.pill.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.filter-selects {
  display: flex;
  gap: 10px;
}

.filter-selects select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-sub);
  padding: 8px 14px;
  border-radius: 500px;
  font-size: 0.85rem;
  font-family: var(--font);
  cursor: pointer;
  outline: none;
}

.filter-selects select:hover { color: var(--text); }

/* ========== SECTIONS ========== */
.section-block {
  margin-bottom: 40px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
}

.section-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 500px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-now {
  background: rgba(29,185,84,0.2);
  color: var(--green);
}

.badge-soon {
  background: rgba(255,193,7,0.15);
  color: #ffc107;
}

.badge-today {
  background: rgba(255,255,255,0.08);
  color: var(--text-sub);
}

.section-count {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ========== FREEROLL CARDS ========== */
.cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.freeroll-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  transition: background 0.2s;
  position: relative;
}

.freeroll-card:hover {
  background: var(--bg-highlight);
}

.freeroll-card.hot {
  box-shadow: inset 3px 0 0 var(--green);
}

.card-time {
  text-align: center;
}

.card-time .time {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.card-time .date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.card-time .countdown {
  font-size: 0.7rem;
  color: var(--green);
  font-weight: 600;
  margin-top: 2px;
}

.card-info { min-width: 0; }

.card-room {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--green);
  margin-bottom: 2px;
}

.card-name {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-sub);
}

.prize {
  color: #ffc107;
  font-weight: 600;
}

.hot-badge {
  background: rgba(29,185,84,0.2);
  color: var(--green);
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
}

.card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 150px;
}

.password-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.password-box {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.password-box.has {
  background: rgba(29,185,84,0.15);
  color: var(--green);
  border: 1px solid rgba(29,185,84,0.3);
}

.password-box.none {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  font-family: var(--font);
  font-weight: 500;
  font-size: 0.8rem;
}

.password-box.wait {
  background: rgba(255,193,7,0.12);
  color: #ffc107;
  font-family: var(--font);
  font-weight: 500;
  font-size: 0.8rem;
  border: 1px solid rgba(255,193,7,0.25);
}

.btn-copy {
  background: rgba(29,185,84,0.15);
  border: none;
  color: var(--green);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-copy svg { width: 14px; height: 14px; }

.btn-copy:hover {
  background: var(--green);
  color: #000;
  transform: scale(1.08);
}

.btn-copy.copied {
  background: var(--green);
  color: #000;
}

.btn-play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green);
  color: #000;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 7px 16px;
  border-radius: 500px;
  transition: all 0.2s;
}

.btn-play:hover {
  background: var(--green-hover);
  transform: scale(1.04);
}

.btn-play svg { width: 14px; height: 14px; }

/* ========== SPONSOR BANNER ========== */
.sponsor-banner {
  margin: 32px 0;
}

.sponsor-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.25s;
}

.sponsor-link:hover {
  border-color: var(--green);
  color: var(--green);
  background: rgba(29,185,84,0.05);
}

/* ========== SECTIONS (COMO / SALAS) ========== */
.section {
  margin: 48px 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
}

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

.step-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 24px 18px;
  text-align: center;
  transition: background 0.2s;
}

.step-card:hover { background: var(--bg-highlight); }

.step-num {
  width: 36px;
  height: 36px;
  background: var(--green);
  color: #000;
  font-weight: 800;
  font-size: 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.step-card h3 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.step-card p {
  font-size: 0.82rem;
  color: var(--text-sub);
}

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.room-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  transition: background 0.2s;
  cursor: pointer;
}

.room-card:hover { background: var(--bg-highlight); }

.room-card .icon {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.room-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
}

.room-card span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ========== FOOTER ========== */
.footer {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 600px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.footer-brand .logo-icon { color: var(--green); }

.footer p {
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.disclaimer {
  font-size: 0.75rem !important;
  color: var(--text-muted) !important;
}

.copy {
  margin-top: 16px !important;
  color: var(--text-muted) !important;
}

/* ========== LOADING / EMPTY ========== */
.loading-state, .empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-sub);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 0.8s linear infinite;
}

.empty-state .icon {
  font-size: 2.5rem;
  opacity: 0.35;
  margin-bottom: 10px;
}

/* ========== TOAST ========== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--green);
  color: #000;
  padding: 12px 28px;
  border-radius: 500px;
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 999;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(29,185,84,0.35);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== OVERLAY ========== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 90;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .main {
    margin-left: 0;
  }

  .menu-toggle {
    display: flex;
  }

  .steps-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero {
    padding: 32px 24px;
  }
}

@media (max-width: 600px) {
  .content { padding: 0 14px 40px; }

  .freeroll-card {
    grid-template-columns: 1fr;
    gap: 10px;
    text-align: center;
  }

  .card-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }

  .card-actions {
    align-items: center;
    min-width: 0;
  }

  .password-area { justify-content: center; }

  .card-name { white-space: normal; }

  .steps-grid { grid-template-columns: 1fr; }

  .stats { gap: 18px; }

  .search-box { max-width: none; }

  .filters-bar { flex-direction: column; align-items: stretch; }

  .filter-selects { width: 100%; }
  .filter-selects select { flex: 1; }
}
