* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  font-family: Arial, "Malgun Gothic", sans-serif;
}

.overlay-body {
  overflow: hidden;
  background: transparent;
}

#player-shell {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 150px;
  width: 100vw;
  height: 100vh;
}

#player {
  position: relative;
  grid-row: 1;
  width: 100%;
  height: 100%;
}

#youtube-player,
#iframe-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

#player.uses-youtube #iframe-player,
#player.uses-iframe #youtube-player {
  display: none;
}

#player-shell.is-idle #player {
  display: none;
}

#idle {
  position: fixed;
  inset: 0;
  display: none;
  background: transparent;
}

#idle[hidden] {
  display: none;
}

#now-playing {
  position: relative;
  grid-row: 2;
  z-index: 5;
  align-self: stretch;
  width: 100%;
  padding: 16px 32px;
  color: #fff;
  opacity: 1;
  visibility: visible;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
}

#now-playing[hidden] {
  display: none;
}

.overlay-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(10, 12, 18, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 16px 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  max-width: min(960px, 95vw);
  animation: slide-up-fade 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-up-fade {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.overlay-card-icon {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.6);
  animation: spin-pulse 4s infinite linear;
}

@keyframes spin-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.music-icon {
  width: 26px;
  height: 26px;
  color: white;
}

.overlay-card-info {
  display: flex;
  flex-direction: column;
  min-width: 0; /* for ellipsis */
}

#now-title {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}

.overlay-card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #94a3b8;
}

#now-submitter {
  color: #a5b4fc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bullet {
  color: rgba(255, 255, 255, 0.2);
  font-size: 18px;
}

#now-time {
  color: #cbd5e1;
  white-space: nowrap;
}

.admin-body {
  background: #090b0f;
  color: #e2e8f0;
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Malgun Gothic", sans-serif;
  min-height: 100vh;
  padding-bottom: 40px;
}

.admin-layout {
  width: min(1400px, calc(100% - 32px));
  margin: 32px auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.requests-layout {
  width: min(1400px, calc(100% - 32px));
  margin: 32px auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.requests-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 16px;
}

.header-logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.status-glow {
  width: 10px;
  height: 10px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 12px #10b981, 0 0 4px #10b981;
  animation: pulse-glow 2s infinite alternate;
}

@keyframes pulse-glow {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 1; }
}

.requests-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(135deg, #e2e8f0 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.status-update-text {
  font-size: 13px;
  color: #64748b;
  margin: 4px 0 0;
}

.public-submit-panel {
  padding: 18px;
}

.public-submit-form {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.public-submit-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.public-submit-field span {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
}

.public-submit-field input {
  width: 100%;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.7);
  color: #f8fafc;
  font: inherit;
  padding: 0 14px;
  outline: none;
}

.public-submit-field input:focus {
  border-color: rgba(34, 211, 238, 0.65);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.public-submit-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
}

.public-submit-status.success {
  color: #34d399;
}

.public-submit-status.error {
  color: #fca5a5;
}

.public-submit-status.pending {
  color: #67e8f9;
}

.error-banner {
  margin: 0;
  color: #ef4444;
  font-weight: 500;
  font-size: 14px;
  background: rgba(239, 68, 68, 0.1);
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  display: none;
}

.error-banner.active {
  display: block;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Glassmorphism Card base */
.card {
  background: rgba(18, 22, 33, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Toolbar Control Panel */
.toolbar {
  padding: 16px 24px;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Modern Button styling */
.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border: none;
  box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.6);
}

.btn-secondary {
  background: rgba(99, 102, 241, 0.1);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.btn-secondary:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.4);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #fde047;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.btn-warning:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
}

.btn-active {
  background: #6366f1 !important;
  color: white !important;
  border-color: #6366f1 !important;
}

/* Dashboard Top Grid */
.dashboard-top-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
  color: #f1f5f9;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Now Playing Card Layout */
.now-playing-card {
  display: flex;
  gap: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 16px;
  align-items: stretch;
}

.now-playing-thumb-container {
  width: 200px;
  aspect-ratio: 16 / 9;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #1e293b;
  flex-shrink: 0;
}

.now-playing-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.now-playing-thumb-placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #00ffa3, #00b2ff);
  color: #04111f;
  font-weight: 800;
  letter-spacing: 0;
}

.status-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.status-tag.playing {
  background: #10b981;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.status-tag.paused {
  background: #f59e0b;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.now-playing-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
  min-width: 0; /* for text ellipsis */
}

.now-playing-title-row {
  margin-bottom: 4px;
}

.now-playing-title {
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.now-playing-title:hover {
  text-decoration: underline;
  color: #a5b4fc;
}

.now-playing-channel {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.now-playing-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #cbd5e1;
  margin-bottom: 10px;
}

.now-playing-meta strong {
  color: #8b5cf6;
}

.progress-bar-container {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  width: 100%;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  border-radius: 999px;
  transition: width 0.5s ease;
}

.now-playing-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 140px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #64748b;
  font-size: 14px;
}

/* Moderation Box Styles */
.moderation-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.moderation-box h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 0 0 8px;
  letter-spacing: 0.05em;
}

.inline-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.inline-form input {
  flex-grow: 1;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #f1f5f9;
  padding: 8px 12px;
  font-size: 13px;
  height: 36px;
  transition: border-color 0.2s ease;
}

.inline-form input:focus {
  outline: none;
  border-color: #6366f1;
  background: rgba(0, 0, 0, 0.3);
}

.btn-add {
  height: 36px;
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-add:hover {
  background: #4338ca;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 90px;
  overflow-y: auto;
  padding: 4px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  min-height: 40px;
  align-content: flex-start;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #ddd6fe;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-channel {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #cffafe;
}

.btn-tag-remove {
  background: none;
  border: none;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.btn-tag-remove:hover {
  opacity: 1;
  color: #ef4444;
}

/* Requests Grid & Tables */
.requests-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.requests-section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
  color: #f1f5f9;
}

.requests-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.requests-section-header .requests-section-title {
  margin: 0;
}

.btn-compact {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.table-container {
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
  background: rgba(255, 255, 255, 0.02);
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.request-row:hover {
  background: rgba(255, 255, 255, 0.015);
}

/* Thumbnail and Video Title design inside cell */
.request-video-cell {
  padding: 8px 16px;
}

.video-cell-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cell-thumb {
  width: 64px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  background: #1e293b;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.cell-text-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0; /* for ellipsis */
}

.cell-title-link {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-title-link:hover {
  text-decoration: underline;
  color: #a5b4fc;
}

.cell-channel-name {
  font-size: 12px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

/* Status Pill in Table */
.status-pill {
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  color: white;
  text-transform: uppercase;
}

.status-playing {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.status-waiting {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}

.status-played {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
}

.status-skipped {
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #c084fc;
}

.status-blocked {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* Action button inside tables */
.btn-row-remove {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-row-remove:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.empty-state {
  margin: 24px 0;
  text-align: center;
  color: #475569;
  font-size: 14px;
}

.history-section {
  margin-top: 12px;
}

@media (max-width: 1024px) {
  .dashboard-top-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .requests-grid {
    grid-template-columns: 1fr;
  }

  .public-submit-form {
    grid-template-columns: 1fr;
  }

  .public-submit-form .btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .now-playing-card {
    flex-direction: column;
  }
  .now-playing-thumb-container {
    width: 100%;
  }
}
