/* Multi-Stream Monitor V2 - HongTin Donate Brand Aesthetic */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Kantumruy+Pro:wght@400;600;700&family=Outfit:wght@400;600;700;800;900&display=swap');

:root {
  --bg-primary: #060912;
  --bg-card: rgba(15, 23, 42, 0.8);
  --bg-card-hover: rgba(26, 36, 56, 0.9);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(255, 183, 0, 0.35);

  --brand-gold: #ffb700;
  --brand-gold-end: #ff8800;
  --brand-cyan: #00e5ff;
  --brand-emerald: #00e676;
  --brand-pink: #ff3366;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

body {
  background: radial-gradient(circle at 15% 15%, rgba(255, 183, 0, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(0, 229, 255, 0.05) 0%, transparent 45%),
    #060912;
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  margin: 0;
  font-family: 'Outfit', 'Kantumruy Pro', 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 183, 0, 0.25);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-gold);
}

/* Background Ambient Glow */
.glow-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255, 183, 0, 0.04) 0%, transparent 50%);
}

/* Header Navbar */
.multistream-header {
  background: rgba(11, 15, 25, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 183, 0, 0.15);
  padding: 0.85rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5);
}

/* Pulse animation for live dot */
@keyframes livePulseAnimation {
  0% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(255, 51, 102, 0.8);
  }

  70% {
    transform: scale(1.15);
    box-shadow: 0 0 0 8px rgba(255, 51, 102, 0);
  }

  100% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(255, 51, 102, 0);
  }
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--brand-pink);
  border-radius: 50%;
  display: inline-block;
  animation: livePulseAnimation 2s infinite;
  box-shadow: 0 0 8px var(--brand-pink);
}

.offline-dot {
  width: 8px;
  height: 8px;
  background-color: #64748b;
  border-radius: 50%;
  display: inline-block;
}

/* Back to Dashboard Premium Button (Brand Gold Theme) */
.back-to-dashboard-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 18px !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, rgba(20, 26, 42, 0.9) 0%, rgba(32, 42, 64, 0.85) 100%) !important;
  border: 1px solid rgba(255, 183, 0, 0.35) !important;
  border-radius: 30px !important;
  text-decoration: none !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

.back-to-dashboard-btn svg {
  stroke: var(--brand-gold) !important;
  transition: transform 0.25s ease !important;
}

.back-to-dashboard-btn:hover {
  background: linear-gradient(135deg, rgba(255, 183, 0, 0.22) 0%, rgba(255, 136, 0, 0.22) 100%) !important;
  border-color: var(--brand-gold) !important;
  color: var(--brand-gold) !important;
  box-shadow: 0 0 20px rgba(255, 183, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-2px) !important;
}

.back-to-dashboard-btn:hover svg {
  transform: translateX(-3px) !important;
  stroke: var(--brand-gold) !important;
}

/* Pro Action Buttons */
.btn-pro {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 18px;
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: 30px;
  border: 1px solid rgba(255, 183, 0, 0.4);
  background: linear-gradient(135deg, rgba(255, 183, 0, 0.15) 0%, rgba(255, 136, 0, 0.15) 100%);
  color: var(--brand-gold);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  text-decoration: none;
}

.btn-pro:hover {
  background: linear-gradient(135deg, rgba(255, 183, 0, 0.3) 0%, rgba(255, 136, 0, 0.3) 100%);
  border-color: var(--brand-gold);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(255, 183, 0, 0.45);
  transform: translateY(-2px);
}

.btn-pro-gold {
  background: linear-gradient(135deg, #ffb700 0%, #ff8800 100%) !important;
  border: 1px solid #ffb700 !important;
  color: #060912 !important;
  font-weight: 900 !important;
  box-shadow: 0 4px 15px rgba(255, 183, 0, 0.35) !important;
}

.btn-pro-gold:hover {
  background: linear-gradient(135deg, #ffc733 0%, #ffa01a 100%) !important;
  color: #000000 !important;
  box-shadow: 0 6px 22px rgba(255, 183, 0, 0.6) !important;
  transform: translateY(-2px) !important;
}

.btn-pro-emerald {
  background: linear-gradient(135deg, #00e676 0%, #00b0ff 100%) !important;
  border: 1px solid #00e676 !important;
  color: #060912 !important;
  font-weight: 900 !important;
  box-shadow: 0 4px 15px rgba(0, 230, 118, 0.35) !important;
}

.btn-pro-emerald:hover {
  background: linear-gradient(135deg, #00ff84 0%, #33c4ff 100%) !important;
  color: #000000 !important;
  box-shadow: 0 6px 22px rgba(0, 230, 118, 0.6) !important;
  transform: translateY(-2px) !important;
}

/* Grid Layout Selector Buttons */
.grid-mode-selector {
  display: flex;
  background: rgba(0, 0, 0, 0.55);
  padding: 4px;
  border-radius: 25px;
  border: 1px solid rgba(255, 183, 0, 0.2);
  gap: 3px;
}

.btn-grid-layout {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.78rem;
  padding: 7px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-grid-layout.active {
  background: linear-gradient(135deg, #ffb700 0%, #ff8800 100%);
  color: #060912;
  font-weight: 900;
  box-shadow: 0 0 16px rgba(255, 183, 0, 0.45);
  border-color: #ffb700;
}

.btn-grid-layout:hover:not(.active) {
  background: rgba(255, 183, 0, 0.15);
  color: var(--brand-gold);
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  transition: all 0.25s ease;
}

.glass-card:hover {
  border-color: rgba(255, 183, 0, 0.25);
}

/* Streamer List Card Items */
/* Channel Style Streamer Directory Items (Compact Pro Style) */
.channel-streamer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  margin-bottom: 5px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  user-select: none;
}

.channel-streamer-item:hover {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 183, 0, 0.3);
  transform: translateX(2px);
}

.channel-streamer-item.is-offline:not(.is-watching) {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

.channel-streamer-item.is-offline:not(.is-watching):hover {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(239, 68, 68, 0.25);
  transform: none;
  cursor: not-allowed;
}

.channel-streamer-item.is-watching {
  background: linear-gradient(135deg, rgba(255, 183, 0, 0.16) 0%, rgba(255, 136, 0, 0.08) 100%) !important;
  border: 1px solid rgba(255, 183, 0, 0.45) !important;
  border-left: 3.5px solid #ffb700 !important;
  box-shadow: 0 2px 14px rgba(255, 183, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.channel-streamer-item.is-watching:hover {
  background: linear-gradient(135deg, rgba(255, 85, 85, 0.2) 0%, rgba(255, 0, 85, 0.12) 100%) !important;
  border-color: rgba(255, 85, 85, 0.55) !important;
  border-left-color: #ff5555 !important;
}

.badge-watching-active {
  background: linear-gradient(135deg, rgba(255, 183, 0, 0.25) 0%, rgba(255, 136, 0, 0.2) 100%);
  color: #ffb700;
  border: 1px solid rgba(255, 183, 0, 0.5);
  font-size: 0.62rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 900;
  letter-spacing: 0.5px;
  box-shadow: 0 0 8px rgba(255, 183, 0, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.22s ease;
}

.badge-watching-active .remove-text {
  display: none;
}

.channel-streamer-item.is-watching:hover .badge-watching-active {
  background: linear-gradient(135deg, rgba(255, 85, 85, 0.35) 0%, rgba(255, 0, 85, 0.25) 100%);
  color: #ffffff;
  border-color: rgba(255, 85, 85, 0.7);
  box-shadow: 0 0 10px rgba(255, 85, 85, 0.5);
}

.channel-streamer-item.is-watching:hover .badge-watching-active svg,
.channel-streamer-item.is-watching:hover .badge-watching-active .watching-text {
  display: none;
}

.channel-streamer-item.is-watching:hover .badge-watching-active .remove-text {
  display: inline;
}

.channel-avatar-wrapper {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  margin-right: 10px;
}

.channel-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.2px solid rgba(255, 255, 255, 0.2);
}

.channel-avatar-initials {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border: 1.2px solid rgba(255, 183, 0, 0.4);
  color: #ffb700;
  font-weight: 900;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.avatar-live-dot {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  background-color: #ff0055;
  border: 1.5px solid #0b0f19;
  border-radius: 50%;
  animation: livePulseAnimation 2s infinite;
  box-shadow: 0 0 6px #ff0055;
  z-index: 2;
}

.avatar-platform-icon {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 14px;
  height: 14px;
  background: #ff0000;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  z-index: 2;
  border: 1.5px solid #0b0f19;
}

.avatar-platform-icon svg {
  width: 8px;
  height: 8px;
  fill: #ffffff;
}

.channel-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
}

.channel-name {
  font-weight: 800;
  color: #ffffff;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.channel-status-side {
  margin-left: 8px;
  flex-shrink: 0;
}

.badge-live-tag {
  background: rgba(255, 68, 68, 0.12);
  color: #ff4b4b;
  border: 1px solid rgba(255, 68, 68, 0.45);
  font-size: 0.62rem;
  padding: 1px 6px;
  border-radius: 5px;
  font-weight: 900;
  letter-spacing: 0.6px;
  box-shadow: 0 0 8px rgba(255, 68, 68, 0.2);
  flex-shrink: 0;
}

.badge-offline-tag {
  color: #64748b;
  font-size: 0.62rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Sleek Pro Watch Toggle Button */
.btn-watch-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-watch-toggle:hover {
  background: linear-gradient(135deg, #ffb700 0%, #ff8800 100%);
  color: #060912;
  border-color: #ffb700;
  box-shadow: 0 4px 14px rgba(255, 183, 0, 0.4);
  transform: translateY(-1px);
}

.btn-watch-toggle.active-watching {
  background: rgba(0, 229, 255, 0.12) !important;
  border: 1px solid rgba(0, 229, 255, 0.45) !important;
  color: #00e5ff !important;
  font-weight: 800 !important;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.25) !important;
}

.btn-watch-toggle.active-watching:hover {
  background: rgba(0, 229, 255, 0.25) !important;
  border-color: #00e5ff !important;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.4) !important;
  transform: translateY(-1px);
}

/* Stream Player Container & Card */
.stream-player-card {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 183, 0, 0.25);
  background: #070b14;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  transition: all 0.25s ease;
}

.stream-player-card:hover {
  border-color: rgba(255, 183, 0, 0.5);
  box-shadow: 0 10px 35px rgba(255, 183, 0, 0.2);
}

.stream-player-card.is-dragging {
  opacity: 0.45;
  transform: scale(0.97);
  border: 2px dashed #ffb700 !important;
  box-shadow: 0 0 20px rgba(255, 183, 0, 0.4) !important;
}

.stream-player-card.drag-over {
  border: 2px solid #00e5ff !important;
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.5) !important;
  transform: scale(1.02);
}

.stream-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  color: #64748b;
  padding: 3px 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  user-select: none;
}

.stream-drag-handle:hover {
  color: #ffb700;
  background: rgba(255, 183, 0, 0.15);
}

.stream-drag-handle:active {
  cursor: grabbing;
}

.stream-move-buttons-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1px 3px;
  border-radius: 20px;
}

/* Header Lock Streams Toggle Button */
.btn-lock-streams {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.btn-lock-streams:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 183, 0, 0.4);
}

.btn-lock-streams.is-locked {
  background: linear-gradient(135deg, rgba(255, 183, 0, 0.2) 0%, rgba(255, 136, 0, 0.15) 100%);
  border-color: #ffb700;
  color: #ffb700;
  box-shadow: 0 0 12px rgba(255, 183, 0, 0.35);
}

.stream-player-card.is-locked-card {
  user-select: auto;
}

/* Stream Player Header Bar (Pro Controls) */
.stream-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(20, 26, 40, 0.98) 0%, rgba(12, 16, 26, 0.95) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 10px;
}

.stream-card-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  flex: 1;
}

.header-streamer-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 183, 0, 0.4);
  flex-shrink: 0;
}

.header-streamer-title {
  font-weight: 800;
  color: #ffffff;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.header-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 0, 85, 0.15);
  border: 1px solid rgba(255, 0, 85, 0.4);
  color: #ff3366;
  font-size: 0.62rem;
  padding: 2px 7px;
  border-radius: 12px;
  font-weight: 900;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.header-offline-badge {
  color: #64748b;
  font-size: 0.62rem;
  font-weight: 700;
  flex-shrink: 0;
}

.stream-card-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-donate-header {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 900;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffb700 0%, #ff8800 100%);
  color: #060912;
  border: 1px solid #ffb700;
  box-shadow: 0 0 12px rgba(255, 183, 0, 0.4);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-donate-header:hover {
  background: linear-gradient(135deg, #ffc733 0%, #ffa01a 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 183, 0, 0.6);
  color: #000000;
}

/* Stream Header Volume Control Slider & Buttons */
.stream-volume-control-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 7px 2px 3px;
  border-radius: 20px;
  transition: all 0.2s ease;
}

.stream-volume-control-group:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 183, 0, 0.3);
}

.btn-volume-toggle.is-muted {
  background: rgba(255, 85, 85, 0.2) !important;
  border-color: rgba(255, 85, 85, 0.5) !important;
  color: #ff5555 !important;
}

.stream-volume-slider {
  width: 50px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stream-volume-slider:hover {
  background: rgba(255, 183, 0, 0.5);
}

.stream-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffb700;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(255, 183, 0, 0.6);
  transition: transform 0.15s ease;
}

.stream-volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.btn-header-tool {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-header-tool:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: rgba(0, 229, 255, 0.4);
  color: #00e5ff;
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.btn-header-close:hover {
  background: rgba(255, 85, 85, 0.2) !important;
  border-color: rgba(255, 85, 85, 0.5) !important;
  color: #ff5555 !important;
  box-shadow: 0 0 10px rgba(255, 85, 85, 0.4) !important;
}

/* Hide Back to Dashboard button when embedded inside dashboard tab iframe */
.is-iframe .back-to-dashboard-btn {
  display: none !important;
}

/* Responsive Media Queries */
@media (max-width: 1200px) {
  .multistream-layout-container {
    grid-template-columns: 1fr !important;
  }

  .multistream-sidebar-column {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem !important;
  }
}

@media (max-width: 768px) {
  .multistream-header {
    padding: 0.85rem 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .multistream-header-left,
  .multistream-header-right {
    width: 100%;
    justify-content: space-between;
  }

  .multistream-sidebar-column {
    grid-template-columns: 1fr !important;
  }

  .multistream-grid {
    grid-template-columns: 1fr !important;
  }

  #custom-stream-url-input {
    width: 100% !important;
    flex: 1;
  }

  .custom-stream-input-group {
    width: 100%;
  }
}