/* ==========================================================
   RESET Y BASE
   ========================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colores */
  --bg-primary: #0a0a0a;
  --bg-secondary: #171717;
  --bg-card: #171717;
  --border-color: #262626;
  --text-primary: #fafafa;
  --text-secondary: #d4d4d4;
  --text-muted: #a3a3a3;
  --text-dim: #737373;
  
  /* Colores de acento */
  --emerald-600: #10b981;
  --emerald-500: #22c55e;
  --amber-600: #d97706;
  --amber-500: #f59e0b;
  --fuchsia-600: #c026d3;
  --fuchsia-500: #d946ef;
  --pink-500: #ec4899;
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --teal-900: #134e4a;
  
  /* Espaciado */
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  
  /* Otros */
  --border-radius: 0.75rem;
  --transition: all 0.2s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================
   LAYOUT
   ========================================================== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ==========================================================
   HEADER
   ========================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

.logo {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  background: linear-gradient(to bottom right, var(--pink-500), var(--fuchsia-600));
}

.site-title {
  font-weight: 600;
  letter-spacing: 0.025em;
}

/* ==========================================================
   PLAYER SECTION
   ========================================================== */
.player-section {
  position: sticky;
  top: 56px; /* Altura aproximada del header */
  z-index: 90;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.player-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem 1rem;
}

@media (min-width: 768px) {
  .player-grid {
    grid-template-columns: 2fr 1fr;
  }
}

/* Now Playing */
.now-playing {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.album-art {
  width: 5rem;
  height: 5rem;
  border-radius: var(--border-radius);
  object-fit: cover;
  background-color: #262626;
}

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

.track-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 768px) {
  .track-title {
    font-size: 1.5rem;
  }
}

.track-artist {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticker {
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.ticker span {
  display: inline-block;
  padding-left: 100%;
  animation: ticker 18s linear infinite;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.track-metadata {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  display: flex;
  gap: 0.75rem;
  font-weight: 600;
}

@media (min-width: 768px) {
  .track-metadata {
    font-size: 1.125rem;
  }
}

.metadata-item .label {
  color: var(--text-muted);
}

.progress-bar {
  margin-top: 0.5rem;
  height: 0.375rem;
  border-radius: 9999px;
  background-color: #262626;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--fuchsia-600);
  width: 0%;
  transition: width 1s linear;
}

/* Player Controls */
.player-controls {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .player-controls {
    justify-content: flex-end;
  }
}

.btn-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background-color: var(--emerald-600);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-play:hover {
  background-color: var(--emerald-500);
}

.btn-play .icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: white;
}

.btn-cue {
  padding: 0 0.75rem;
  height: 2.5rem;
  border-radius: 9999px;
  background-color: var(--amber-600);
  color: white;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-cue:hover {
  background-color: var(--amber-500);
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.volume-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.volume-slider {
  width: 10rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: #1f2937;
  outline: none;
  appearance: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  background: white;
  border: 2px solid var(--emerald-600);
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  background: white;
  border: 2px solid var(--emerald-600);
  cursor: pointer;
}

/* ==========================================================
   MAIN CONTENT
   ========================================================== */
.main-content {
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.content-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
}

.subsection-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.help-text {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

.btn-refresh {
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  background-color: #262626;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-refresh:hover {
  background-color: #404040;
}

.btn-refresh:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================================
   GRID LAYOUTS
   ========================================================== */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

@media (min-width: 640px) {
  .status-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .status-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==========================================================
   CARDS
   ========================================================== */
.card {
  padding: 0.75rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
}

.card-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-image {
  width: 3rem;
  height: 3rem;
  border-radius: 0.5rem;
  object-fit: cover;
  background-color: #262626;
  flex-shrink: 0;
}

.card-image-placeholder {
  width: 3rem;
  height: 3rem;
  border-radius: 0.5rem;
  background-color: #262626;
  flex-shrink: 0;
}

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

.card-title {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-timestamp {
  font-size: 0.6875rem;
  color: var(--text-dim);
  margin-top: 0.125rem;
}

.card-metadata {
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge {
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  background-color: #262626;
  font-size: 1rem;
  font-weight: 600;
}

.badge .label {
  color: var(--text-muted);
}

/* Request Card */
.request-card {
  padding: 0.75rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-request {
  padding: 0.25rem 0.75rem;
  border-radius: 0.5rem;
  background-color: var(--emerald-600);
  color: white;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-request:hover {
  background-color: var(--emerald-500);
}

.btn-request:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Requested Card */
.requested-card {
  padding: 0.75rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(20, 184, 166, 0.4);
  background-color: rgba(19, 78, 74, 0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.requested-eta {
  font-size: 0.6875rem;
  color: var(--teal-400);
  margin-top: 0.125rem;
}

/* Status Card */
.status-card {
  padding: 0.75rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
}

.status-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.status-value {
  font-size: 1rem;
  font-weight: 600;
}

/* ==========================================================
   CALENDAR
   ========================================================== */
.calendar-wrapper {
  overflow: auto;
}

.calendar-grid {
  position: relative;
  min-width: 860px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.calendar-header {
  display: grid;
  grid-template-columns: 70px repeat(7, 1fr);
  background-color: var(--bg-secondary);
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.75rem;
}

.calendar-header > div {
  padding: 0.5rem;
  color: var(--text-secondary);
}

.calendar-body {
  display: grid;
  grid-template-columns: 70px repeat(7, 1fr);
}

.calendar-time-cell {
  border-right: 1px solid var(--border-color);
  font-size: 0.6875rem;
  color: var(--text-dim);
}

.calendar-time-cell > div {
  padding: 0.25rem;
}

.calendar-day-cell {
  border-bottom: 1px solid #171717;
  border-right: 1px solid #171717;
  position: relative;
}

.calendar-event {
  position: absolute;
  border-radius: 0.5rem;
  border: 1px solid rgba(217, 70, 239, 0.3);
  background-color: rgba(217, 70, 239, 0.1);
  padding: 0.375rem;
  overflow: hidden;
}

.calendar-event-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.calendar-event-name {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================
   UTILIDADES
   ========================================================== */
.hidden {
  display: none !important;
}

.empty-state {
  color: var(--text-muted);
  padding: 1rem;
  text-align: center;
}
