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

:root {
  --bg-primary: #06060f;
  --bg-secondary: #0c0c1e;
  --bg-card: rgba(15, 15, 35, 0.85);
  --text-primary: #f0f0f5;
  --text-secondary: #8888aa;
  --text-muted: #555570;
  --border-subtle: rgba(255, 255, 255, 0.06);

  --color-mainstage: #ff6b35;
  --color-mainstage-glow: rgba(255, 107, 53, 0.15);
  --color-resistance: #00d4ff;
  --color-resistance-glow: rgba(0, 212, 255, 0.15);
  --color-resistance2: #9b59b6;
  --color-resistance2-glow: rgba(155, 89, 182, 0.15);
  --color-umfradio: #ff2d78;
  --color-umfradio-glow: rgba(255, 45, 120, 0.15);
  --color-now: #ff2d78;

  --hour-height: 140px;
  --time-col-width: 54px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  background: #020205; /* Oscuro para PC */
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100%;
}

body {
  height: 100%;
  max-width: 850px;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255,255,255,0.03);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(0, 100, 200, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(155, 50, 180, 0.06) 0%, transparent 60%),
    var(--bg-primary);
}

/* ===== HEADER ===== */
#app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(6, 6, 15, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  flex-shrink: 0;
}

.header-logo-container {
  display: flex;
  align-items: center;
}

.ultra-png-logo {
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.header-live {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 45, 120, 0.12);
  border: 1px solid rgba(255, 45, 120, 0.3);
  border-radius: 20px;
  padding: 5px 12px;
  transition: opacity 0.3s;
}

.header-live.hidden { opacity: 0; pointer-events: none; }

.live-dot {
  width: 7px;
  height: 7px;
  background: #ff2d78;
  border-radius: 50%;
  animation: livePulse 1.5s ease-in-out infinite;
}

.live-text {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #ff2d78;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* ===== STAGE TABS ===== */
#stage-tabs {
  flex-shrink: 0;
  background: rgba(6, 6, 15, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 90;
}

.tabs-container {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.tabs-container::-webkit-scrollbar { display: none; }

.tab {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  scroll-snap-align: start;
  user-select: none;
  background: rgba(255, 255, 255, 0.03);
}

@media (hover: hover) {
  .tab:hover {
    background: rgba(255, 255, 255, 0.08);
  }
}

.tab:active { transform: scale(0.95); }

.tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.tab[data-stage="mainstage"].active {
  background: rgba(255, 107, 53, 0.12);
  border-color: rgba(255, 107, 53, 0.35);
  color: #ff6b35;
}
.tab[data-stage="resistance"].active {
  background: rgba(0, 212, 255, 0.12);
  border-color: rgba(0, 212, 255, 0.35);
  color: #00d4ff;
}
.tab[data-stage="resistance2"].active {
  background: rgba(155, 89, 182, 0.12);
  border-color: rgba(155, 89, 182, 0.35);
  color: #9b59b6;
}
.tab[data-stage="umfradio"].active {
  background: rgba(255, 45, 120, 0.12);
  border-color: rgba(255, 45, 120, 0.35);
  color: #ff2d78;
}

.tab-icon { font-size: 12px; }

.tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tab-color);
}

/* ===== NOW PLAYING BAR ===== */
.now-playing {
  flex-shrink: 0;
  background: linear-gradient(90deg, rgba(255, 45, 120, 0.15), rgba(123, 47, 255, 0.1));
  border-bottom: 1px solid rgba(255, 45, 120, 0.2);
  overflow: hidden;
  transition: max-height 0.3s, opacity 0.3s;
  max-height: 40px;
}

.now-playing.hidden { max-height: 0; opacity: 0; }

.now-playing-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}

.now-label {
  font-weight: 700;
  color: #ff2d78;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.now-artist {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  position: relative;
}

/* Only apply fade mask when marquee is actively scrolling */
.now-artist.marquee-active {
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
  display: inline-flex;
  white-space: nowrap;
}

.marquee-content {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* Only add spacing between duplicated content when scrolling */
.marquee-active .marquee-content {
  padding-right: 40px;
}

.marquee-active .marquee-track {
  animation: marquee-scroll 18s linear infinite;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.artist-sep {
  color: var(--color-now);
  opacity: 0.7;
  margin: 0 10px;
  font-size: 10px;
  vertical-align: middle;
}

/* ===== B2B BADGE ===== */
.b2b-badge {
  display: inline;
  font-size: 0.75em;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  opacity: 0.7;
  margin: 0 2px;
  vertical-align: baseline;
}

/* B2B badge in single stage view */
.events-area[data-view="single"] .b2b-badge {
  font-size: 0.6em;
}

/* B2B badge in modal */
.modal-dj-name .b2b-badge {
  font-size: 0.5em;
  opacity: 0.6;
}

/* B2B badge in marquee */
.marquee-content .b2b-badge {
  font-size: 10px;
}

/* ===== TIMELINE ===== */
#timeline-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  scroll-behavior: smooth;
}

.timeline-scroll {
  position: relative;
  min-height: 100%;
}

/* Time Column */
.time-ruler {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--time-col-width);
  height: 100%;
  z-index: 10;
}

.time-mark {
  position: absolute;
  left: 0;
  width: var(--time-col-width);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0;
  transform: translateY(-8px);
}

.time-mark span {
  font-family: 'Outfit', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.time-mark.half span {
  font-size: 9px;
  font-weight: 500;
  opacity: 0.5;
}

/* Grid lines */
.grid-line {
  position: absolute;
  left: var(--time-col-width);
  right: 0;
  height: 1px;
  background: var(--border-subtle);
}

.grid-line.hour {
  background: rgba(255, 255, 255, 0.05);
}

.grid-line.half {
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px dashed rgba(255, 255, 255, 0.03);
}

/* Event Blocks Area */
.events-area {
  position: absolute;
  left: var(--time-col-width);
  right: 8px;
  top: 0;
  height: 100%;
}

/* Stage Columns for ALL view */
.events-area[data-view="all"] {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.events-area[data-view="single"] {
  padding-left: 8px;
}

.stage-column {
  position: relative;
}

.stage-column-header {
  position: sticky;
  top: 6px;
  z-index: 40;
  text-align: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(6, 6, 15, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 2px;
  border-radius: 8px;
  margin: 0 2px;
  border-bottom: 2px solid;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

/* Event Block */
.event-block {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: blockFadeIn 0.4s ease backwards;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.event-block:hover {
  background: rgba(255, 255, 255, 0.05);
}

.event-block:active {
  transform: scale(0.97);
}

.event-block::before {
  display: none;
}

/* Stage colors */
.event-block.mainstage {
  --stage-color: var(--color-mainstage);
  --stage-glow: var(--color-mainstage-glow);
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(255, 107, 53, 0.05));
  border-color: rgba(255, 107, 53, 0.3);
}
.event-block.mainstage .event-time { color: var(--color-mainstage); }

.event-block.resistance {
  --stage-color: var(--color-resistance);
  --stage-glow: var(--color-resistance-glow);
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(0, 212, 255, 0.05));
  border-color: rgba(0, 212, 255, 0.3);
}
.event-block.resistance .event-time { color: var(--color-resistance); }

.event-block.resistance2 {
  --stage-color: var(--color-resistance2);
  --stage-glow: var(--color-resistance2-glow);
  background: linear-gradient(135deg, rgba(155, 89, 182, 0.15), rgba(155, 89, 182, 0.05));
  border-color: rgba(155, 89, 182, 0.3);
}
.event-block.resistance2 .event-time { color: var(--color-resistance2); }

.event-block.umfradio {
  --stage-color: var(--color-umfradio);
  --stage-glow: var(--color-umfradio-glow);
  background: linear-gradient(135deg, rgba(255, 45, 120, 0.15), rgba(255, 45, 120, 0.05));
  border-color: rgba(255, 45, 120, 0.3);
}
.event-block.umfradio .event-time { color: var(--color-umfradio); }

/* Playing now highlight */
.event-block.playing {
  border-color: var(--stage-color);
  animation: playingGlow 2s ease-in-out infinite;
}

.event-block.past {
  opacity: 0.4;
}

.event-name {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.2px;
  margin-bottom: 6px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.event-time {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  opacity: 0.9;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.event-time::before {
  content: '🕐';
  font-size: 10px;
}

.event-stage-badge {
  display: inline-flex;
  margin-top: 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

.events-area[data-view="all"] .event-name {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  margin-bottom: 2px;
}

.events-area[data-view="all"] .event-time {
  font-size: 8px;
  letter-spacing: 0;
}
.events-area[data-view="all"] .event-time::before {
  display: none;
}

.events-area[data-view="all"] .event-block {
  padding: 6px 5px;
  border-radius: 8px;
  justify-content: center;
}

.events-area[data-view="all"] .event-block::before {
  width: 2px;
}

.events-area[data-view="all"] .event-stage-badge {
  display: none;
}

/* Stage column header in ALL view */
.stage-col-header {
  position: sticky;
  top: 0;
  z-index: 20;
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 6px 2px;
  background: rgba(6, 6, 15, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* ===== NOW LINE ===== */
.now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 50;
  pointer-events: none;
  display: flex;
  align-items: center;
  transition: top 1s linear;
}

.now-line::before {
  content: '';
  position: absolute;
  left: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-now);
  box-shadow: 0 0 8px var(--color-now), 0 0 20px rgba(255, 45, 120, 0.4);
  z-index: 2;
}

.now-line::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-now), rgba(255, 45, 120, 0.3));
  box-shadow: 0 0 6px rgba(255, 45, 120, 0.3);
}

.now-line-label {
  position: absolute;
  right: 8px;
  top: -10px;
  font-size: 10px;
  font-weight: 800;
  color: var(--color-now);
  letter-spacing: 1px;
  background: rgba(6, 6, 15, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 45, 120, 0.5);
  padding: 3px 8px;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(255, 45, 120, 0.3);
  z-index: 5;
}

/* ===== SCROLL TO NOW BUTTON ===== */
.scroll-to-now {
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  right: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #ff2d78, #7b2fff);
  color: white;
  border: none;
  border-radius: 25px;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 4px 20px rgba(255, 45, 120, 0.4);
  transition: all 0.3s ease;
  animation: floatBtn 3s ease-in-out infinite;
}

.scroll-to-now.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.scroll-to-now:active {
  transform: scale(0.92);
}

@keyframes floatBtn {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* ===== ANIMATIONS ===== */
@keyframes blockFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes playingGlow {
  0%, 100% { box-shadow: 0 0 8px var(--stage-glow), inset 0 0 4px var(--stage-glow); }
  50% { box-shadow: 0 0 16px var(--stage-glow), inset 0 0 8px var(--stage-glow); }
}

/* ===== SCROLLBAR ===== */
#timeline-container::-webkit-scrollbar {
  width: 3px;
}

#timeline-container::-webkit-scrollbar-track {
  background: transparent;
}

#timeline-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* ===== DETAIL MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-sheet {
  width: 100%;
  max-width: 420px;
  background: var(--bg-secondary);
  border-radius: 20px 20px 0 0;
  padding: 20px 20px calc(20px + var(--safe-bottom));
  animation: slideUp 0.3s ease;
  border: 1px solid var(--border-subtle);
  border-bottom: none;
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  margin: 0 auto 16px;
}

.modal-dj-name {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.modal-dj-nat {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.modal-stage {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.modal-time-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  margin-bottom: 12px;
}

.modal-time-icon {
  font-size: 20px;
}

.modal-time-range {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

.modal-time-duration {
  font-size: 11px;
  color: var(--text-secondary);
  margin-left: auto;
}

.modal-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

.modal-status.playing {
  background: rgba(255, 45, 120, 0.15);
  color: #ff2d78;
}

.modal-status.upcoming {
  background: rgba(0, 212, 255, 0.1);
  color: #00d4ff;
}

.modal-status.past {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.modal-close {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.modal-close:active {
  background: rgba(255, 255, 255, 0.1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ===== EMPTY HOURS ===== */
.empty-hour-label {
  position: absolute;
  left: calc(var(--time-col-width) + 16px);
  color: var(--text-muted);
  font-size: 11px;
  font-style: italic;
  opacity: 0.5;
  transform: translateY(10px);
}
