/* ===== CAMFROG STYLE - Authentic Redesign ===== */
@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --cf-green: #4CAF50;
  --cf-green-dark: #388E3C;
  --cf-green-light: #66BB6A;
  --cf-green-gradient: linear-gradient(180deg, #5CB85C, #4CAF50);
  --cf-green-header: linear-gradient(180deg, #4DB44D, #3E9E3E);
  --cf-white: #ffffff;
  --cf-bg: #f0f0f0;
  --cf-bg-light: #f8f8f8;
  --cf-bg-sidebar: #ffffff;
  --cf-border: #d4d4d4;
  --cf-border-light: #e8e8e8;
  --cf-text: #333333;
  --cf-text-secondary: #666666;
  --cf-text-muted: #999999;
  --cf-text-link: #1a73e8;
  --cf-orange: #FF9800;
  --cf-orange-dark: #F57C00;
  --cf-red: #F44336;
  --cf-blue: #2196F3;
  --cf-yellow: #FFC107;
  --cf-online: #4CAF50;
  --cf-offline: #9E9E9E;
  --cf-header-height: 32px;
  --cf-tab-height: 28px;
  --cf-toolbar-height: 36px;
  --cf-sidebar-width: 280px;
  --cf-bottom-height: 40px;
  --cf-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.1);
  --cf-shadow-popup: 0 4px 20px rgba(0, 0, 0, 0.25);
  --radius: 3px;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Segoe UI', 'Inter', Tahoma, sans-serif;
  background: var(--cf-bg);
  color: var(--cf-text);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--cf-text-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: 13px;
  outline: none;
  border: 1px solid var(--cf-border);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95)
  }

  to {
    opacity: 1;
    transform: scale(1)
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0.5
  }
}

@keyframes bounce {

  0%,
  20%,
  53%,
  80%,
  100% {
    transform: translateY(0)
  }

  40% {
    transform: translateY(-6px)
  }

  60% {
    transform: translateY(-3px)
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

@keyframes glow {

  0%,
  100% {
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.3)
  }

  50% {
    box-shadow: 0 0 12px rgba(76, 175, 80, 0.6)
  }
}

@keyframes camPopIn {
  from {
    opacity: 0;
    transform: scale(0.8)
  }

  to {
    opacity: 1;
    transform: scale(1)
  }
}

#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== AUTH ===== */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 30%, #a5d6a7 60%, #81c784 100%);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 36px 32px;
  background: var(--cf-white);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  animation: fadeInScale 0.4s ease;
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--cf-green-dark);
}

.auth-logo p {
  color: var(--cf-text-secondary);
  font-size: 13px;
  margin-top: 4px;
}

.auth-form .form-group {
  margin-bottom: 16px;
}

.auth-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--cf-text-secondary);
  margin-bottom: 4px;
}

.auth-form input {
  width: 100%;
  padding: 10px 12px;
  background: var(--cf-white);
  border: 1px solid var(--cf-border);
  border-radius: var(--radius);
  color: var(--cf-text);
  font-size: 13px;
  transition: border-color 0.2s;
}

.auth-form input:focus {
  border-color: var(--cf-green);
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.15);
}

.auth-form input::placeholder {
  color: var(--cf-text-muted);
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--cf-text-secondary);
}

.auth-footer a {
  font-weight: 600;
  color: var(--cf-green-dark);
}

.auth-error {
  background: rgba(244, 67, 54, 0.08);
  border: 1px solid rgba(244, 67, 54, 0.2);
  color: #c62828;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  margin-bottom: 14px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.btn-primary {
  background: var(--cf-green);
  color: white;
}

.btn-primary:hover {
  background: var(--cf-green-dark);
}

.btn-full {
  width: 100%;
  padding: 11px 16px;
}

.btn-secondary {
  background: #e0e0e0;
  color: var(--cf-text);
}

.btn-secondary:hover {
  background: #d0d0d0;
}

.btn-danger {
  background: var(--cf-red);
  color: white;
}

.btn-success {
  background: var(--cf-green);
  color: white;
}

.btn-icon {
  padding: 4px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--cf-text-secondary);
}

.btn-icon:hover {
  background: rgba(0, 0, 0, 0.06);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

/* ===== CAMFROG HEADER (Title bar) ===== */
.app-header {
  height: 30px;
  min-height: 30px;
  background: var(--cf-green-header);
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 0;
  z-index: 100;
  color: white;
  user-select: none;
}

.header-tabs {
  display: flex;
  gap: 0;
  height: 100%;
}

.header-tab {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  height: 100%;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  position: relative;
}

.header-tab:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.header-tab.active {
  color: white;
  background: rgba(255, 255, 255, 0.15);
  border-bottom-color: white;
}

.header-tab .tab-icon {
  font-size: 13px;
}

.header-tab .tab-close {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-left: 4px;
}

.header-tab .tab-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.header-spacer {
  flex: 1;
}

.header-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  text-align: right;
  padding: 0 8px;
}

.header-time .time-label {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.5);
}

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

.header-action-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.header-action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.header-action-btn .badge {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 14px;
  height: 14px;
  background: var(--cf-red);
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.5);
  transition: all 0.15s;
}

.user-avatar-btn:hover {
  border-color: white;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ===== LOBBY ===== */
.lobby-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--cf-bg);
}

.lobby-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--cf-white);
  border-bottom: 1px solid var(--cf-border);
}

.lobby-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.lobby-search input {
  width: 100%;
  padding: 6px 10px 6px 28px;
  background: var(--cf-white);
  border: 1px solid var(--cf-border);
  border-radius: var(--radius);
  color: var(--cf-text);
}

.lobby-search input:focus {
  border-color: var(--cf-green);
}

.lobby-search .search-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cf-text-muted);
  font-size: 12px;
}

.lobby-nav {
  display: flex;
  gap: 2px;
}

.lobby-nav-btn {
  padding: 5px 14px;
  background: transparent;
  color: var(--cf-text-secondary);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.lobby-nav-btn:hover {
  background: rgba(76, 175, 80, 0.08);
  color: var(--cf-green-dark);
}

.lobby-nav-btn.active {
  background: rgba(76, 175, 80, 0.12);
  color: var(--cf-green-dark);
}

.lobby-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* Banners */
.lobby-banners {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.banner-card {
  min-width: 140px;
  height: 72px;
  border-radius: 6px;
  padding: 14px;
  color: white;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: flex-end;
  position: relative;
  overflow: hidden;
}

.banner-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--cf-shadow-popup);
}

.banner-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.25) 100%);
}

.banner-card span {
  position: relative;
  z-index: 1;
}

.banner-manage {
  background: linear-gradient(135deg, #4CAF50, #66BB6A);
}

.banner-promote {
  background: linear-gradient(135deg, #F44336, #EF5350);
}

.banner-upgrade {
  background: linear-gradient(135deg, #FF9800, #FFB74D);
}

.banner-gift {
  background: linear-gradient(135deg, #9C27B0, #BA68C8);
}

.banner-coins {
  background: linear-gradient(135deg, #FFC107, #FFD54F);
}

/* Room Section */
.room-section {
  margin-bottom: 24px;
}

.room-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.room-section-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--cf-text);
}

.room-section-header .see-all {
  font-size: 12px;
  font-weight: 600;
  color: var(--cf-green-dark);
  cursor: pointer;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

/* Room Card */
.room-card {
  background: var(--cf-white);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--cf-border-light);
}

.room-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--cf-shadow-popup);
  border-color: var(--cf-green);
}

.room-card-thumbnail {
  width: 100%;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.room-card-thumbnail .room-initial {
  width: 50px;
  height: 50px;
  background: var(--cf-green-gradient);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: white;
}

/* HEART BUTTON STYLE */
.room-heart {
  position: absolute;
  top: 8px;
  left: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 20px;
  z-index: 10;
  transition: all 0.2s;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.room-heart:hover {
  transform: scale(1.2);
  color: #fff;
}

.room-heart.following {
  color: #ff4d4d !important;
}

/* GROUP HEADER STYLE */
.cf-group-header {
  padding: 12px 15px 6px;
  font-size: 10px;
  font-weight: 800;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  background: #f1f3f5;
  border-bottom: 1px solid #e9ecef;
}

.room-card-thumbnail .room-badges {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  gap: 3px;
}

.room-badge {
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  background: var(--cf-green);
  color: white;
}

.room-badge.plus {
  background: var(--cf-orange);
}

.room-badge.age {
  background: var(--cf-red);
}

.room-card-thumbnail .visit-count {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  color: white;
  background: rgba(0, 0, 0, 0.5);
  padding: 1px 6px;
  border-radius: 8px;
}

.room-card-thumbnail .room-fav {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  cursor: pointer;
}

.room-card-thumbnail .room-fav:hover {
  background: rgba(244, 67, 54, 0.5);
}

.room-card-thumbnail .room-fav.active {
  color: var(--cf-red);
}

.room-card-info {
  padding: 8px 10px;
}

.room-card-info h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--cf-text);
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-card-info .room-language {
  font-size: 11px;
  color: var(--cf-text-muted);
  margin-bottom: 4px;
}

.room-card-stats {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--cf-text-secondary);
}

.room-card-stats .stat {
  display: flex;
  align-items: center;
  gap: 3px;
}

.room-card-stats .stat .online-dot {
  width: 6px;
  height: 6px;
  background: var(--cf-online);
  border-radius: 50%;
}

/* ===== CHAT ROOM VIEW (Camfrog Style) ===== */
.room-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--cf-bg);
}

.room-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: var(--cf-white);
  border-bottom: 1px solid var(--cf-border);
}

.room-header-info {
  flex: 1;
}

.room-header-info h2 {
  font-size: 13px;
  font-weight: 700;
}

.room-header-info .room-topic {
  font-size: 11px;
  color: var(--cf-text-secondary);
}

.room-header-actions {
  display: flex;
  gap: 2px;
}

.room-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

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

/* Gift bar */
.room-gift-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--cf-bg-light);
  border-bottom: 1px solid var(--cf-border-light);
  font-size: 11px;
  color: var(--cf-text-secondary);
}

.gift-link {
  padding: 2px 10px;
  background: var(--cf-orange);
  color: white;
  border-radius: 10px;
  font-weight: 600;
  font-size: 10px;
  cursor: pointer;
}

.gift-link:hover {
  background: var(--cf-orange-dark);
}

/* Rules banner */
.room-rules-banner {
  display: flex;
  justify-content: center;
  padding: 4px;
}

.room-rules-btn {
  padding: 4px 16px;
  background: var(--cf-green);
  color: white;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.room-rules-btn:hover {
  background: var(--cf-green-dark);
}

/* Video Grid (now hidden - we use popups) */
.video-grid {
  display: none;
}

.video-grid.has-videos {
  display: none;
}

/* Feed */
.feed-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--cf-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.feed-label .settings-icon {
  cursor: pointer;
  opacity: 0.5;
}

.feed-label .settings-icon:hover {
  opacity: 1;
}

/* Messages */
.room-message {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  animation: fadeInUp 0.15s ease;
}

.room-message .msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cf-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.room-message .msg-body {
  flex: 1;
  min-width: 0;
}

.room-message .msg-content {
  background: var(--cf-bg-light);
  padding: 5px 10px;
  border-radius: 2px 8px 8px 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--cf-text);
}

.room-message .msg-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 1px;
}

.room-message .msg-username {
  font-size: 12px;
  font-weight: 600;
  color: var(--cf-green-dark);
}

.room-message .msg-time {
  font-size: 10px;
  color: var(--cf-text-muted);
}

.room-message.system-message {
  justify-content: center;
}

.room-message.system-message .msg-content {
  background: rgba(76, 175, 80, 0.08);
  color: var(--cf-green-dark);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 10px;
  display: inline-block;
}

.date-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  color: var(--cf-text-muted);
  font-size: 11px;
}

.date-separator::before,
.date-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--cf-border-light);
}

/* Room Sidebar (Camfrog user list) */
.room-sidebar {
  width: var(--cf-sidebar-width);
  min-width: var(--cf-sidebar-width);
  flex-shrink: 0;
  background: var(--cf-white);
  border-left: 1px solid var(--cf-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.room-sidebar-header {
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--cf-border-light);
  background: var(--cf-bg-light);
}

.room-sidebar-header h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--cf-text-secondary);
}

.user-section {
  padding: 4px 0;
}

.user-section-header {
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 600;
  color: var(--cf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--cf-bg-light);
  border-bottom: 1px solid var(--cf-border-light);
}

.user-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.1s;
}

.user-item:hover {
  background: rgba(76, 175, 80, 0.06);
}

.user-item .user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cf-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  position: relative;
  flex-shrink: 0;
}

.user-info-rows {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: visible;
}

.user-item .user-name {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.mic-bar-container {
  display: flex;
  align-items: center;
  height: 12px;
  margin-top: 1px;
  width: 60px;
}

.mic-bar-container.hidden {
  display: none;
}

.mic-bar-container .mic-bar-track {
  flex: 1;
  height: 3px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.mic-bar-container .mic-bar-fill {
  height: 100%;
  background: #4CAF50;
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s ease;
  box-shadow: 0 0 4px rgba(76, 175, 80, 0.5);
}

.cam-status-icon {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}



.user-item .user-role-icon {
  font-size: 11px;
}

.user-item .status-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cf-online);
  border: 1.5px solid var(--cf-white);
  position: absolute;
  bottom: -1px;
  right: -1px;
}

/* Cam indicator on user item */
.user-item .cam-icon {
  font-size: 11px;
  color: var(--cf-green);
  margin-left: auto;
  cursor: pointer;
}

.user-item .cam-icon:hover {
  color: var(--cf-green-dark);
}

/* Bottom Bar (Camfrog style) */
.room-bottom-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--cf-bg-light);
  border-top: 1px solid var(--cf-border);
}

.talk-btn {
  padding: 5px 12px;
  background: var(--cf-green);
  color: white;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.talk-btn:hover {
  background: var(--cf-green-dark);
}

.talk-btn.talking {
  background: var(--cf-red);
  animation: glow 1.5s ease-in-out infinite;
}

.talk-btn .dropdown-arrow {
  font-size: 9px;
  margin-left: 2px;
  opacity: 0.7;
}

.room-bottom-controls {
  display: flex;
  gap: 2px;
}

.control-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: var(--radius);
  color: var(--cf-text-secondary);
  font-size: 14px;
  cursor: pointer;
}

.control-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--cf-text);
}

.control-btn.active {
  color: var(--cf-green);
}

.volume-slider {
  width: 80px;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: var(--cf-border);
  border-radius: 2px;
  cursor: pointer;
  border: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--cf-green);
  border-radius: 50%;
  cursor: pointer;
}

.chat-input-container {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.emoji-btn {
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.15s;
}

.emoji-btn:hover {
  transform: scale(1.15);
}

.chat-input {
  flex: 1;
  padding: 5px 10px;
  background: var(--cf-white);
  border: 1px solid var(--cf-border);
  border-radius: var(--radius);
  color: var(--cf-text);
  font-size: 12px;
}

.chat-input:focus {
  border-color: var(--cf-green);
}

.send-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cf-green);
  border-radius: var(--radius);
  color: white;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.send-btn:hover {
  background: var(--cf-green-dark);
}

/* ===== CAM POPUP WINDOWS (Draggable, like Camfrog) ===== */
.cam-popup {
  position: fixed;
  z-index: 500;
  background: #1a1a1a;
  border-radius: 4px;
  box-shadow: var(--cf-shadow-popup);
  overflow: hidden;
  animation: camPopIn 0.25s ease;
  min-width: 240px;
  min-height: 200px;
  resize: both;
  border: 1px solid #555;
}

.cam-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: #2a2a2a;
  cursor: move;
  user-select: none;
  border-bottom: 1px solid #444;
}

.cam-popup-title {
  color: #ddd;
  font-size: 11px;
  font-weight: 600;
}

.cam-popup-controls {
  display: flex;
  gap: 2px;
}

.cam-popup-btn {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 2px;
  color: #aaa;
  font-size: 12px;
  cursor: pointer;
}

.cam-popup-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.cam-popup-btn.close-btn:hover {
  background: rgba(244, 67, 54, 0.6);
  color: white;
}

.cam-popup-video {
  width: 100%;
  height: calc(100% - 52px);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cam-popup-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cam-popup-video .no-cam {
  color: #666;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.cam-popup-video .no-cam .cam-icon-large {
  font-size: 36px;
  opacity: 0.3;
}

.cam-popup-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 3px 8px;
  background: #2a2a2a;
  border-top: 1px solid #444;
}

.cam-popup-footer button {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3a3a3a;
  border-radius: 3px;
  color: #ccc;
  font-size: 12px;
  cursor: pointer;
}

.cam-popup-footer button:hover {
  background: #4a4a4a;
  color: white;
}

/* My own cam popup (special style) */
.cam-popup.my-cam .cam-popup-header {
  background: #2e4a2e;
}

.cam-popup.my-cam {
  border-color: var(--cf-green-dark);
}

/* ===== CONTACTS ===== */
.contacts-view {
  flex: 1;
  display: flex;
}

.contacts-sidebar {
  width: 250px;
  background: var(--cf-white);
  border-right: 1px solid var(--cf-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.contacts-header {
  padding: 10px;
  border-bottom: 1px solid var(--cf-border-light);
}

.contacts-header h2 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.contacts-search {
  width: 100%;
  padding: 7px 10px;
  background: var(--cf-white);
  border: 1px solid var(--cf-border);
  border-radius: var(--radius);
  color: var(--cf-text);
  font-size: 12px;
}

.contacts-tabs {
  display: flex;
  border-bottom: 1px solid var(--cf-border-light);
}

.contact-tab {
  flex: 1;
  padding: 7px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--cf-text-secondary);
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.contact-tab:hover {
  color: var(--cf-text);
}

.contact-tab.active {
  color: var(--cf-green-dark);
  border-bottom-color: var(--cf-green);
}

.contacts-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.1s;
}

.contact-item:hover {
  background: rgba(76, 175, 80, 0.05);
}

.contact-item.active {
  background: rgba(76, 175, 80, 0.08);
  border-right: 2px solid var(--cf-green);
}

.contact-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cf-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  position: relative;
  flex-shrink: 0;
}

.contact-avatar .status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--cf-white);
}

.contact-avatar .status-dot.online {
  background: var(--cf-online);
}

.contact-avatar .status-dot.offline {
  background: var(--cf-offline);
}

.contact-avatar .status-dot.away {
  background: var(--cf-yellow);
}

.contact-info {
  flex: 1;
  min-width: 0;
}

.contact-info .contact-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-info .contact-status {
  font-size: 11px;
  color: var(--cf-text-muted);
}

.contact-info .contact-last-msg {
  font-size: 11px;
  color: var(--cf-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.contact-meta .time {
  font-size: 10px;
  color: var(--cf-text-muted);
}

.contact-meta .unread-badge {
  width: 18px;
  height: 18px;
  background: var(--cf-green);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Messenger */
.messenger-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--cf-bg-light);
}

.messenger-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--cf-white);
  border-bottom: 1px solid var(--cf-border-light);
}

.messenger-header .user-info h3 {
  font-size: 14px;
  font-weight: 600;
}

.messenger-header .user-info p {
  font-size: 11px;
  color: var(--cf-text-secondary);
}

.messenger-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pm-message {
  display: flex;
  gap: 6px;
  max-width: 70%;
  animation: fadeInUp 0.15s ease;
}

.pm-message.sent {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.pm-message .pm-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cf-bg);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.pm-message .pm-bubble {
  padding: 7px 12px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.4;
  max-width: 100%;
  word-wrap: break-word;
}

.pm-message.received .pm-bubble {
  background: var(--cf-white);
  color: var(--cf-text);
  border: 1px solid var(--cf-border-light);
  border-bottom-left-radius: 2px;
}

.pm-message.sent .pm-bubble {
  background: var(--cf-green);
  color: white;
  border-bottom-right-radius: 2px;
}

.pm-message .pm-time {
  font-size: 9px;
  color: var(--cf-text-muted);
  margin-top: 2px;
  text-align: right;
}

.pm-message.sent .pm-time {
  text-align: left;
}

.messenger-input {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  background: var(--cf-white);
  border-top: 1px solid var(--cf-border-light);
  align-items: center;
}

.messenger-input input {
  flex: 1;
  padding: 8px 12px;
  background: var(--cf-bg-light);
  border: 1px solid var(--cf-border);
  border-radius: 16px;
  color: var(--cf-text);
  font-size: 13px;
}

.messenger-input input:focus {
  border-color: var(--cf-green);
}

.messenger-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: var(--cf-text-muted);
}

.messenger-empty .empty-icon {
  font-size: 48px;
  opacity: 0.2;
}

.messenger-empty h3 {
  font-size: 16px;
  font-weight: 600;
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: var(--cf-white);
  border-radius: 6px;
  border: 1px solid var(--cf-border);
  box-shadow: var(--cf-shadow-popup);
  width: 90%;
  max-width: 460px;
  max-height: 80vh;
  overflow: hidden;
  animation: fadeInScale 0.2s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--cf-border-light);
  background: var(--cf-bg-light);
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: var(--radius);
  color: var(--cf-text-secondary);
  font-size: 16px;
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.06);
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  max-height: 60vh;
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--cf-border-light);
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--cf-text-secondary);
  margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 10px;
  background: var(--cf-white);
  border: 1px solid var(--cf-border);
  border-radius: var(--radius);
  color: var(--cf-text);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--cf-green);
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.form-group select {
  cursor: pointer;
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

/* User dropdown */
.user-dropdown {
  position: absolute;
  top: 30px;
  right: 10px;
  width: 220px;
  background: var(--cf-white);
  border: 1px solid var(--cf-border);
  border-radius: 4px;
  box-shadow: var(--cf-shadow-popup);
  z-index: 200;
  animation: slideDown 0.15s ease;
  overflow: hidden;
}

.user-dropdown-header {
  padding: 12px;
  border-bottom: 1px solid var(--cf-border-light);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-dropdown-header .dropdown-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cf-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: white;
}

.user-dropdown-header h4 {
  font-size: 13px;
  font-weight: 600;
}

.user-dropdown-header p {
  font-size: 11px;
  color: var(--cf-text-muted);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--cf-text);
  font-size: 12px;
  cursor: pointer;
  width: 100%;
  background: transparent;
  text-align: left;
}

.user-dropdown-item:hover {
  background: rgba(76, 175, 80, 0.06);
}

.user-dropdown-item.danger {
  color: var(--cf-red);
}

.user-dropdown-item .item-icon {
  width: 18px;
  text-align: center;
  font-size: 13px;
}

/* ===== NOTIFICATIONS ===== */
.notification-toast {
  position: fixed;
  top: 40px;
  right: 16px;
  padding: 10px 16px;
  background: var(--cf-white);
  border: 1px solid var(--cf-border);
  border-radius: 4px;
  box-shadow: var(--cf-shadow-popup);
  z-index: 2000;
  animation: slideDown 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  max-width: 320px;
}

.notification-toast.success {
  border-left: 3px solid var(--cf-green);
}

.notification-toast.error {
  border-left: 3px solid var(--cf-red);
}

.notification-toast.info {
  border-left: 3px solid var(--cf-blue);
}

/* Loading */
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--cf-border);
  border-top-color: var(--cf-green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  color: var(--cf-text-secondary);
}

/* Responsive */
@media (max-width:768px) {
  .room-sidebar {
    display: none;
  }

  .contacts-sidebar {
    width: 100%;
  }

  .room-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

.hidden {
  display: none !important;
}

.visible {
  display: flex !important;
}

/* Tooltip */
[data-tooltip] {
  position: relative;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 8px;
  background: #333;
  color: white;
  font-size: 11px;
  border-radius: 3px;
  white-space: nowrap;
  z-index: 100;
}

/* Empty states */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  color: var(--cf-text-muted);
  gap: 8px;
}

.empty-state .empty-icon {
  font-size: 40px;
  opacity: 0.2;
}

.empty-state h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--cf-text-secondary);
}

.empty-state p {
  font-size: 12px;
}

/* Context menu */
.context-menu {
  position: fixed;
  min-width: 160px;
  background: var(--cf-white);
  border: 1px solid var(--cf-border);
  border-radius: 4px;
  box-shadow: var(--cf-shadow-popup);
  z-index: 500;
  overflow: hidden;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--cf-text);
  cursor: pointer;
}

.context-menu-item:hover {
  background: rgba(76, 175, 80, 0.06);
}

.context-menu-item.danger {
  color: var(--cf-red);
}

.context-menu-divider {
  height: 1px;
  background: var(--cf-border-light);
  margin: 2px 0;
}

/* ===================================================
   CAM GRID — Fixed 8-slot grid (Light Theme)
   =================================================== */

.room-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  background: #f5f5f5;
}

.cam-grid-section {
  background: #2c2c2c;
  border-bottom: 2px solid #1a1a1a;
  padding: 4px;
  flex-shrink: 0;
}

.cam-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
  height: 130px;
}

.cam-slot {
  position: relative;
  background: #1a1a1a;
  border: 1px solid #3a3a3a;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cam-slot:hover {
  border-color: #4CAF50;
}

.cam-slot.empty {
  border: 1px dashed #3a3a3a;
  cursor: default;
}

.cam-slot.empty:hover {
  border-color: #4a4a4a;
}

.cam-slot .slot-empty-label {
  font-size: 11px;
  color: #666;
  text-align: center;
  user-select: none;
}

.cam-slot video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.cam-slot .slot-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2px 4px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.cam-slot.my-slot {
  border-color: #4CAF50;
}

.cam-slot.paused video {
  filter: brightness(0.15);
}

.cam-slot .paused-label {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #aaa;
  font-size: 18px;
}

.cam-slot.paused .paused-label {
  display: block;
}

.cam-slot.talking {
  border-color: #4CAF50;
  box-shadow: 0 0 6px rgba(76, 175, 80, 0.7);
  animation: talking-pulse 0.8s infinite;
}

@keyframes talking-pulse {

  0%,
  100% {
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.5);
  }

  50% {
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.9);
  }
}

.cam-slot .slot-controls {
  position: absolute;
  top: 2px;
  right: 2px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}

.cam-slot:hover .slot-controls {
  opacity: 1;
}

.slot-ctrl-btn {
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: none;
  padding: 1px 4px;
  font-size: 10px;
  border-radius: 2px;
  cursor: pointer;
  line-height: 1.4;
}

.slot-ctrl-btn:hover {
  background: rgba(76, 175, 80, 0.8);
}

/* ---- Room body ---- */
.room-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  background: #eef0f3;
}

.room-chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  position: relative;
}

/* ===== ROOM TOPBAR (Light) ===== */
.room-topbar {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  background: linear-gradient(135deg, #4CAF50, #388E3C);
  border-bottom: 1px solid #2e7d32;
  flex-shrink: 0;
  color: #fff;
  gap: 10px;
}

.rtb-info {
  margin-right: auto;
  display: flex;
  flex-direction: column;
}

.rtb-btn {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.rtb-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

.rtb-volume {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rtb-operator-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s;
}

/* FLOATING PANEL */
.floating-panel {
  position: fixed;
  top: 70px;
  right: 20px;
  width: 280px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 999;
  display: flex;
  flex-direction: column;
  border: 1px solid #ddd;
}

.panel-header {
  padding: 8px 12px;
  background: #1a73e8;
  color: #fff;
  border-radius: 8px 8px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: bold;
}

.panel-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

.panel-body {
  padding: 10px;
  max-height: 400px;
  overflow-y: auto;
}

.panel-section label {
  font-size: 11px;
  color: #666;
  font-weight: bold;
  margin-bottom: 5px;
  display: block;
  text-transform: uppercase;
}

.op-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.op-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px;
  background: #f8f9fa;
  border-radius: 4px;
  font-size: 12px;
}

.op-user-info {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.op-user-actions {
  display: flex;
  gap: 4px;
}

.btn-icon {
  padding: 3px;
  border: none;
  background: #eee;
  border-radius: 3px;
  cursor: pointer;
  font-size: 10px;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: #ddd;
}

.panel-divider {
  height: 1px;
  background: #eee;
  margin: 10px 0;
}

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

.rtb-operator-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.rtb-info {
  flex: 1;
}

.rtb-name {
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.rtb-topic {
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  margin-left: 6px;
}

.rtb-cam-btn {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.rtb-cam-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

.rtb-cam-btn.active {
  background: #e74c3c;
  border-color: #c0392b;
}

/* ===== CHAT FEED (Light) ===== */
.room-feed {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  background: #fafbfc;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* Scrollbar for feed */
.room-feed::-webkit-scrollbar {
  width: 5px;
}

.room-feed::-webkit-scrollbar-track {
  background: #f0f0f0;
}

.room-feed::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.room-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 8px;
  transition: background 0.12s;
}

.room-message:hover {
  background: rgba(76, 175, 80, 0.06);
}

.msg-avatar {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  margin-top: 1px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.msg-body {
  flex: 1;
  min-width: 0;
}

.msg-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 2px;
}

.msg-username {
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.msg-time {
  font-size: 9px;
  color: #aaa;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

.msg-content {
  display: block;
}

.msg-text {
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

/* ===== EMOJI PICKER ===== */
.emoji-picker {
  position: absolute;
  bottom: 100%;
  margin-bottom: 5px;
  left: 0;
  width: 340px;
  max-width: 90vw;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  padding: 10px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 9999;
}

.emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

.emoji-item {
  background: none;
  border: none;
  font-size: 22px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}

.emoji-item:hover {
  background: #f0f0f0;
  transform: scale(1.15);
}

/* ===== STICKER PANEL ===== */
.sticker-panel {
  position: absolute;
  bottom: 100%;
  margin-bottom: 5px;
  left: 0;
  width: 340px;
  max-width: 90vw;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  overflow: hidden;
}

.sticker-tabs {
  display: flex;
  gap: 5px;
  padding: 8px 8px 0;
  border-bottom: 1px solid #eee;
  background: #f9f9f9;
}

.stk-tab {
  background: #eee;
  color: #666;
  border: none;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: all 0.2s;
}

.stk-tab.active,
.stk-tab:hover {
  background: #4CAF50;
  color: #fff;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 10px;
  max-height: 220px;
  overflow-y: auto;
}

.sticker-item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  background: #f5f5f5;
  border: 1px solid #eee;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.sticker-item:hover {
  transform: scale(1.05);
  border-color: #4CAF50;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.sticker-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #eee;
}

.chat-sticker {
  display: block;
  max-width: 110px;
  max-height: 90px;
  border-radius: 8px;
  margin-top: 3px;
  border: 1px solid #e8e8e8;
  cursor: pointer;
  transition: transform 0.15s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-sticker:hover {
  transform: scale(1.05);
}

/* ===== TEXT FORMAT BAR (Popup) ===== */
.text-format-bar {
  position: absolute;
  bottom: 100%;
  margin-bottom: 5px;
  right: 0;
  width: 280px;
  max-width: 90vw;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  padding: 15px;
  z-index: 9999;
}

.text-format-bar.hidden {
  display: none;
}

.fmt-section {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.fmt-preview-box {
  margin-top: 15px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #e8e8e8;
}

.settings-save-btn {
  background: var(--cf-green);
  color: white;
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.settings-save-btn:hover {
  background: #388E3C;
}

.fmt-label {
  color: #555;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 40px;
}

.fmt-colors {
  display: flex;
  gap: 4px;
  align-items: center;
}

.fmt-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s, border-color 0.12s;
  flex-shrink: 0;
}

.fmt-color:hover {
  transform: scale(1.25);
}

.fmt-color.active {
  border-color: #333;
  transform: scale(1.15);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.fmt-sizes {
  display: flex;
  gap: 2px;
}

.fmt-size {
  background: #fff;
  color: #666;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s;
}

.fmt-size:hover {
  background: #f0faf0;
  color: #4CAF50;
  border-color: #4CAF50;
}

.fmt-size.active {
  background: #4CAF50;
  color: #fff;
  border-color: #4CAF50;
}

.fmt-preview {
  margin-left: auto;
  font-weight: 600;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s, font-size 0.2s;
  font-size: 12px;
}

/* ===== BOTTOM BAR (Light) ===== */
.room-bottom-bar {
  position: relative;
  /* Base for popups */
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: #ffffff;
  border-top: 1px solid #ddd;
  flex-shrink: 0;
}

.mic-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.mic-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #4CAF50;
  /* Default Green for Available mode */
  color: #ffffff;
  /* White text for green mode */
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  min-width: 120px;
  height: 34px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.mic-toggle-btn .mic-icon-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  order: 1;
  /* Icon First */
}

.mic-toggle-btn .mic-icon-svg svg {
  display: block;
}

/* Spectrum Inline */
.mic-spectrum-inline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  width: 16px;
  order: 2;
  /* Spectrum Second */
}

.mic-spectrum-inline .s-bar {
  width: 2.5px;
  height: 3px;
  background: #000000;
  border-radius: 1px;
  transition: height 0.05s ease;
}

.mic-toggle-btn.talking .mic-spectrum-inline .s-bar {
  background: #ffffff;
}

.mic-toggle-btn.locked .mic-spectrum-inline .s-bar {
  background: #000000;
}

.mic-toggle-btn #talk-btn-text {
  order: 3;
  /* Text Third */
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Red "Talking" (On Air) State */
.mic-toggle-btn.talking {
  background: #e74c3c !important;
  color: #ffffff !important;
  animation: mic-on-air-glow 1.5s infinite alternate;
}

/* Green "Locked" (Busy) State */
.mic-toggle-btn.locked {
  background: #a5d6a7 !important;
  /* Soft green */
  color: #000000 !important;
  /* Black text */
  box-shadow: none;
}

/* Clean Available State (no icons shown) */
.mic-toggle-btn.available .mic-icon-svg,
.mic-toggle-btn.available .mic-spectrum-inline,
.mic-toggle-btn.available .btn-vol-container {
  display: none !important;
}

.mic-toggle-btn.available {
  background: #4CAF50 !important;
  color: #ffffff !important;
  justify-content: center !important;
}

/* Ensure visibility when NOT available */
.mic-toggle-btn.talking .mic-icon-svg,
.mic-toggle-btn.talking .mic-spectrum-inline,
.mic-toggle-btn.locked .mic-icon-svg,
.mic-toggle-btn.locked .mic-spectrum-inline {
  display: flex !important;
}

.mic-toggle-btn.talking .mic-icon-svg svg rect,
.mic-toggle-btn.talking .mic-icon-svg svg path,
.mic-toggle-btn.talking .mic-icon-svg svg line {
  stroke: #ffffff;
  fill: #ffffff;
}

.mic-toggle-btn.talking .mic-icon-svg svg rect {
  fill: #ffffff;
}

@keyframes mic-on-air-glow {
  0% {
    box-shadow: 0 0 4px #e74c3c;
    filter: brightness(1);
  }

  100% {
    box-shadow: 0 0 12px #e74c3c;
    filter: brightness(1.1);
  }
}

.mic-toggle-btn:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.mic-toggle-btn:disabled {
  opacity: 1;
  /* Keep fully visible in locked mode */
  cursor: not-allowed;
}

/* Background Volume Bar (Hidden if using spectrum, or keep as secondary visual) */
.btn-vol-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(0, 0, 0, 0.05);
  display: flex;
  z-index: 5;
}

.btn-vol-fill {
  height: 100%;
  width: 0%;
  background: #2ecc71;
  /* Green bar */
  transition: width 0.05s linear;
}

.mic-on-air-dot {
  width: 10px;
  height: 10px;
  background: #ff0000;
  border: 1.5px solid #fff;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
  box-shadow: 0 0 4px rgba(255, 0, 0, 0.5);
}

/* System Audio Toggle */
.sys-audio-btn {
  background: linear-gradient(135deg, #607d8b, #455a64);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(96, 125, 139, 0.35);
}

.sys-audio-btn:hover {
  filter: brightness(1.1);
}

.sys-audio-btn.active {
  background: linear-gradient(135deg, #ff9800, #f57c00);
  box-shadow: 0 2px 6px rgba(255, 152, 0, 0.4);
  animation: sys-audio-pulse 1.5s infinite;
}

@keyframes sys-audio-pulse {

  0%,
  100% {
    box-shadow: 0 2px 6px rgba(255, 152, 0, 0.4);
  }

  50% {
    box-shadow: 0 2px 12px rgba(255, 152, 0, 0.7);
  }
}

.chat-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: #f5f7fa;
  border: 1.5px solid #e0e0e0;
  border-radius: 20px;
  overflow: hidden;
  padding: 0 6px;
  transition: border-color 0.2s;
}

.chat-input-wrap:focus-within {
  border-color: #4CAF50;
  background: #fff;
}

.chat-icon-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 17px;
  padding: 4px 5px;
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
}

.chat-icon-btn:hover {
  color: #4CAF50;
  background: rgba(76, 175, 80, 0.08);
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #333;
  font-size: 12px;
  padding: 6px 4px;
  outline: none;
}

.chat-input::placeholder {
  color: #bbb;
}

.send-btn {
  background: #4CAF50;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
  box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.send-btn:hover {
  background: #388E3C;
}

/* ===== SIDEBAR (Light) ===== */
.room-sidebar {
  width: 168px;
  background: #f8f9fa;
  border-left: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
}

.room-sidebar-header {
  padding: 8px 10px;
  background: linear-gradient(135deg, #4CAF50, #388E3C);
  border-bottom: 1px solid #2e7d32;
}

.room-sidebar-header h3 {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
}

.user-count-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
}

#member-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

/* ===== MIC BAR (handled in user items section) ===== */

/* ===== TALK BTN legacy ===== */
.talk-btn {
  background: linear-gradient(180deg, #5CB85C, #4CAF50);
  color: white;
  border: 1px solid #388E3C;
  border-radius: 3px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.talk-btn.talking {
  background: linear-gradient(180deg, #e74c3c, #c0392b) !important;
  border-color: #a93226;
  animation: mic-pulse 0.6s infinite;
}

.talk-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@keyframes mic-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

/* control-btn */
.control-btn {
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 12px;
  cursor: pointer;
  color: #fff;
}



/* ===== SYSTEM MESSAGES ===== */
.room-system-msg {
  text-align: center;
  font-size: 10px;
  color: #aaa;
  padding: 4px 8px;
  margin: 2px 0;
  background: rgba(76, 175, 80, 0.06);
  border-radius: 12px;
  border: 1px solid rgba(76, 175, 80, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.sys-time {
  color: #bbb;
  font-size: 9px;
}


/* ===== CAM SLOT AVATAR PLACEHOLDER ===== */
.cam-slot.preview-slot {
  cursor: pointer;
}

.slot-avatar-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 3px;
  transition: filter 0.15s;
}

.cam-slot.preview-slot:hover .slot-avatar-preview {
  filter: brightness(1.15);
}

.slot-avatar-initial {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.slot-cam-label {
  font-size: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.slot-view-btn {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}

.slot-view-btn:hover {
  background: rgba(76, 175, 80, 0.7);
  border-color: #4CAF50;
}

/* Loading state saat WebRTC sedang setup */
.cam-slot.loading-slot {
  border-color: #777;
}

.cam-slot.loading-slot .slot-label {
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.cam-slot.loading-slot video {
  filter: brightness(0.3);
}

/* ===== VOL SLIDER ===== */
.rtb-volume {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 20px;
}

.range-icon {
  font-size: 12px;
}

#vol-slider {
  width: 60px;
  height: 4px;
  cursor: pointer;
  accent-color: #4CAF50;
}

@media (max-width: 600px) {
  #vol-slider {
    width: 40px;
  }

  .range-icon {
    font-size: 10px;
  }
}

/* ===== USER CONTEXT MENU ===== */
.context-menu {
  position: absolute;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  min-width: 150px;
  z-index: 10000;
  overflow: hidden;
  border: 1px solid #eee;
  padding: 5px 0;
}

.context-menu.hidden {
  display: none;
}

.ctx-item {
  display: block;
  user-select: none;
  width: 100%;
  text-align: left;
  padding: 10px 15px;
  background: none;
  border: none;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  transition: background 0.2s;
}

.ctx-item:hover {
  background: #f0f0f0;
}

.ctx-divider {
  height: 1px;
  background: #eee;
  margin: 5px 0;
}

.ctx-item.text-danger {
  color: #e74c3c;
}

.ctx-item.text-danger:hover {
  background: #fceceb;
}

.ctx-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 12px;
  margin-left: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
  vertical-align: middle;
}

.ctx-badge.member {
  background: #f1f3f4;
  color: #5f6368;
  border: 1px solid #dfe1e5;
}

.ctx-badge.friend {
  background: linear-gradient(135deg, #43a047, #66bb6a);
  color: white;
  border: none;
  box-shadow: 0 2px 4px rgba(67, 160, 71, 0.3);
}

.ctx-badge.moderator {
  background: linear-gradient(135deg, #fb8c00, #ffa726);
  color: white;
  border: none;
  box-shadow: 0 2px 4px rgba(251, 140, 0, 0.3);
}

.ctx-badge.admin {
  background: linear-gradient(135deg, #e53935, #ef5350);
  color: white;
  border: none;
  box-shadow: 0 2px 4px rgba(229, 57, 53, 0.3);
}

.ctx-badge.owner {
  background: linear-gradient(135deg, #8e24aa, #ab47bc);
  color: white;
  border: none;
  box-shadow: 0 2px 4px rgba(142, 36, 170, 0.3);
  position: relative;
  overflow: hidden;
}

.ctx-badge.owner::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: rotate(45deg);
  animation: badge-shimmer 3s infinite;
}

@keyframes badge-shimmer {
  0% {
    transform: translateX(-100%) rotate(45deg);
  }

  100% {
    transform: translateX(100%) rotate(45deg);
  }
}

.role-icon {
  font-size: 11px;
}

/* ============ CAMFROG STYLE AUTH ============ */
.cf-auth-card {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  background: white;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.cf-auth-header {
  background: linear-gradient(135deg, #4CAF50, #43A047);
  padding: 30px 20px;
  text-align: center;
  position: relative;
}

.cf-auth-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='20' cy='20' r='15' fill='rgba(255,255,255,0.08)'/%3E%3Ccircle cx='80' cy='35' r='20' fill='rgba(255,255,255,0.05)'/%3E%3Ccircle cx='50' cy='70' r='12' fill='rgba(255,255,255,0.06)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.cf-logo-img {
  width: 60px;
  height: 60px;
  display: block;
  margin: 0 auto 8px;
  position: relative;
  z-index: 1;
}

.cf-brand {
  font-size: 22px;
  font-weight: 700;
  color: white;
  position: relative;
  z-index: 1;
}

.cf-auth-body {
  padding: 20px 30px;
  flex: 1;
}

.cf-back-link {
  color: #4CAF50;
  font-size: 13px;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 15px;
}

.cf-back-link:hover {
  text-decoration: underline;
}

.cf-auth-error {
  background: #ffebee;
  color: #c62828;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 10px;
}

.cf-form {
  margin-top: 5px;
}

.cf-field {
  margin-bottom: 14px;
}

.cf-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.cf-input {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid #4CAF50;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.cf-input:focus {
  border-color: #2E7D32;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}

.cf-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  font-size: 13px;
  color: #555;
}

.cf-toggle {
  position: relative;
  width: 40px;
  height: 22px;
}

.cf-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cf-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ccc;
  border-radius: 11px;
  cursor: pointer;
  transition: 0.3s;
}

.cf-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.cf-toggle input:checked+.cf-slider {
  background: #4CAF50;
}

.cf-toggle input:checked+.cf-slider::before {
  transform: translateX(18px);
}

.cf-btn-signin {
  width: 100%;
  padding: 10px;
  background: linear-gradient(to bottom, #5fbf5f, #4CAF50);
  color: white;
  border: 1px solid #3d8b40;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s;
}

.cf-btn-signin:hover {
  background: linear-gradient(to bottom, #4CAF50, #388E3C);
}

.cf-register-link {
  text-align: center;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.cf-btn-register {
  display: inline-block;
  padding: 10px 30px;
  border: 2px solid #4CAF50;
  border-radius: 20px;
  color: #4CAF50;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.cf-btn-register:hover {
  background: #4CAF50;
  color: white;
}

/* Override auth-container for camfrog style */
.auth-container {
  background: white !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  padding: 0 !important;
}


/* ============ CAMFROG MAIN VIEW ============ */
.cf-topbar {
  background: #4CAF50;
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 4px;
  flex-shrink: 0;
}

.cf-topbar-btn {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.cf-topbar-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.cf-topbar-spacer {
  flex: 1;
}

.cf-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cf-online-indicator {
  color: white;
  font-size: 12px;
  font-weight: 500;
}

.cf-profile-card {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid #eee;
  gap: 12px;
}

.cf-profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #E8F5E9;
  color: #4CAF50;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.cf-profile-info {
  flex: 1;
}

.cf-profile-name {
  font-size: 16px;
  font-weight: 700;
  color: #333;
}

.cf-profile-coins {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.cf-profile-actions {
  display: flex;
  gap: 4px;
}

.cf-icon-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.cf-search-bar {
  padding: 8px 12px;
  background: white;
  border-bottom: 1px solid #eee;
}

.cf-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  box-sizing: border-box;
  outline: none;
}

.cf-search-input:focus {
  border-color: #4CAF50;
}

.cf-tabs {
  display: flex;
  background: white;
  border-bottom: 2px solid #eee;
  flex-shrink: 0;
}

.cf-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: #999;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.cf-tab.active {
  color: #4CAF50;
}

.cf-tab.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 20%;
  right: 20%;
  height: 3px;
  background: #4CAF50;
  border-radius: 2px;
}

.cf-contacts-content,
.cf-rooms-content {
  flex: 1;
  overflow-y: auto;
  background: #fafafa;
}

.cf-menu-list {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cf-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-align: left;
  transition: all 0.2s;
}

.cf-menu-item.cf-green {
  background: #4CAF50;
  color: white;
}

.cf-menu-item.cf-green:hover {
  background: #43A047;
}

.cf-menu-item.cf-outline {
  background: white;
  color: #666;
  border: 1px solid #ddd;
}

.cf-menu-item.cf-outline:hover {
  background: #f5f5f5;
}

.cf-menu-icon {
  font-size: 18px;
}

/* Room list in ROOMS tab */
.cf-room-list {
  padding: 8px;
}

.cf-rooms-content .room-card {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  gap: 10px;
  background: white;
  transition: background 0.15s;
}

.cf-rooms-content .room-card:hover {
  background: #f5f5f5;
}

.cf-rooms-content .room-card-thumbnail {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cf-rooms-content .room-initial {
  font-size: 16px;
  font-weight: 700;
  color: white;
}

.cf-rooms-content .room-card-info h3 {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.cf-rooms-content .room-card-stats {
  font-size: 11px;
  color: #999;
}

/* Override main-content for compact view */
#main-view .main-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* User dropdown override */
.user-dropdown {
  position: absolute !important;
  top: 36px !important;
  left: 0 !important;
  right: auto !important;
  z-index: 999;
}


/* ============ BOTTOM NAV BAR ============ */
.cf-bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: #2c2c54;
  height: 48px;
  flex-shrink: 0;
  border-top: 1px solid #1a1a3e;
}

.cf-bnav-btn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 6px 12px;
  position: relative;
  transition: transform 0.15s;
}

.cf-bnav-btn:hover {
  transform: scale(1.15);
}

.cf-bnav-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #e74c3c;
  color: white;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 8px;
  font-weight: 700;
}

/* ============ CONTACT LIST ============ */
.cf-contact-list {
  padding: 0;
}

.cf-contact-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  gap: 10px;
  transition: background 0.15s;
}

.cf-contact-item:hover {
  background: #f5f5f5;
}

.cf-contact-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #E8F5E9;
  color: #4CAF50;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.cf-contact-avatar.online {
  box-shadow: 0 0 0 2px white, 0 0 0 4px #4CAF50;
}

.cf-contact-info {
  flex: 1;
}

.cf-contact-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.cf-contact-status {
  font-size: 11px;
  color: #999;
}


/* ============ ROOM LIST OVERLAY ============ */
.rl-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rl-overlay.hidden {
  display: none;
}

.rl-window {
  width: 90%;
  max-width: 850px;
  height: 85vh;
  max-height: 550px;
  background: #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
}

.rl-hdr {
  background: linear-gradient(135deg, #4CAF50, #43A047);
  flex-shrink: 0;
}

.rl-hdr-top {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  gap: 8px;
}

.rl-hdr-time {
  color: rgba(255, 255, 255, 0.8);
  font-size: 10px;
  text-align: right;
  line-height: 1.3;
}

.rl-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}

.rl-close-btn:hover {
  color: #ffcdd2;
}

.rl-tab-bar {
  display: flex;
  background: rgba(0, 0, 0, 0.15);
  padding: 0 8px;
}

.rl-tab {
  padding: 8px 16px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 3px solid transparent;
}

.rl-tab.active {
  color: #fff;
  border-bottom-color: #fff;
}

.rl-search-bar {
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.rl-search-bar input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
}

.rl-search-bar input:focus {
  border-color: #4CAF50;
}

.rl-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.rl-section {
  margin-bottom: 20px;
}

.rl-section h3 {
  font-size: 14px;
  color: #333;
  margin: 0 0 10px;
  font-weight: 600;
}

.rl-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.rl-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  width: 140px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.rl-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.rl-thumb {
  height: 85px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.rl-thumb .initial {
  font-size: 36px;
  font-weight: 700;
  color: #fff;
}

.rl-thumb .user-count {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
}

.rl-info {
  padding: 8px 10px;
}

.rl-info h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rl-info p {
  margin: 2px 0 0;
  font-size: 10px;
  color: #999;
}

.rl-stats {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  font-size: 10px;
  color: #888;
}


/* ============ ROOM-ONLY MODE (popup chat room) ============ */
.room-only-mode .cf-topbar,
.room-only-mode .cf-profile-card,
.room-only-mode .cf-search-bar,
.room-only-mode .cf-tabs,
.room-only-mode .cf-contacts-content,
.room-only-mode .cf-rooms-content,
.room-only-mode .cf-menu-list,
.room-only-mode .cf-bottom-nav,
.room-only-mode .lobby-view,
.room-only-mode .contacts-view,
.room-only-mode .messenger-view,
.room-only-mode .user-dropdown,
.room-only-mode #roomlist-overlay,
.room-only-mode .app-header {
  display: none !important;
}

.room-only-mode .room-view {
  display: block !important;
  position: relative !important;
  height: 100vh !important;
}

.room-only-mode .main-content {
  height: 100vh !important;
  overflow: hidden;
}

.room-only-mode #main-view {
  height: 100vh !important;
}

.room-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#member-list {
  flex: 1;
  overflow-y: auto;
}

.room-sidebar-footer {
  padding: 12px;
  background: #3da342;
  /* Vibrant Green */
  border-top: 1px solid #2e7c32;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sf-controls-row {
  display: flex;
  gap: 10px;
}

/* Camera ON button - Vivid Red */
.room-sidebar-footer .rtb-cam-btn {
  background: #e74c3c !important;
  color: #fff !important;
  border: 1px solid #c0392b !important;
  border-radius: 6px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

/* Settings button - Balanced Green */
.room-sidebar-footer .rtb-btn {
  background: #5eb562 !important;
  border: 1px solid #4a9e4e !important;
  color: #fff !important;
  border-radius: 6px;
  font-size: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Operator button - Professional Wide */
.room-sidebar-footer .rtb-operator-btn {
  width: 100%;
  height: 38px;
  background: #5eb562;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 1px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

/* Volume container - Clean Horizontal */
.room-sidebar-footer .rtb-volume {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.3);
  padding: 10px 14px;
  border-radius: 8px;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.room-sidebar-footer #vol-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  cursor: pointer;
}

.room-sidebar-footer #vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  border: 2px solid #2e7c32;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.room-sidebar-footer .range-icon {
  font-size: 18px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

.room-only-mode .room-body {
  height: 100vh !important;
}
