/* =====================================================
   THEME VARIABLES
===================================================== */
html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}


:root {
  /* Dark Glassmorphic Theme */
  --bg: #09090b;
  --panel-raw: 24, 24, 27; /* rgb values for glass effect */
  --panel: rgba(var(--panel-raw), 0.65);
  --panel-2: rgba(var(--panel-raw), 0.85);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --accent: #8b5cf6;
  --accent-hover: #a78bfa;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --blur: blur(16px);
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

body.light {
  --bg: #f8fafc;
  --panel-raw: 255, 255, 255;
  --panel: rgba(var(--panel-raw), 0.75);
  --panel-2: rgba(var(--panel-raw), 0.95);
  --text: #0f172a;
  --muted: #64748b;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --border: rgba(0, 0, 0, 0.1);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* =====================================================
   BASE
===================================================== */

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  transition: background 0.4s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* =====================================================
   BACKGROUND THEMES
===================================================== */

body.bg-default {
  background: var(--bg);
}

body.bg-gradient {
  background: radial-gradient(circle at top left, #1e293b, #0f172a);
}

body.bg-purple {
  background: radial-gradient(circle at top, #312e81, #0f172a);
}

body.bg-sunset {
  background: radial-gradient(circle at top, #7c2d12, #1e1b4b);
}

body.bg-green {
  background: radial-gradient(circle at top, #064e3b, #0f172a);
}

/* =====================================================
   BUTTONS
===================================================== */

button {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  font-family: var(--font-body);
}

button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.primary-btn {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
  transition: all 0.3s ease;
}
.primary-btn:hover {
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6);
  transform: translateY(-2px) scale(1.02);
}

/* =====================================================
   INPUTS
===================================================== */

input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  width: 100%;
  font-family: var(--font-body);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

input::placeholder {
  color: var(--muted);
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

/* =====================================================
   DISCORD ROOM LAYOUT
===================================================== */

.discord-room {
  display: grid;
  grid-template-columns: 260px 1fr 340px;
  height: 100vh;
  transition: grid-template-columns 0.4s ease;
}

.discord-room.zen-mode {
  grid-template-columns: 0px 1fr 0px;
}

.discord-room.zen-mode .participants-panel,
.discord-room.zen-mode .chat-panel {
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

/* ================= PARTICIPANTS ================= */

.participants-panel {
  background: var(--panel);
  padding: 20px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

#participants-list {
  list-style: none;
  padding: 0;
  margin-top: 15px;
}

#participants-list li {
  padding: 8px 0;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dropdown {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
}

.status-dropdown:focus {
  border-color: var(--accent);
}

/* ================= MUSIC PANEL (DRAGGABLE) ================= */

.music-panel {
  position: fixed;
  top: 150px;
  left: 100px;
  width: 320px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  border-radius: 16px;
  z-index: 2000;
  padding: 24px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.music-panel.active {
  opacity: 1;
  visibility: visible;
}

.music-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  cursor: grab;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}

.music-header:active {
  cursor: grabbing;
}

.music-header h3 {
  margin: 0;
  flex: 1;
  text-align: center;
  pointer-events: none;
}

.music-controls {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.playback-btns {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.playback-btns button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: var(--panel-2);
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: 0.2s;
}

.playback-btns button:hover {
  background: var(--accent);
  transform: scale(1.05);
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.volume-control input[type=range] {
  flex: 1;
  accent-color: var(--accent);
}

/* ================= SCREEN SHARE PANEL ================= */

.screenshare-panel {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 640px;
  height: 400px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
  border-radius: 12px;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  overflow: hidden;
}

.screenshare-panel.active {
  opacity: 1;
  visibility: visible;
}

.screenshare-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
  cursor: grab;
  user-select: none;
}

.screenshare-header:active {
  cursor: grabbing;
}

.screenshare-header h3 {
  margin: 0;
  flex: 1;
  text-align: center;
  font-size: 1rem;
  pointer-events: none;
}

.screenshare-content {
  flex: 1;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#screenshare-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* NO scaleX(-1) here to prevent mirroring/upside down issues */
}

.resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  cursor: se-resize;
  color: var(--muted);
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  background: rgba(0, 0, 0, 0.2);
  border-top-left-radius: 8px;
}

/* ================= GOALS PANEL (DRAGGABLE) ================= */

.goals-panel {
  position: fixed;
  top: 100px;
  /* Default starting position */
  left: 100px;
  width: 320px;
  max-height: 70vh;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  border-radius: 16px;
  z-index: 2000;
  /* Extremely high z-index to stay above videos/chat */
  padding: 24px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.goals-panel.active {
  opacity: 1;
  visibility: visible;
}

.goals-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  cursor: grab;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}

.goals-header:active {
  cursor: grabbing;
}

.drag-handle {
  color: var(--muted);
  font-size: 1.2rem;
  user-select: none;
  cursor: grab;
}

.goals-header h3 {
  margin: 0;
  flex: 1;
  text-align: center;
  pointer-events: none;
  /* Let clicks pass through to drag handler */
}

.goals-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  background: var(--panel-2);
  padding: 4px;
  border-radius: 12px;
}

.tab-btn {
  flex: 1;
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
  font-weight: 500;
}

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

.goals-tab-content {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.goals-tab-content.active {
  display: flex;
}

.input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
}

.input-row input {
  flex: 1;
}

.input-row button {
  background: var(--accent);
  color: white;
  border: none;
  width: 40px;
  border-radius: 8px;
  cursor: pointer;
}

.goals-list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
}

.goal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--panel-2);
  border-radius: 8px;
  margin-bottom: 8px;
  word-break: break-all;
}

.goal-item.checked {
  opacity: 0.6;
}

.goal-item.checked span {
  text-decoration: line-through;
}

.goal-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--accent);
}

.goal-delete {
  margin-left: auto;
  background: transparent !important;
  color: var(--muted) !important;
  border: none;
  cursor: pointer;
}

.goal-delete:hover {
  color: #ff5c5c !important;
  transform: scale(1.1);
}

/* ================= INVITE BOX ================= */

.invite-box {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
  display: flex !important;
  /* Force flex when visible */
  align-items: center;
  justify-content: center;
  width: fit-content;
}

.invite-box input {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: monospace;
  font-size: 0.95rem;
  width: 280px;
  outline: none;
  opacity: 0.8;
}

.invite-box button {
  padding: 8px 20px;
  border-radius: 30px;
  background: linear-gradient(135deg, var(--accent), #5693ff);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.invite-box button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(23, 110, 230, 0.4);
}

/* ================= STAGE ================= */

.stage-area {
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 8px;
  overflow: hidden;
  height: 100%;
  box-sizing: border-box;
}

.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.room-pill {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 6px 16px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: var(--shadow);
  color: var(--text);
  white-space: nowrap;
}
.room-pill.private {
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.4);
}
.room-pill.public {
  box-shadow: 0 4px 15px rgba(96, 165, 250, 0.2);
  border-color: rgba(96, 165, 250, 0.4);
}

/* ================= VIDEO GRID ================= */

.video-grid {
  flex: 1;
  display: grid;
  gap: 10px;
  padding: 16px;
  align-content: center;
  justify-content: center;
  overflow-y: auto;
  transition: 0.3s ease;
  /* JS will set grid-template-columns dynamically */
}

/* Single user - centered */
.video-grid.single {
  align-content: center;
  justify-content: center;
}

/* Multiple users */
.video-grid.multiple {
  align-content: center;
}

/* Each tile - always 16/9, fills grid column width */
.video-grid .video-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: #1a1a2e;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
  transition: box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.video-wrapper.active-speaker {
  box-shadow: 0 0 25px 5px var(--accent);
  transform: scale(1.02);
  z-index: 50;
}
.video-grid .video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
}
.video-wrapper .avatar-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel);
  z-index: 5;
  display: block;
}
.name-label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  z-index: 20;
  pointer-events: none;
  max-width: calc(100% - 24px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mute-icon-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.7);
  padding: 8px;
  border-radius: 50%;
  font-size: 1.2rem;
  z-index: 10;
  color: #ef4444; /* Explicitly red for clarity */
}

/* =====================================================
   CHAT PANEL
===================================================== */

.chat-panel {
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 15px;
  box-sizing: border-box;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding-right: 5px;
  margin-bottom: 8px;
}

.msg {
  margin-bottom: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--panel-2);
}

.msg.own {
  background: rgba(88, 101, 242, 0.2);
}

.msg.mentioned-msg {
  background: var(--panel-2);
  border: 1px solid var(--accent);
  box-shadow: 0 0 10px rgba(88, 101, 242, 0.3);
}

.mention-tag {
  color: #fff;
  background: var(--accent);
  padding: 0 4px;
  border-radius: 4px;
  font-weight: bold;
}

.mention-popup {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: 150px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
  margin-bottom: 8px;
}

.mention-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.mention-item:hover,
.mention-item.selected {
  background: var(--panel-2);
}

.chat-input-wrapper {
  margin-top: auto;
}

/* =====================================================
   FLOATING CONTROLS
===================================================== */

.floating-controls {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  display: flex;
  gap: 15px;
  padding: 12px 20px;
  border-radius: 50px;
  box-shadow: var(--shadow);
  align-items: center;
  z-index: 200;
}

.floating-controls button {
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1rem;
}

/* =====================================================
   DASHBOARD
===================================================== */

.dashboard-page {
  min-height: 100vh;
}

.dashboard-header-modern {
  height: 70px;
  padding: 0 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

body.light .dashboard-header-modern {
  background: rgba(255, 255, 255, 0.6);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.dashboard-modern {
  padding: 40px;
  max-width: 1200px;
  margin: auto;
}

.dashboard-welcome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

#welcome-text {
  font-size: 2.2rem;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

body.light #welcome-text {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.rooms-section {
  background: var(--panel);
  padding: 30px;
  border-radius: 18px;
}

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.room-item {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 0.5s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

body.light .room-item {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.room-item:hover {
  background: var(--panel-2);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.25);
  transform: translateY(-4px) scale(1.03);
}

body.light .room-item:hover {
  background: var(--panel-2);
}

/* Animations Core */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bg-gradient-modern {
  background-image: radial-gradient(circle at top right, rgba(124, 58, 237, 0.15), transparent 40%),
                    radial-gradient(circle at bottom left, rgba(37, 99, 235, 0.15), transparent 40%);
  background-attachment: fixed;
}

/* =====================================================
   PROFILE DRAWER
===================================================== */

/* ================= PROFILE DRAWER MODERN ================= */

.profile-drawer {
  width: 380px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-header h3 {
  margin: 0;
}

.close-btn {
  cursor: pointer;
  font-size: 18px;
  opacity: 0.7;
  transition: 0.2s ease;
}

.close-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.profile-avatar-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.profile-avatar-img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  z-index: 2;
}

.avatar-ring {
  position: absolute;
  width: 125px;
  height: 125px;
  border-radius: 50%;
  background: linear-gradient(45deg, #7c3aed, #2563eb);
  z-index: 1;
  filter: blur(18px);
  opacity: 0.5;
}

.profile-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-section label {
  font-size: 13px;
  color: var(--muted);
}

.profile-section input,
.profile-section select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  transition: 0.2s ease;
}

.profile-section input:focus,
.profile-section select:focus {
  outline: none;
  border-color: var(--accent);
}

.save-profile-btn {
  margin-top: 15px;
  background: linear-gradient(45deg, #7c3aed, #2563eb);
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s ease;
}

.save-profile-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
}


/* =====================================================
   BACKGROUND SELECTOR PANEL
===================================================== */

.bg-panel {
  position: fixed;
  bottom: 100px;
  right: 30px;
  background: var(--panel);
  padding: 18px;
  border-radius: 18px;
  display: none;
  gap: 12px;
  flex-wrap: wrap;
  width: 230px;

  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);

  backdrop-filter: blur(12px);
  z-index: 1000;
}

.bg-panel.active {
  display: flex;
}

/* Swatch */
.bg-option {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.bg-option:hover {
  transform: scale(1.1);
  border: 2px solid var(--accent);
}

/* Preview styles */
.bg-option.bg-default {
  background: #0f172a;
}

.bg-option.bg-gradient {
  background: linear-gradient(135deg, #1e293b, #0f172a);
}

.bg-option.bg-purple {
  background: linear-gradient(135deg, #312e81, #0f172a);
}

.bg-option.bg-sunset {
  background: linear-gradient(135deg, #7c2d12, #1e1b4b);
}

.bg-option.bg-green {
  background: linear-gradient(135deg, #064e3b, #0f172a);
}


/* =====================================================
   Avatar styles
===================================================== */

.video-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  border-radius: 16px;
  padding: 30px;
  width: 100%;
  max-width: 480px;
  height: 280px;
}

.avatar-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  color: white;
  margin-bottom: 10px;
}

.video-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.avatar-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #5865f2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: bold;
  color: white;
}

/* ================= MODERN LOGIN ================= */

.auth-modern {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: Inter, sans-serif;
}

.auth-wrapper-modern {
  width: 1000px;
  max-width: 95%;
  display: grid;
  grid-template-columns: 1fr 460px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 50px 120px rgba(0, 0, 0, 0.6);
}

/* Left Branding */
.auth-brand-modern {
  background: linear-gradient(135deg, #5865f2, #7c3aed);
  padding: 70px 60px;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-brand-modern h1 {
  font-size: 2.6rem;
  margin-bottom: 15px;
}

.auth-brand-modern p {
  opacity: 0.9;
  margin-bottom: 30px;
}

.feature-list div {
  margin-bottom: 12px;
  font-size: 0.95rem;
  opacity: 0.95;
}

/* Right Card */
.auth-card-modern {
  background: #1a1b1f;
  padding: 70px 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-card-modern h2 {
  margin-bottom: 8px;
}

.google-wrapper {
  margin-top: 25px;
}

.login-footer {
  margin-top: 30px;
  font-size: 0.8rem;
  opacity: 0.6;
  text-align: center;
}

/* Responsive */
@media (max-width: 900px) {
  .auth-wrapper-modern {
    grid-template-columns: 1fr;
  }

  .auth-brand-modern {
    display: none;
  }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* User chip */
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-2);
  padding: 6px 14px;
  border-radius: 40px;
  cursor: pointer;
  transition: 0.2s ease;
}

.user-chip:hover {
  background: var(--accent);
  color: white;
}

.chip-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.chip-info {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  line-height: 1.1;
}

/* Logout */
.danger-btn {
  background: #2a2a2f;
  color: #ff5c5c;
  border-radius: 30px;
  padding: 8px 18px;
  font-weight: 500;
  transition: 0.2s ease;
}

.danger-btn:hover {
  background: #ff5c5c;
  color: white;
}

/* ================= PROFILE OVERLAY ================= */

.profile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s ease;
  z-index: 999;
}

.profile-overlay.active {
  opacity: 1;
  visibility: visible;
}


/* ================= PROFILE DRAWER ================= */

.profile-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 380px;
  height: 100vh;
  background: #111827;
  padding: 40px 30px;
  transition: 0.35s ease;
  z-index: 1000;
  box-shadow: -15px 0 40px rgba(0, 0, 0, 0.6);
  overflow-y: auto;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-drawer.active {
  right: 0;
}


/* ================= PROFILE HEADER ================= */

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.profile-header h3 {
  margin: 0;
}

.profile-close {
  cursor: pointer;
  font-size: 22px;
  opacity: 0.7;
  transition: 0.2s ease;
}

.profile-close:hover {
  opacity: 1;
}

/* ================= PROFILE CONTENT ================= */

.profile-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Avatar */
.profile-avatar {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.profile-avatar img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #8b5cf6;
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.6);
}

/* Inputs */
.profile-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-section label {
  font-size: 13px;
  color: var(--muted);
}

.profile-input {
  background: #1f2937;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px;
  border-radius: 10px;
  color: white;
  transition: 0.2s ease;
}

.profile-input:focus {
  outline: none;
  border-color: #8b5cf6;
}

/* Save Button */
.save-profile-btn {
  margin-top: 10px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s ease;
}

.save-profile-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(139, 92, 246, 0.4);
}


/* ================= MODAL SYSTEM ================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s ease;
  z-index: 999;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: var(--panel);
  padding: 30px;
  width: 400px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: 0.25s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-card.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.room-type-toggle {
  display: flex;
  gap: 10px;
}

.toggle {
  flex: 1;
  border-radius: 8px;
}

.toggle.active {
  background: var(--accent);
  color: white;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

#timer[data-phase="focus"] {
  color: #22c55e;
  text-shadow: 0 0 15px rgba(34, 197, 94, 0.6);
  font-weight: 700;
  transform: scale(1.05);
  transition: all 0.3s ease;
}

#timer[data-phase="break"] {
  color: #f97316;
  text-shadow: 0 0 15px rgba(249, 115, 22, 0.6);
  font-weight: 700;
  transform: scale(1.05);
  transition: all 0.3s ease;
}

/* ======================================================
   PHASE TOAST NOTIFICATION
======================================================= */

.toast {
  position: fixed;
  top: 20px;
  right: -300px;
  background: var(--panel);
  border-left: 5px solid var(--accent);
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2000;
  transition: right 0.3s ease;
}

.toast.show {
  right: 20px;
}

#toast-icon {
  font-size: 1.5rem;
}

#toast-message {
  font-weight: 500;
  color: var(--text);
}