/* ==========================================
   DESIGN SYSTEM - TOKENS & RESET
   ========================================== */
:root {
  --bg-dark: hsl(230, 25%, 8%);
  --panel-bg: rgba(18, 22, 35, 0.65);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-primary: hsl(210, 20%, 98%);
  --text-secondary: hsl(215, 15%, 70%);
  --text-muted: hsl(215, 10%, 50%);
  
  --primary-glow: linear-gradient(135deg, hsl(270, 90%, 65%), hsl(245, 90%, 60%));
  --primary-color: hsl(265, 85%, 60%);
  --primary-hover: hsl(265, 90%, 65%);
  --secondary-color: rgba(255, 255, 255, 0.08);
  --secondary-hover: rgba(255, 255, 255, 0.15);
  --danger-color: hsl(355, 85%, 60%);
  --danger-hover: hsl(355, 90%, 65%);
  --accent-color: hsl(180, 80%, 45%);
  
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(138, 43, 226, 0.3);
  
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================
   AMBIENT GLOWS
   ========================================== */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  z-index: -1;
  pointer-events: none;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: hsl(270, 90%, 60%);
  top: -100px;
  left: -100px;
  animation: float-orb 15s ease-in-out infinite alternate;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: hsl(245, 90%, 55%);
  bottom: -150px;
  right: -100px;
  animation: float-orb 20s ease-in-out infinite alternate-reverse;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: hsl(330, 90%, 60%);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.08;
}

@keyframes float-orb {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(40px) scale(1.1); }
}

/* ==========================================
   LAYOUT STRUCTURE
   ========================================== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 3rem;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(to right, #fff, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-icon {
  color: hsl(270, 95%, 65%);
  filter: drop-shadow(0 0 8px rgba(138, 43, 226, 0.5));
}

.love-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.75rem;
  font-size: 1.25rem;
  text-decoration: none;
  cursor: pointer;
  animation: heart-pulse 1.6s infinite ease-in-out;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.love-badge:hover {
  transform: scale(1.35) rotate(5deg);
}

@keyframes heart-pulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255, 51, 102, 0.5)); }
  50% { transform: scale(1.2); filter: drop-shadow(0 0 10px rgba(255, 51, 102, 0.9)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255, 51, 102, 0.5)); }
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--panel-bg);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  border: 1px solid var(--panel-border);
  font-size: 0.85rem;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.connected {
  background-color: hsl(140, 80%, 50%);
  box-shadow: 0 0 8px hsl(140, 80%, 50%);
}

.status-indicator.disconnected {
  background-color: hsl(0, 80%, 55%);
  box-shadow: 0 0 8px hsl(0, 80%, 55%);
}

.status-indicator.connecting {
  background-color: hsl(40, 90%, 55%);
  box-shadow: 0 0 8px hsl(40, 90%, 55%);
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

.app-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 3rem 3rem 3rem;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  min-height: calc(100vh - 120px);
}

/* ==========================================
   GLASS PANELS & CARDS
   ========================================== */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

.card {
  width: 100%;
  max-width: 520px;
  padding: 2.5rem;
  animation: fadeIn 0.4s ease-out;
}

.card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.card-header h1 {
  font-family: var(--font-title);
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #fff, hsl(230, 20%, 80%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   TABS & INPUTS
   ========================================== */
.setup-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 0.25rem;
  margin-bottom: 2rem;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tab-content {
  animation: fadeInTab 0.3s ease-out;
}

@keyframes fadeInTab {
  from { opacity: 0; }
  to { opacity: 1; }
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.input-group label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"] {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 0.9rem 1.2rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  width: 100%;
  transition: var(--transition);
  outline: none;
}

input[type="text"]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(138, 43, 226, 0.25);
}

.action-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.share-box {
  background: rgba(138, 43, 226, 0.06);
  border: 1px solid rgba(138, 43, 226, 0.15);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.share-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  outline: none;
}

.btn-primary {
  background: var(--primary-glow);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(138, 43, 226, 0.45);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--secondary-color);
  color: var(--text-primary);
  border: 1px solid var(--panel-border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--secondary-hover);
  color: #fff;
}

.btn-danger {
  background: var(--danger-color);
  color: #fff;
}

.btn-danger:hover {
  background: var(--danger-hover);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.35);
}

.w-full {
  width: 100%;
}

.btn-primary:disabled, .btn-secondary:disabled, .disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ==========================================
   MEETING AREA & SIDE PANELS
   ========================================== */
.meeting-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  width: 100%;
  height: calc(100vh - 180px);
  animation: fadeIn 0.4s ease-out;
}

.video-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
  padding: 1rem;
}

.video-wrapper {
  flex: 1;
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

#screenshare-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 12, 18, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
  z-index: 2;
}

.overlay-center-info {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 400px;
  padding: 1.5rem;
}

.pulse-icon {
  color: var(--primary-color);
  filter: drop-shadow(0 0 10px rgba(138, 43, 226, 0.6));
}

.overlay-center-info h2 {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
}

.overlay-center-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* PIP Camera Container (Positioned top-right so it never clips controls) */
.pip-container {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 8;
  pointer-events: none;
  transition: right 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), top 0.3s ease;
}

.pip-video-wrapper {
  width: 140px;
  height: 95px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 17, 23, 0.85);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: auto;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pip-video-wrapper:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7);
}

.pip-video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  transform-origin: center center;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), object-position 0.2s ease;
}

/* Base camera inversion & centering transforms (shifts eyes/face onto sweet spot) */
#local-camera-video,
#remote-camera-video {
  transform: translate(var(--cam-pan-x, 0px), var(--cam-pan-y, 8px)) scaleX(-1) scale(var(--cam-zoom, 1.15));
}

#local-camera-video.camera-uninverted,
#remote-camera-video.camera-uninverted {
  transform: translate(var(--cam-pan-x, 0px), var(--cam-pan-y, 8px)) scaleX(1) scale(var(--cam-zoom, 1.15));
}

.remote-pip-wrapper .pip-action-btn.btn-invert-cam {
  right: 28px;
}

.remote-pip-wrapper .pip-action-btn.btn-center-cam {
  right: 52px;
}

/* Circular Camera Mode ("Little Circles") - Person Centered with Smooth Expansion on Hover */
.pip-video-wrapper.pip-circle {
  width: 95px !important;
  height: 95px !important;
  border-radius: 50% !important;
  border: 2px solid rgba(0, 242, 254, 0.75) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 15px rgba(0, 242, 254, 0.35) !important;
  transition: width 0.34s cubic-bezier(0.34, 1.25, 0.64, 1),
              height 0.34s cubic-bezier(0.34, 1.25, 0.64, 1),
              border-radius 0.3s ease,
              border-color 0.25s ease,
              box-shadow 0.25s ease,
              transform 0.25s ease !important;
  overflow: hidden !important;
  z-index: 8;
}

.pip-video-wrapper.pip-circle video {
  border-radius: 50% !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center 32% !important;
  transition: border-radius 0.3s ease, transform 0.25s ease, object-position 0.25s ease !important;
}

/* In circle mode resting state, zoom 1.32x and shift down ~14px so face/eyes sit dead-center */
.pip-video-wrapper.pip-circle #local-camera-video,
.pip-video-wrapper.pip-circle #remote-camera-video {
  transform: translate(var(--cam-pan-x, 0px), var(--cam-pan-y, 14px)) scaleX(-1) scale(var(--cam-zoom, 1.32));
}

.pip-video-wrapper.pip-circle #local-camera-video.camera-uninverted,
.pip-video-wrapper.pip-circle #remote-camera-video.camera-uninverted {
  transform: translate(var(--cam-pan-x, 0px), var(--cam-pan-y, 14px)) scaleX(1) scale(var(--cam-zoom, 1.32));
}

.pip-video-wrapper.pip-circle .pip-label {
  bottom: 2px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  border-radius: 10px !important;
  font-size: 0.58rem !important;
  padding: 1px 6px !important;
  background: rgba(0, 0, 0, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  z-index: 12 !important;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* In circle resting state, action buttons stay hidden so circle is 100% clean and nothing gets cut */
.pip-video-wrapper.pip-circle .pip-action-btn,
.pip-video-wrapper.pip-circle .pip-mute-btn {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-5px) scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

/* ==========================================================================
   HOVER EXPANSION: On hover, circle morphs back into original view with options!
   ========================================================================== */
.pip-video-wrapper.pip-circle:hover {
  width: 154px !important;
  height: 104px !important;
  border-radius: 12px !important;
  border-color: rgba(0, 242, 254, 0.95) !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.85), 0 0 24px rgba(0, 242, 254, 0.5) !important;
  z-index: 25 !important;
  transform: scale(1.02);
}

.pip-video-wrapper.pip-circle:hover video {
  border-radius: 12px !important;
  object-position: center 35% !important;
}

.pip-video-wrapper.pip-circle:hover #local-camera-video,
.pip-video-wrapper.pip-circle:hover #remote-camera-video {
  transform: translate(var(--cam-pan-x, 0px), var(--cam-pan-y, 8px)) scaleX(-1) scale(var(--cam-zoom, 1.15)) !important;
}

.pip-video-wrapper.pip-circle:hover #local-camera-video.camera-uninverted,
.pip-video-wrapper.pip-circle:hover #remote-camera-video.camera-uninverted {
  transform: translate(var(--cam-pan-x, 0px), var(--cam-pan-y, 8px)) scaleX(1) scale(var(--cam-zoom, 1.15)) !important;
}

.pip-video-wrapper.pip-circle:hover .pip-label {
  bottom: 6px !important;
  left: 6px !important;
  transform: none !important;
  border-radius: 4px !important;
  font-size: 0.65rem !important;
  padding: 2px 7px !important;
}

/* Fade in action buttons on hover */
.pip-video-wrapper:hover .pip-action-btn,
.pip-video-wrapper:hover .pip-mute-btn,
.pip-video-wrapper.pip-circle:hover .pip-action-btn,
.pip-video-wrapper.pip-circle:hover .pip-mute-btn {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) scale(1) !important;
}

/* ==========================================================================
   NEW ACTION BUTTON DESIGN: Sleek glassmorphic controls with glowing hover states
   ========================================================================== */
.pip-action-btn,
.pip-mute-btn {
  position: absolute;
  top: 6px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f1f5f9;
  border-radius: 6px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 15;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.pip-action-btn:hover {
  background: #00f2fe;
  color: #0b0f19;
  border-color: #00f2fe;
  transform: translateY(-1px) scale(1.12);
  box-shadow: 0 6px 14px rgba(0, 242, 254, 0.5);
}

.pip-action-btn:active {
  transform: scale(0.92);
}

.pip-mute-btn:hover {
  background: #ff3366;
  color: #fff;
  border-color: #ff3366;
  transform: translateY(-1px) scale(1.12);
  box-shadow: 0 6px 14px rgba(255, 51, 102, 0.5);
}

.pip-mute-btn:active {
  transform: scale(0.92);
}

/* Precise non-clipping button coordinates */
.pip-action-btn.btn-shape-cam,
.remote-pip-wrapper .pip-mute-btn {
  right: 6px !important;
  left: auto !important;
}

.pip-action-btn.btn-invert-cam {
  right: 34px !important;
  left: auto !important;
}

.pip-action-btn.btn-center-cam {
  right: 62px !important;
  left: auto !important;
}

.pip-label {
  position: absolute;
  bottom: 5px;
  left: 6px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  padding: 2px 7px;
  font-size: 0.65rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 600;
  transition: all 0.25s ease;
}

/* ==========================================
   CONTROLS TOOLBAR
   ========================================== */
.controls-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0.5rem 0 0.5rem;
  background: transparent;
  z-index: 4;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  width: 25%;
}

.toolbar-right {
  justify-content: flex-end;
}

.toolbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 50%;
}

.room-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

#current-room-display {
  color: var(--text-primary);
  font-weight: 600;
}

.control-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 68px;
  height: 58px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.control-btn span {
  font-size: 0.65rem;
  font-weight: 600;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.control-btn.active {
  background: var(--primary-glow);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

.control-btn.btn-accent {
  border-color: rgba(0, 242, 254, 0.3);
  color: hsl(180, 80%, 65%);
}

.control-btn.btn-accent:hover {
  background: rgba(0, 242, 254, 0.1);
  color: hsl(180, 85%, 75%);
}

/* ==========================================
   SIDE CHAT PANEL
   ========================================== */
.side-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.panel-tabs {
  padding: 1rem;
  border-bottom: 1px solid var(--panel-border);
}

.panel-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.1rem;
}

.chat-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.chat-bubble {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 15px;
  line-height: 1.4;
  font-size: 0.9rem;
}

.chat-bubble.local {
  align-self: flex-end;
  background: var(--primary-glow);
  color: #fff;
  border-bottom-right-radius: 2px;
}

.chat-bubble.remote {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  border-bottom-left-radius: 2px;
}

.bubble-meta {
  display: block;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.25rem;
  text-align: right;
}

.system-message {
  align-self: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  text-align: center;
  max-width: 95%;
}

.system-message span {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.chat-input-wrapper {
  display: flex;
  padding: 1rem;
  gap: 0.5rem;
  border-top: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, 0.1);
}

.chat-input-wrapper input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #fff;
  outline: none;
  font-size: 0.9rem;
}

.chat-input-wrapper input:focus {
  border-color: var(--primary-color);
}

.chat-input-wrapper button {
  padding: 0.75rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

/* ==========================================
   MODALS (GUIDE)
   ========================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(6, 8, 13, 0.8);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  max-width: 640px;
  width: 90%;
  padding: 2.25rem;
  border-color: rgba(0, 242, 254, 0.2);
  animation: modalPop 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes modalPop {
  from { transform: scale(0.95) translateY(15px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 0.75rem;
}

.modal-header h2 {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.close-btn:hover {
  color: #fff;
}

.modal-body {
  overflow-y: auto;
  max-height: 55vh;
  padding-right: 0.5rem;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}
.modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.modal-intro {
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.step-guide {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.step-guide h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
}

.step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step-num {
  background: var(--primary-glow);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.step-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.step-desc strong {
  color: #fff;
  display: block;
  margin-bottom: 0.25rem;
}

.browser-tabs-steps {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 0.2rem;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.browser-tab {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.browser-tab:hover {
  color: #fff;
}

.browser-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.browser-instruction-content {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 1.25rem;
  animation: fadeInTab 0.3s ease-out;
}

.browser-instruction-content ol {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.browser-instruction-content li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.browser-instruction-content li strong {
  color: #fff;
}

.url-code {
  background: rgba(255, 255, 255, 0.08);
  color: hsl(180, 80%, 70%);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85rem;
}

.note-box {
  border-left: 3px solid var(--accent-color);
  background: rgba(0, 242, 254, 0.03);
  padding: 1rem;
  border-radius: 0 8px 8px 0;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.note-box strong {
  color: #fff;
}

.modal-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--panel-border);
  display: flex;
  justify-content: flex-end;
}

/* ==========================================
   UTILITY CLASSES & MEDIA QUERIES
   ========================================== */
.hidden {
  display: none !important;
}

@media (max-width: 1024px) {
  .meeting-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 280px;
    height: auto;
    min-height: calc(100vh - 120px);
  }
  
  .app-container {
    padding: 0 1.5rem 1.5rem 1.5rem;
  }
}

@media (max-width: 768px) {
  header {
    padding: 1rem 1.5rem;
  }
  
  .controls-toolbar {
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .toolbar-left, .toolbar-right {
    width: auto;
  }
  
  .toolbar-center {
    width: 100%;
    order: 3;
  }
}

/* ==========================================
   CINEMATIC AMBIENT GLOW
   ========================================== */
.glow-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  filter: blur(80px) saturate(180%);
  opacity: 0.65;
  transform: scale(1.06);
  mix-blend-mode: screen;
}

/* Ensure video sits above canvas but below overlays */
#screenshare-video {
  position: relative;
  z-index: 1;
}

/* ==========================================
   VIDEO PLAYER CUSTOM CONTROLS OVERLAY
   ========================================== */
.video-wrapper:hover .player-controls-bar {
  opacity: 1;
  transform: translateY(0);
}

.player-controls-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(8, 10, 16, 0.9) 0%, rgba(8, 10, 16, 0.4) 60%, transparent 100%);
  padding: 2rem 1.25rem 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 6;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
}

.player-control-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: var(--transition);
}

.player-control-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.player-control-btn.active {
  color: var(--primary-hover);
  background: rgba(255, 255, 255, 0.05);
}

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

.volume-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.volume-control input[type="range"] {
  -webkit-appearance: none;
  width: 80px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.volume-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: var(--transition);
}

.volume-control input[type="range"]:hover::-webkit-slider-thumb {
  background: var(--primary-color);
  box-shadow: 0 0 8px var(--primary-color);
}

.player-stats-pill {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--panel-border);
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--text-secondary);
}

/* ==========================================
   DRAGGABLE WEBCAM PIP WINDOWS
   ========================================== */
.pip-video-wrapper[draggable="true"] {
  cursor: grab;
  user-select: none;
}

.pip-video-wrapper[draggable="true"]:active {
  cursor: grabbing;
}

/* ==========================================
   EMOJI REACTIONS PANEL
   ========================================== */
.reactions-container {
  display: flex;
  justify-content: space-around;
  padding: 0.65rem 1rem;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid var(--panel-border);
  gap: 0.25rem;
}

.btn-reaction {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-reaction:hover {
  transform: scale(1.35) rotate(5deg);
}

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

/* Floating Animating Emoji Element */
.floating-emoji {
  position: absolute;
  pointer-events: none;
  font-size: 2rem;
  z-index: 10;
  animation: floatUpAndWiggle 2.5s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
}

@keyframes floatUpAndWiggle {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.5) rotate(0deg);
  }
  15% {
    opacity: 1;
    transform: translateY(-20px) scale(1.1) rotate(-5deg);
  }
  50% {
    transform: translateY(-120px) scale(1) rotate(5deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-250px) scale(0.8) rotate(-10deg);
  }
}

/* ==========================================
   DEVELOPER FOOTER
   ========================================== */
.app-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  width: 100%;
  margin-top: auto;
  z-index: 5;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.footer-love-btn {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.86rem;
  font-weight: 500;
}

.footer-love-btn:hover {
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 51, 102, 0.6);
  transform: scale(1.03);
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.8rem;
  color: #64748b;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #00f2fe;
}

.footer-links .sep {
  color: #475569;
}

.app-footer .heart {
  color: hsl(355, 85%, 60%);
  display: inline-block;
  animation: heartBeat 1.2s infinite alternate cubic-bezier(0.215, 0.610, 0.355, 1);
}

@keyframes heartBeat {
  0% { transform: scale(1); }
  100% { transform: scale(1.25); }
}

/* ==========================================
   STREAM URL INPUT BAR
   ========================================== */
.stream-url-bar {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: rgba(18, 22, 35, 0.85);
  border-bottom: 1px solid var(--panel-border);
  width: 100%;
  align-items: center;
  z-index: 12;
  border-radius: 12px 12px 0 0;
  margin-bottom: 0.5rem;
}

.stream-url-bar input[type="text"] {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
}

.stream-url-bar input[type="text"]:focus {
  border-color: var(--primary-color);
}

.stream-url-bar .btn {
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  border-radius: 8px;
}

#direct-media-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

/* Floating Click to Unmute Banner */
.unmute-banner {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(229, 9, 20, 0.95); /* Sleek Red Accent matching premium aesthetics */
  color: #fff;
  padding: 10px 20px;
  border-radius: 30px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(229, 9, 20, 0.4);
  cursor: pointer;
  pointer-events: auto;
  animation: bounceUnmute 2s infinite ease-in-out;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.unmute-banner.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -15px);
}

@keyframes bounceUnmute {
  0%, 100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, -6px);
  }
}

/* ==========================================
   FULLSCREEN CHAT OVERLAY & RESPONSIVENESS
   ========================================== */
.fullscreen-chat-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  background: rgba(10, 12, 18, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  z-index: 10;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
}

.fullscreen-chat-overlay.hidden {
  display: none !important;
}

.fullscreen-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.fullscreen-chat-header h3 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
}

.fullscreen-chat-header .close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.5rem;
  transition: var(--transition);
}

.fullscreen-chat-header .close-btn:hover {
  color: #fff;
  transform: scale(1.1);
}

.fullscreen-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fullscreen-chat-messages::-webkit-scrollbar {
  width: 4px;
}

.fullscreen-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
}

.fullscreen-chat-input-wrapper {
  display: flex;
  padding: 0.75rem 1rem;
  gap: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.fullscreen-chat-input-wrapper input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  color: #fff;
  outline: none;
  font-size: 0.85rem;
  font-family: var(--font-body);
}

.fullscreen-chat-input-wrapper input:focus {
  border-color: var(--primary-color);
}

.fullscreen-chat-input-wrapper button {
  padding: 0.5rem;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

/* Offset PIP Camera Container when Watch Party Chat is Open */
.video-wrapper.chat-open .pip-container {
  right: 340px;
  transition: right 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Offset Player Controls Bar when Watch Party Chat is Open */
.video-wrapper.chat-open .player-controls-bar {
  width: calc(100% - 320px);
  transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease, transform 0.3s ease;
}

.chat-unread-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: #ff3366;
  border-radius: 50%;
  box-shadow: 0 0 6px #ff3366;
}

/* ==========================================
   FULLSCREEN TRANSPARENT MESSAGE TOAST (SIDE TOP)
   ========================================== */
.fullscreen-chat-toast {
  position: absolute;
  top: 24px;
  left: 24px;
  max-width: 380px;
  background: rgba(15, 17, 23, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 15;
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  animation: slideToastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.fullscreen-chat-toast.toast-fade-out {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}

.toast-avatar {
  font-size: 1.3rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.toast-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.toast-sender {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-color, #00f2fe);
}

.toast-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

@keyframes slideToastIn {
  from {
    opacity: 0;
    transform: translateY(-15px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================
   STREAM CONTROLS (10s SKIP, PLAY/PAUSE, RIPPLE)
   ========================================== */
.btn-skip-10 {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-family: var(--font-title);
}

.skip-pill-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.player-feedback-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 17, 23, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 40px;
  padding: 12px 26px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 700;
  z-index: 12;
  pointer-events: none;
  animation: feedbackPop 0.8s ease-out forwards;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

@keyframes feedbackPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
  75% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
}



