/* ============================================
   ReBeauty Live - Global Stylesheet
   ShadCN Dark Theme / Mobile-first / Korean UI
   ============================================ */

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

/* --- Variables --- */
:root {
  --primary: #FF6B6B;
  --primary-dark: #e55a5a;
  --primary-light: #ff8a8a;
  --primary-glow: rgba(255, 107, 107, 0.15);
  --secondary: #4ECDC4;
  --secondary-dark: #3dbdb5;
  --dark: #fafafa;
  --dark-light: #e5e5e5;
  --bg-body: #09090b;
  --bg-card: #0a0a0a;
  --bg-elevated: #111113;
  --bg-muted: #18181b;
  --bg-input: #0a0a0a;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.1);
  --border-input: rgba(255, 255, 255, 0.12);
  --gray-100: #18181b;
  --gray-200: #27272a;
  --gray-300: #3f3f46;
  --gray-400: #52525b;
  --gray-500: #71717a;
  --gray-600: #a1a1aa;
  --gray-700: #d4d4d8;
  --gray-800: #e4e4e7;
  --white: #fafafa;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #eab308;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.6);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-sans: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: 0.2s ease;
}

/* --- Base --- */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--white);
  background: var(--bg-body);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}
button { cursor: pointer; }
ul, ol { list-style: none; }

/* --- Typography --- */
h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.3; color: var(--white); letter-spacing: -0.02em; }
h2 { font-size: 1.375rem; font-weight: 700; line-height: 1.3; color: var(--white); letter-spacing: -0.01em; }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; color: var(--white); }
h4 { font-size: 1rem; font-weight: 600; color: var(--white); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--gray-500); }

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* --- Header / Nav --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.logo svg { width: 28px; height: 28px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-600);
  transition: background var(--transition), color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--bg-muted);
  color: var(--white);
}

.nav-links .btn-nav-primary {
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
}

.nav-links .btn-nav-primary:hover {
  background: var(--primary-dark);
  color: var(--white);
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--gray-600);
  position: relative;
  transition: var(--transition);
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background: var(--gray-600);
  left: 0;
  transition: var(--transition);
}

.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

/* --- Hero Section --- */
.hero {
  background: var(--bg-body);
  color: var(--white);
  padding: 48px 0 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 107, 107, 0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(78, 205, 196, 0.05) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 1.75rem;
  margin-bottom: 12px;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--white) 0%, var(--gray-600) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1rem;
  color: var(--gray-500);
  margin-bottom: 28px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background: var(--secondary-dark);
  transform: translateY(-1px);
}

.btn-outline {
  border: 1px solid var(--border-input);
  color: var(--white);
  background: transparent;
}

.btn-outline:hover {
  background: var(--bg-muted);
  border-color: var(--border-strong);
}

.btn-white {
  background: var(--bg-elevated);
  color: var(--white);
  border: 1px solid var(--border);
}

.btn-white:hover {
  transform: translateY(-1px);
  background: var(--bg-muted);
  border-color: var(--border-strong);
}

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }

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

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; }

.btn-ghost {
  background: transparent;
  color: var(--gray-500);
}

.btn-ghost:hover {
  background: var(--bg-muted);
  color: var(--white);
}

.btn-block { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* --- Section --- */
.section {
  padding: 32px 0;
}

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

.section-header h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- Card Grid --- */
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.room-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
  cursor: pointer;
  animation: fadeInUp 0.4s ease both;
}

.room-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.room-card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-muted);
  overflow: hidden;
}

.room-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.room-card-thumb .placeholder-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-muted), var(--gray-200));
  color: var(--gray-400);
  font-size: 2rem;
}

.badge-live {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--danger);
  color: #fff;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  animation: pulseLive 1.5s ease-in-out infinite;
}

.badge-scheduled {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--warning);
  color: #000;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}

.badge-ended {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--gray-300);
  color: var(--gray-600);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}

.viewer-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--white);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(4px);
}

.room-card-body {
  padding: 14px;
}

.room-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: var(--white);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.room-card-seller {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--gray-500);
}

.seller-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--secondary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: var(--bg-input);
  color: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder { color: var(--gray-400); }

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

.form-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: var(--bg-input);
  color: var(--white);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%2371717a'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab-btn {
  flex: 1;
  padding: 14px;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

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

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Auth page */
.auth-page {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg-body);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
}

.auth-card .logo {
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 24px;
}

/* --- Live Room Page --- */
.room-page {
  height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
}

.video-area {
  position: relative;
  background: #000;
  aspect-ratio: 16 / 9;
  max-height: 45vh;
  overflow: hidden;
}

.video-area video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 14px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent);
  color: var(--white);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  z-index: 5;
}

.video-overlay-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.video-overlay .room-title-overlay {
  font-size: 1rem;
  font-weight: 700;
}

.video-overlay .seller-info-overlay {
  font-size: 0.8rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.video-overlay .viewer-badge {
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(4px);
}

.video-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a0a0a, #111113);
  color: var(--gray-400);
  gap: 12px;
}

.video-placeholder svg { width: 48px; height: 48px; opacity: 0.5; }

/* Side panel */
.side-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  overflow: hidden;
  min-height: 0;
}

.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition);
}

.panel-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.panel-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.panel-section {
  display: none;
  flex-direction: column;
  height: 100%;
}

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

/* Chat panel */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Scrollbar styling for dark theme */
.chat-messages::-webkit-scrollbar,
.products-list::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-track,
.products-list::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb,
.products-list::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}

.chat-msg {
  animation: fadeIn 0.2s ease;
}

.chat-msg-user {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--secondary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}

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

.chat-msg-nick {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  margin-bottom: 2px;
}

.chat-msg-nick.seller {
  color: var(--primary);
}

.chat-msg-text {
  font-size: 0.875rem;
  word-break: break-word;
  line-height: 1.4;
  color: var(--gray-700);
}

.chat-msg-time {
  font-size: 0.65rem;
  color: var(--gray-400);
  margin-top: 2px;
}

.chat-msg-system {
  text-align: center;
  padding: 8px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--gray-500);
}

.chat-msg-system.purchase {
  background: rgba(234, 179, 8, 0.1);
  border-color: rgba(234, 179, 8, 0.2);
  color: var(--warning);
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-input-area input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-input);
  border-radius: 24px;
  font-size: 0.875rem;
  background: var(--bg-input);
  color: var(--white);
}

.chat-input-area input::placeholder {
  color: var(--gray-400);
}

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

.chat-input-area button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}

.chat-input-area button:hover {
  background: var(--primary-dark);
}

/* Products panel */
.products-list {
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.product-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.product-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}

.product-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  background: var(--gray-200);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 1.2rem;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.product-name {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--white);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
}

.product-original-price {
  font-size: 0.75rem;
  color: var(--gray-400);
  text-decoration: line-through;
  margin-left: 4px;
}

.product-buy-btn {
  align-self: center;
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  transition: var(--transition);
  flex-shrink: 0;
}

.product-buy-btn:hover { background: var(--primary-dark); }

/* Consultation button */
.consult-btn-area {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.consult-btn {
  width: 100%;
  padding: 12px;
  background: var(--secondary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.consult-btn:hover { background: var(--secondary-dark); }

/* --- Video Call Floating Window --- */
#video-call-container {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: fadeInUp 0.3s ease;
}

#video-call-container.active { display: block; }

.vc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: move;
}

.vc-videos {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #000;
}

.vc-videos video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vc-local-video {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 90px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
  z-index: 2;
}

.vc-local-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vc-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.5);
}

.vc-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

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

.vc-btn.active { background: var(--primary); }

.vc-btn-end {
  background: var(--danger) !important;
}

.vc-btn-end:hover { background: #dc2626 !important; }

/* --- Dashboard --- */
.dashboard {
  padding: 24px 0;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.dash-card-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-card-body {
  padding: 20px;
}

.room-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.room-list-item:last-child { border-bottom: none; }

.room-list-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.room-list-thumb {
  width: 48px;
  height: 36px;
  border-radius: 6px;
  background: var(--bg-muted);
  overflow: hidden;
  flex-shrink: 0;
}

.room-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.room-list-status {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.room-list-status.live {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.room-list-status.scheduled {
  background: rgba(234, 179, 8, 0.15);
  color: var(--warning);
}

.room-list-status.ended {
  background: var(--gray-200);
  color: var(--gray-500);
}

.room-list-actions {
  display: flex;
  gap: 6px;
}

/* Consultation request items */
.consult-request {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.consult-request:last-child { margin-bottom: 0; }

.consult-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.consult-actions {
  display: flex;
  gap: 6px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-400);
}

.empty-state svg { width: 48px; height: 48px; margin: 0 auto 12px; opacity: 0.3; }

/* --- Stats (Dashboard) --- */
.stat-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  gap: 4px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* --- Footer --- */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  color: var(--gray-500);
  padding: 32px 0;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.footer-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 0.85rem;
}

.footer-links a:hover { color: var(--white); }

.footer-copy {
  font-size: 0.75rem;
  color: var(--gray-400);
}

/* --- Toast Notification --- */
.toast-container {
  position: fixed;
  top: 70px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  background: var(--bg-elevated);
  color: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  max-width: 340px;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--secondary); }

/* --- Modal --- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeInUp 0.3s ease;
}

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

.modal-header h3 { font-size: 1.05rem; }

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--bg-muted);
  color: var(--white);
}

.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

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

@keyframes pulseLive {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

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

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--gray-300);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* --- Responsive --- */
@media (min-width: 768px) {
  .container { padding: 0 24px; }

  .hero { padding: 64px 0 72px; }
  .hero h1 { font-size: 2.25rem; }
  .hero p { font-size: 1.125rem; }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }

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

  .room-page {
    grid-template-columns: 1fr 380px;
    grid-template-rows: 1fr;
  }

  .video-area {
    aspect-ratio: auto;
    max-height: none;
  }

  .dash-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }

  #video-call-container { width: 380px; }
}

@media (min-width: 1024px) {
  .room-page {
    grid-template-columns: 1fr 420px;
  }

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

@media (max-width: 767px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: rgba(9, 9, 11, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 8px 16px 16px;
    border-bottom: 1px solid var(--border);
    animation: slideDown 0.2s ease;
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    padding: 12px 14px;
    width: 100%;
  }

  /* Hero mobile */
  .hero { padding: 32px 0 40px; }
  .hero h1 { font-size: 1.4rem; }
  .hero p { font-size: 0.9rem; margin-bottom: 20px; }

  /* Room grid - single column on small phones */
  .room-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .room-card-body { padding: 10px; }
  .room-card-title { font-size: 0.85rem; }
  .room-card-seller { font-size: 0.75rem; }

  /* Room page mobile */
  .room-page {
    height: auto;
    min-height: calc(100vh - 56px);
  }

  .video-area {
    aspect-ratio: 16 / 9;
    max-height: 35vh;
  }

  .side-panel {
    height: calc(100vh - 56px - 35vh);
    min-height: 300px;
  }

  .video-overlay .room-title-overlay { font-size: 0.85rem; }
  .video-overlay { padding: 10px; }

  /* Chat mobile */
  .chat-messages { padding: 8px; gap: 6px; }
  .chat-msg-text { font-size: 0.8rem; }
  .chat-input-area { padding: 8px; gap: 6px; }
  .chat-input-area input { padding: 8px 12px; font-size: 0.85rem; }
  .chat-input-area button { width: 36px; height: 36px; }

  /* Products mobile */
  .products-list { padding: 8px; gap: 8px; }
  .product-item { padding: 10px; gap: 10px; }
  .product-thumb { width: 56px; height: 56px; }
  .product-name { font-size: 0.8rem; }
  .product-price { font-size: 0.85rem; }
  .product-buy-btn { padding: 6px 12px; font-size: 0.75rem; }

  /* Dashboard mobile */
  .dashboard { padding: 16px 0; }
  .dash-card-header { padding: 12px 16px; }
  .dash-card-header h3 { font-size: 0.95rem; }
  .dash-card-body { padding: 12px 16px; }

  .room-list-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0;
  }

  .room-list-info { width: 100%; }

  .room-list-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
  }

  .room-list-actions .btn {
    flex: 1;
    min-width: 0;
    text-align: center;
    padding: 8px 8px;
    font-size: 0.78rem;
  }

  /* Stats row mobile */
  .stat-row {
    flex-direction: column;
    gap: 8px;
  }

  .stat-card {
    flex-direction: row;
    justify-content: space-between;
    padding: 12px 16px;
  }

  /* Modal mobile */
  .modal-backdrop { padding: 8px; }
  .modal { max-height: 95vh; }
  .modal-header { padding: 14px 16px; }
  .modal-body { padding: 16px; }

  /* Video call mobile */
  #video-call-container {
    width: calc(100% - 32px);
    left: 16px;
    right: 16px;
    bottom: 10px;
  }

  .vc-local-video { width: 70px; }

  /* Buttons mobile */
  .btn { padding: 10px 18px; font-size: 0.88rem; }
  .btn-sm { padding: 7px 12px; font-size: 0.8rem; }
  .btn-lg { padding: 12px 24px; font-size: 0.95rem; }

  /* Section headers mobile */
  .section-header { margin-bottom: 16px; }
  .section-header h2 { font-size: 1.15rem; }
  h1 { font-size: 1.4rem; }

  /* Auth page mobile */
  .auth-card { padding: 24px 18px; }

  /* Footer mobile */
  .footer-links { flex-wrap: wrap; gap: 12px; font-size: 0.8rem; }

  /* Consultation button */
  .consult-btn { padding: 10px; font-size: 0.9rem; }

  /* Consult request mobile */
  .consult-request {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .consult-actions { width: 100%; }
  .consult-actions .btn { flex: 1; }

  /* Toast mobile */
  .toast-container {
    left: 16px;
    right: 16px;
    top: 64px;
  }

  .toast { max-width: 100%; }
}

/* --- Utility --- */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.p-3 { padding: 12px; }
.text-center { text-align: center; }
.w-full { width: 100%; }
