/**
 * ============================================================================
 * Gather.town v2 Virtual Office — Sleek Dark Theme Stylesheet
 * Authentic Gather v2 UI Layout, Floating Docks, Modals & Micro-interactions
 * ============================================================================
 */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Quicksand:wght@500;700&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

input, textarea, select {
  user-select: text !important;
  -webkit-user-select: text !important;
  pointer-events: auto !important;
}

body {
  font-family: 'Nunito', sans-serif;
  background-color: #0F172A;
  color: #F8FAFC;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
}
::-webkit-scrollbar-thumb {
  background: rgba(71, 85, 105, 0.6);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.8);
}

/* Canvas Container */
#phaser-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  background-color: #0F172A;
}

/* ==========================================================================
   TOP FLOATING HUD & VIDEO CAROUSEL
   ========================================================================== */
#top-hud-bar {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  z-index: 30;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.gather-space-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gather-space-pill.is-private {
  border-color: rgba(99, 102, 241, 0.6);
  background: rgba(30, 27, 75, 0.9);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.35);
}

.gather-music-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gather-music-pill:hover {
  border-color: rgba(244, 63, 94, 0.5);
  box-shadow: 0 4px 25px rgba(244, 63, 94, 0.2);
}

#top-video-carousel {
  pointer-events: auto;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  max-width: calc(100vw - 480px);
  padding-bottom: 4px;
}

.gather-video-tile {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gather-video-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   BOTTOM GATHER DOCK
   ========================================================================== */
#gather-dock {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.gather-dock-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #E2E8F0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gather-dock-btn:hover {
  background: rgba(51, 65, 85, 0.9);
  transform: scale(1.05);
}

.gather-dock-btn:active {
  transform: scale(0.96);
}

.gather-dock-btn.is-active {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.6);
  color: #34D399;
}

.dock-emote-btn {
  padding: 6px 8px;
  border-radius: 10px;
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.dock-emote-btn:hover {
  transform: scale(1.3);
}

/* ==========================================================================
   SIDEBAR (Participants & Chat)
   ========================================================================== */
#gather-sidebar {
  position: absolute;
  top: 14px;
  right: 16px;
  bottom: 84px;
  width: 330px;
  z-index: 35;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

#gather-sidebar.collapsed {
  transform: translateX(360px);
  opacity: 0;
  pointer-events: none;
}

.sidebar-tab-btn {
  flex: 1;
  padding: 10px 0;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  color: #94A3B8;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-tab-btn:hover {
  color: #F1F5F9;
}

.sidebar-tab-btn.active-tab {
  color: #6366F1;
  border-bottom-color: #6366F1;
  background: rgba(99, 102, 241, 0.08);
}

.chat-channel-btn {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #94A3B8;
  background: rgba(30, 41, 59, 0.5);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chat-channel-btn:hover {
  color: #F8FAFC;
  background: rgba(51, 65, 85, 0.8);
}

.chat-channel-btn.active-channel {
  color: #FFFFFF;
  background: #4F46E5;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.gather-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.modal-media-backdrop {
  transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-media-backdrop.is-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}

.gather-modal-card {
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.btn-close-modal {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94A3B8;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-close-modal:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.4);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-6px); }
}

.animate-fadeIn {
  animation: fadeIn 0.25s ease-out forwards;
}

.animate-fadeOut {
  animation: fadeOut 0.25s ease-in forwards;
}

/* Customizer Selection Rings */
.selected-opt {
  outline: 2px solid #6366F1 !important;
  outline-offset: 2px;
  transform: scale(1.08);
}

@keyframes flipIn {
  from { transform: rotateY(90deg) scale(0.8); opacity: 0; }
  to { transform: rotateY(0deg) scale(1); opacity: 1; }
}

.animate-flipIn {
  animation: flipIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.gather-video-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: #000;
}
