/* ==================== GLOBAL PROPERTIES & THEME ==================== */
:root {
  --bg-base: #080808;
  --bg-gradient: linear-gradient(180deg, #0f0f0f 0%, #080808 100%);
  
  --primary: #e65c00;
  --primary-hover: #ff751a;
  --primary-light: rgba(230, 92, 0, 0.15);
  --primary-glow: rgba(230, 92, 0, 0.35);
  
  --text-primary: #eae5d9;
  --text-secondary: #a09a8e;
  --text-muted: #5e584f;
  
  --border-color: rgba(234, 229, 217, 0.08);
  --border-color-active: rgba(230, 92, 0, 0.45);
  
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-hover-bg: rgba(255, 255, 255, 0.07);
  --glass-border: 1px solid rgba(234, 229, 217, 0.05);
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --success: #30d158;
}

/* ==================== BASE RESET ==================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-base);
  background-image: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ==================== BG GLOW ==================== */
.ambient-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 10%, rgba(230, 92, 0, 0.06) 0%, rgba(8, 8, 8, 0) 70%);
  z-index: 0;
  pointer-events: none;
}

/* ==================== CONTAINER & HEADER ==================== */
.app-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
  position: relative;
  z-index: 1;
}

.header {
  margin-bottom: 20px;
  position: sticky;
  top: 0;
  background: rgba(8, 8, 8, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  padding: 8px 0 16px 0;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.header-top {
  display: flex;
  align-items: center;
  position: relative;
  height: 40px;
}

.back-link {
  position: absolute;
  left: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition-fast);
  z-index: 2;
}

.back-link:hover, .back-link:active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.header-title {
  width: 100%;
  text-align: center;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #fff 40%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 40px;
  margin: 0;
}

/* ==================== AGENDA GRID & CARDS ==================== */
.main-content {
  padding-bottom: 80px; /* Avoid overlapping toast */
}

.agenda-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agenda-card {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border: var(--glass-border);
  border-radius: 14px;
  padding: 12px 16px;
  gap: 14px;
  transition: var(--transition-fast);
  overflow: hidden;
}

/* Glowing Border and highlight for TODAY */
.agenda-card.today {
  background: rgba(230, 92, 0, 0.04);
  border-color: var(--border-color-active);
  box-shadow: 0 0 18px rgba(230, 92, 0, 0.08);
}

.agenda-card.today::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
  border-radius: 4px 0 0 4px;
}

.agenda-card:active {
  transform: scale(0.995);
  background: var(--card-hover-bg);
}

.lp-cover-wrapper {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.lp-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  background: #202020;
}

.lp-info {
  flex: 1;
  min-width: 0; /* truncate text safely */
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.agenda-day-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.agenda-card.today .agenda-day-name {
  color: var(--primary);
}

.today-badge {
  font-size: 0.6rem;
  font-weight: 800;
  background: var(--primary);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.lp-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lp-artist {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.lp-plays-badge {
  color: var(--primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Listened Checkmark Icon */
.listened-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(48, 209, 88, 0.15);
  border: 1px solid rgba(48, 209, 88, 0.25);
  color: var(--success);
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* Action Button */
.listen-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 4px 12px rgba(230, 92, 0, 0.2);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.listen-btn:active {
  transform: scale(0.95);
  background: var(--primary-hover);
  box-shadow: 0 2px 6px rgba(230, 92, 0, 0.3);
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  gap: 16px;
  color: var(--text-secondary);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ==================== TOAST SYSTEM ==================== */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: calc(100% - 32px);
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(22, 22, 22, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toast-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  position: relative;
  overflow: hidden;
}

.toast.toast-out {
  animation: toast-out 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: var(--primary);
  animation: toast-progress 3s linear forwards;
}

.toast-success::before {
  background: #30d158;
}

.toast-error::before {
  background: #ff453a;
}

.toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-message {
  flex-grow: 1;
}

@keyframes toast-in {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes toast-out {
  to {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
  }
}

@keyframes toast-progress {
  from { width: 100%; }
  to { width: 0%; }
}
