/* Stream Layout Modes */

/* Theater Mode */
body.theater-mode {
  overflow: hidden;
}

body.theater-mode .grid {
  display: flex !important;
  flex-direction: column;
  height: 100vh;
  gap: 0;
}

body.theater-mode .stream-card {
  flex: 1;
  height: 100% !important;
  max-height: none !important;
  border-radius: 0;
}

body.theater-mode .events-card,
body.theater-mode .chat-card {
  display: none;
}

body.theater-mode #streamEmbed {
  height: 100% !important;
}

/* Theater Mode with Chat Overlay */
body.theater-chat-mode {
  overflow: hidden;
}

body.theater-chat-mode .grid {
  display: flex !important;
  flex-direction: column;
  height: 100vh;
  position: relative;
  gap: 0;
}

body.theater-chat-mode .stream-card {
  flex: 1;
  height: 100% !important;
  max-height: none !important;
  border-radius: 0;
  position: relative;
  z-index: 1;
}

body.theater-chat-mode #streamEmbed {
  height: 100% !important;
}

body.theater-chat-mode .events-card {
  display: none;
}

body.theater-chat-mode .chat-card {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 360px;
  height: 500px;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

body.theater-chat-mode .chat-card:hover {
  opacity: 1;
}

/* Picture-in-Picture Mode */
body.pip-mode {
  overflow: auto;
}

body.pip-mode .stream-card {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 480px;
  height: 270px;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(145, 70, 255, 0.3);
  cursor: move;
}

body.pip-mode #streamEmbed {
  height: 100% !important;
}

body.pip-mode .chat-card,
body.pip-mode .events-card {
  display: flex;
  flex-direction: column;
}

/* PIP Mode with Chat Overlay */
body.pip-chat-mode {
  overflow: auto;
}

body.pip-chat-mode .stream-card {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 480px;
  height: 270px;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(145, 70, 255, 0.3);
  cursor: move;
}

body.pip-chat-mode #streamEmbed {
  height: 100% !important;
}

body.pip-chat-mode .chat-card {
  position: fixed;
  right: 20px;
  bottom: 300px;
  width: 360px;
  height: 400px;
  z-index: 999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

body.pip-chat-mode .chat-card:hover {
  opacity: 1;
}

body.pip-chat-mode .events-card {
  display: flex;
  flex-direction: column;
}

/* Layout Mode Switcher */
.layout-switcher {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(145, 70, 255, 0.3);
  border-radius: 0;
  padding: 12px;
  display: flex;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.layout-btn {
  background: rgba(145, 70, 255, 0.1);
  border: 1px solid rgba(145, 70, 255, 0.3);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.layout-btn:hover {
  background: rgba(145, 70, 255, 0.2);
  border-color: rgba(145, 70, 255, 0.5);
  transform: translateY(-2px);
}

.layout-btn.active {
  background: linear-gradient(135deg, #9146ff 0%, #6c2bd9 100%);
  border-color: #9146ff;
  box-shadow: 0 0 20px rgba(145, 70, 255, 0.4);
}

/* Reactions Panel */
.reactions-panel {
  display: none !important; /* Hidden - using floating emojis instead */
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(145, 70, 255, 0.3);
  border-radius: 0;
  padding: 12px;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.reaction-btn {
  background: rgba(145, 70, 255, 0.1);
  border: 1px solid rgba(145, 70, 255, 0.3);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 0;
  cursor: pointer;
  font-size: 24px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.reaction-btn:hover {
  background: rgba(145, 70, 255, 0.2);
  border-color: rgba(145, 70, 255, 0.5);
  transform: scale(1.1);
}

.reaction-btn:active {
  transform: scale(0.95);
}

.reaction-btn .cost {
  position: absolute;
  bottom: -6px;
  right: -6px;
  background: #9146ff;
  color: #fff;
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 0;
  font-weight: bold;
}

/* Local Reaction Animation */
.local-reaction {
  position: fixed;
  font-size: 60px;
  pointer-events: none;
  z-index: 10001;
  animation: local-float 2s ease-out forwards;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

@keyframes local-float {
  0% {
    transform: translateY(0) scale(0.5) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
    transform: translateY(-20px) scale(1.5) rotate(10deg);
  }
  100% {
    transform: translateY(-200px) scale(1) rotate(-10deg);
    opacity: 0;
  }
}

/* Watch Stats Display */
.watch-stats {
  position: fixed;
  top: 80px;
  left: 20px;
  z-index: 100;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(145, 70, 255, 0.3);
  border-radius: 0;
  padding: 12px 16px;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  min-width: 200px;
}

.watch-stats .stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.watch-stats .stat-label {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.watch-stats .stat-value {
  color: #9146ff;
  font-weight: bold;
}

.watch-stats .multiplier {
  background: linear-gradient(135deg, #9146ff 0%, #6c2bd9 100%);
  color: #fff;
  padding: 4px 8px;
  border-radius: 0;
  font-weight: bold;
  text-align: center;
  margin-top: 8px;
  font-size: 14px;
}

/* Draggable PIP */
.stream-card.dragging {
  opacity: 0.8;
  cursor: grabbing !important;
}

.stream-card.pip-draggable {
  cursor: grab;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .layout-switcher {
    bottom: 10px;
    left: 10px;
    padding: 8px;
    gap: 4px;
  }

  .layout-btn {
    padding: 6px 12px;
    font-size: 11px;
  }

  .reactions-panel {
    top: 10px;
    right: 10px;
    padding: 8px;
    gap: 6px;
  }

  .reaction-btn {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  body.theater-chat-mode .chat-card {
    width: 280px;
    height: 400px;
    right: 10px;
    bottom: 10px;
  }

  body.pip-mode .stream-card,
  body.pip-chat-mode .stream-card {
    width: 320px;
    height: 180px;
    right: 10px;
    bottom: 10px;
  }

  body.pip-chat-mode .chat-card {
    width: 280px;
    height: 300px;
    bottom: 200px;
  }

  .watch-stats {
    top: auto;
    bottom: 10px;
    left: 10px;
    font-size: 11px;
    padding: 8px 12px;
    min-width: 160px;
  }
}

/* Hide layout switcher in popout chat */
body.popout-chat .layout-switcher,
body.popout-chat .reactions-panel,
body.popout-chat .watch-stats {
  display: none;
}
