:root {
  --bg: #050816;
  --bg-elevated: #0b1020;
  --bg-soft: #070b16;
  --accent-pink: #ff4b9f;
  --accent-orange: #ff9b4b;
  --accent-gradient: linear-gradient(135deg, var(--accent-pink), var(--accent-orange));
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;
  --shadow-soft: 0 24px 60px rgba(0, 0, 0, 0.55);
  --shadow-subtle: 0 14px 30px rgba(0, 0, 0, 0.3);
  --transition-fast: 150ms ease-out;
  --transition-med: 200ms ease-out;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 75, 159, 0.18), transparent 55%),
    radial-gradient(circle at bottom right, rgba(255, 155, 75, 0.18), transparent 55%),
    #020617;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header - Used in both files */
.site-header {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 10;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: radial-gradient(circle at 0 0, rgba(255, 75, 159, 0.24), transparent 55%);
}

.logo-orb {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: var(--accent-gradient);
  box-shadow: 0 0 18px rgba(255, 75, 159, 0.8);
}

.logo-text {
  font-weight: 650;
  letter-spacing: 0.04em;
  font-size: 0.9rem;
  text-transform: uppercase;
  color: #e5e7eb;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.nav-link {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.nav-link:hover {
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-main);
  transform: translateY(-1px);
}

/* Homepage specific styles (index.html) */
body.home-page * {
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body.home-page {
  --primary: #9c27b0;
  --primary-dark: #7b1fa2;
  --primary-light: #e1bee7;
  --secondary: #ff4081;
  --accent: #ff9800;
  --text-dark: #333333;
  --text-light: #f5f5f5;
  --bg-light: #f8f9fa;
  --card-bg: #ffffff;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

body.home-page header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--text-light);
  padding: 1rem 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: background 0.3s;
}

body.home-page .container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

body.home-page .header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

body.home-page .logo {
  font-size: 1.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  z-index: 1001;
}

body.home-page nav ul {
  display: flex;
  list-style: none;
}

body.home-page nav ul li {
  margin-left: 1.5rem;
}

body.home-page nav ul li a {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  position: relative;
}

body.home-page nav ul li a:hover {
  color: var(--primary-light);
}

body.home-page nav ul li a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background-color: var(--primary-light);
  transition: width 0.3s;
}

body.home-page nav ul li a:hover::after {
  width: 100%;
}

body.home-page .auth-buttons {
  display: flex;
  gap: 1rem;
}

body.home-page .btn {
  padding: 0.6rem 1.5rem;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

body.home-page .btn-outline {
  background: transparent;
  border: 2px solid var(--text-light);
  color: var(--text-light);
}

body.home-page .btn-outline:hover {
  background: var(--text-light);
  color: var(--primary);
}

body.home-page .btn-primary {
  background: var(--secondary);
  color: var(--text-light);
}

body.home-page .btn-primary:hover {
  background: #e91e63;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

body.home-page .menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  z-index: 1001;
}

body.home-page .menu-toggle span {
  height: 3px;
  width: 25px;
  background: var(--text-light);
  margin-bottom: 4px;
  border-radius: 2px;
  transition: all 0.3s;
}

body.home-page .hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--text-light);
  padding: 12rem 0 6rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  display: block;
  grid-template-columns: none;
  gap: 0;
  min-height: auto;
}

body.home-page .hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'><path fill='%23ffffff' fill-opacity='0.1' d='M0,128L48,144C96,160,192,192,288,186.7C384,181,480,139,576,128C672,117,768,139,864,149.3C960,160,1056,160,1152,138.7C1248,117,1344,75,1392,53.3L1440,32L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'></path></svg>");
  background-size: cover;
  background-position: center;
}

body.home-page .hero-content {
  position: relative;
  z-index: 1;
  max-width: none;
}

body.home-page .hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.home-page .hero p {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

body.home-page .hero-buttons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

body.home-page .hero .btn {
  padding: 0.8rem 2rem;
  font-size: 1.1rem;
}

body.home-page section {
  padding: 5rem 0;
}

body.home-page .section-title {
  text-align: center;
  margin-bottom: 3rem;
}

body.home-page .section-title h2 {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

body.home-page .section-title h2::after {
  content: "";
  position: absolute;
  width: 60px;
  height: 4px;
  background: var(--secondary);
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
}

body.home-page .section-title p {
  max-width: 700px;
  margin: 0 auto;
  color: #666666;
}

body.home-page .about {
  background-color: var(--card-bg);
}

body.home-page .about-content {
  display: flex;
  align-items: center;
  gap: 3rem;
}

body.home-page .about-text {
  flex: 1;
}

body.home-page .about-text h3 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
}

body.home-page .about-text p {
  margin-bottom: 1.5rem;
  color: #555555;
}

body.home-page .about-image {
  flex: 1;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: float 3s ease-in-out infinite;
}

body.home-page .about-image img {
  width: 100%;
  height: auto;
  display: block;
}

body.home-page .features {
  background-color: var(--bg-light);
}

body.home-page .features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

body.home-page .feature-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
  text-align: center;
}

body.home-page .feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

body.home-page .feature-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

body.home-page .feature-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

body.home-page .feature-card p {
  color: #666666;
}

body.home-page .specialties {
  background-color: var(--card-bg);
}

body.home-page .specialties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

body.home-page .specialty-item {
  text-align: center;
  padding: 2rem 1rem;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-light), #f3e5f5);
  transition: transform 0.3s;
}

body.home-page .specialty-item:hover {
  transform: scale(1.05);
}

body.home-page .specialty-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

body.home-page .specialty-item h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

body.home-page .content-section {
  background-color: var(--bg-light);
}

body.home-page .content-block {
  margin-bottom: 2.5rem;
}

body.home-page .content-block h3 {
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

body.home-page .content-block p {
  margin-bottom: 1rem;
  color: #555555;
}

body.home-page .content-image {
  width: 100%;
  max-width: 600px;
  margin: 2rem auto;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

body.home-page .content-image-placeholder {
  width: 100%;
  height: 300px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}

body.home-page .avatar-scene {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
}

body.home-page .avatar-card {
  position: absolute;
  width: 84px;
  height: 84px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

body.home-page .avatar-card--one {
  top: 18%;
  left: 10%;
  animation: avatarFloatLeft 5s ease-in-out infinite;
}

body.home-page .avatar-card--two {
  top: 10%;
  right: 16%;
  animation: avatarFloatRight 5.4s ease-in-out infinite;
}

body.home-page .avatar-card--three {
  top: 46%;
  left: 28%;
  animation: avatarFloatLeft 4.8s ease-in-out infinite alternate;
}

body.home-page .avatar-card--four {
  top: 52%;
  right: 8%;
  animation: avatarFloatRight 5.6s ease-in-out infinite alternate;
}

body.home-page .avatar-card--five {
  bottom: 12%;
  left: 14%;
  animation: avatarFloatLeft 5.2s ease-in-out infinite;
}

body.home-page .avatar-card--six {
  bottom: 8%;
  right: 28%;
  animation: avatarFloatRight 4.9s ease-in-out infinite;
}

body.home-page .avatar-face {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  object-fit: cover;
  display: block;
}

body.home-page .avatar-status {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.85);
  border: 2px solid rgba(15, 23, 42, 0.9);
}

body.home-page .avatar-scene-label {
  margin-top: 1rem;
  font-size: 0.95rem;
  opacity: 0.9;
}

@keyframes avatarFloatLeft {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(28px, -24px);
  }
}

@keyframes avatarFloatRight {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-30px, 18px);
  }
}

body.home-page .cta {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--text-light);
  text-align: center;
  padding: 6rem 0;
}

body.home-page .cta h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

body.home-page .cta p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 2rem;
}

body.home-page .cta .btn {
  background: var(--secondary);
  color: var(--text-light);
  font-size: 1.2rem;
  padding: 1rem 2.5rem;
}

body.home-page footer {
  background: #2c2c2c;
  color: var(--text-light);
  padding: 4rem 0 2rem;
  text-align: center;
}

body.home-page .footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

body.home-page .footer-column h3 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--primary-light);
}

body.home-page .footer-column ul {
  list-style: none;
}

body.home-page .footer-column ul li {
  margin-bottom: 0.8rem;
}

body.home-page .footer-column ul li a {
  color: #cccccc;
  text-decoration: none;
  transition: color 0.3s;
}

body.home-page .footer-column ul li a:hover {
  color: var(--primary-light);
}

body.home-page .social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  justify-content: center;
}

body.home-page .social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--text-light);
  transition: all 0.3s;
}

body.home-page .social-links a:hover {
  background: var(--primary);
  transform: translateY(-3px);
}

body.home-page .footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #aaaaaa;
  font-size: 0.9rem;
}

body.home-page .fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s, transform 0.6s;
}

body.home-page .fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
  100% {
    transform: translateY(0);
  }
}

/* Chat page specific styles (chat.html) */
.chat-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.chat-body--light {
  background: #f5f5fb;
  color: #0f172a;
}

.chat-body--light .site-header {
  max-width: 100%;
  margin: 0;
  padding-inline: 1.25rem;
}

.chat-body--light .logo-text {
  color: #0f172a;
}

.chat-body--light .nav-link {
  color: #0f172a;
}

.chat-body--light .nav-link:hover {
  background: rgba(148, 163, 184, 0.16);
  color: #0f172a;
}

.chat-main {
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  display: flex;
}

.chat-body--light .chat-main {
  max-width: 100%;
  margin: 0;
  padding: 0 1.25rem 1.25rem;
}

.chat-header {
  padding-bottom: 0.75rem;
}

.chat-shell {
  margin-top: 0;
  background: rgba(15, 23, 42, 0.96);
  border-radius: 1.6rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  padding: 1.1rem 1.2rem 1.3rem;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.chat-body--light .chat-shell {
  border-radius: 0;
}

.chat-watermark {
  position: absolute;
  left: 1.5rem;
  bottom: 1.1rem;
  font-size: 1.5rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.9);
  pointer-events: none;
  user-select: none;
}

@media (max-width: 640px) {
  .chat-watermark {
    left: 1rem;
    bottom: 4.2rem;
    font-size: 1.1rem;
    letter-spacing: 0.16em;
  }
}

.chat-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.status-pill {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: #e5e7eb;
}

.status-pill::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #9ca3af;
}

.status--idle::before {
  background: #9ca3af;
}

.status--connecting::before {
  background: #facc15;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.9);
}

.status--connected::before {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.9);
}

.status--error::before {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.9);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.online-pill {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.5);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
}

.online-label {
  color: var(--text-muted);
}

.filter-select {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 0.8rem;
}

.filter-label {
  color: var(--text-muted);
}

.filter-select select {
  background: transparent;
  border: 0;
  color: #e5e7eb;
  font-size: 0.8rem;
  outline: none;
}

.chat-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr);
  gap: 1rem;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.local-column,
.remote-column {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.remote-column .video-card--remote {
  flex: 1;
  min-height: 0;
}

.local-column .video-card--self {
  flex-shrink: 0;
}

.local-column .chat-panel {
  flex: 1;
  min-height: 0;
}

.video-card {
  position: relative;
  border-radius: 1.2rem;
  background:
    radial-gradient(circle at 10% 0, rgba(255, 75, 159, 0.28), transparent 55%),
    radial-gradient(circle at 90% 100%, rgba(56, 189, 248, 0.3), transparent 55%),
    #020617;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.5);
  min-height: 240px;
}

.video-card--remote {
  min-height: 280px;
}

.video-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.video-overlay--controls {
  padding: 0.75rem 0.8rem;
}

.video-label {
  align-self: flex-start;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 0.8rem;
}

.floating-controls {
  display: inline-flex;
  align-self: flex-end;
  gap: 0.35rem;
  pointer-events: auto;
}

.icon-btn {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f9fafb;
  transition: background var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
}

.icon-btn:hover {
  background: rgba(15, 23, 42, 1);
  transform: translateY(-1px);
}

.icon-svg {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
}

.icon-btn.is-off {
  background: rgba(127, 29, 29, 0.96);
  border-color: rgba(248, 113, 113, 0.9);
}

.icon-btn.is-off .icon {
  opacity: 0.8;
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.7rem;
}

.primary-btn {
  flex: 1;
  border-radius: 999px;
  padding: 0.75rem 1.1rem;
  border: 0;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(31, 41, 55, 0.96);
  color: #f9fafb;
  border: 1px solid rgba(148, 163, 184, 0.7);
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.primary-btn--pink {
  background: var(--accent-gradient);
  box-shadow: 0 16px 40px rgba(248, 113, 113, 0.4);
  border-color: transparent;
}

.primary-btn--orange {
  background: linear-gradient(135deg, var(--accent-orange), #f97316);
  box-shadow: 0 16px 40px rgba(249, 115, 22, 0.4);
  border-color: transparent;
}

.primary-btn--ghost {
  background: transparent;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.7);
}

.primary-btn:active {
  transform: translateY(0) scale(0.98);
}

.primary-btn:disabled {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
}

.primary-btn--active {
  box-shadow: 0 0 0 1px rgba(248, 250, 252, 0.4), 0 18px 45px rgba(0, 0, 0, 0.7);
}

.primary-btn--ghost {
  background: #ffffff;
  border-color: #e5e7eb;
  color: #111827;
}

.chat-panel {
  margin-top: 0.9rem;
  border-radius: 1.1rem;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(31, 41, 55, 0.95);
  display: flex;
  flex-direction: column;
  min-height: 160px;
  max-height: 40vh;
}

@media (max-width: 640px) {
  .chat-main {
    height: calc(100vh - 72px);
    overflow-y: auto;
  }

  .chat-shell {
    min-height: 0;
  }

  .chat-panel {
    max-height: 260px;
  }
}

.chat-messages {
  padding: 0.8rem 0.9rem 0.4rem;
  flex: 1;
  overflow-y: auto;
}

.chat-bubble {
  max-width: 80%;
  border-radius: 1.1rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.chat-bubble--self {
  margin-left: auto;
  background: var(--accent-gradient);
}

.chat-bubble--remote {
  margin-right: auto;
  background: rgba(31, 41, 55, 0.96);
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.45rem 0.45rem;
  border-top: 1px solid rgba(31, 41, 55, 0.95);
}

.chat-input {
  flex: 1;
  border-radius: 999px;
  border: 0;
  padding: 0.55rem 0.9rem;
  background: rgba(15, 23, 42, 0.95);
  color: #f9fafb;
  font-size: 0.9rem;
  outline: none;
}

.chat-input::placeholder {
  color: #6b7280;
}

.send-btn {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 0;
  background: var(--accent-gradient);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.send-icon {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 2px;
  border-top: 2px solid #f9fafb;
  border-right: 2px solid #f9fafb;
  transform: rotate(45deg) translate(-1px, 1px);
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 15% 0, rgba(255, 75, 159, 0.16), transparent 60%),
    radial-gradient(circle at 85% 100%, rgba(56, 189, 248, 0.2), transparent 60%),
    #020617;
}

.video-placeholder.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.avatar-pulse {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0, #f9fafb, #e5e7eb);
  box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.5);
  animation: pulse-ring 1.7s ease-out infinite;
}

.placeholder-text {
  margin-top: 0.7rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Light theme overrides for chat */
.chat-body--light .chat-shell {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

.chat-body--light .status-pill {
  background: #e0f2fe;
  border-color: #bfdbfe;
  color: #0f172a;
}

.chat-body--light .status-pill::before {
  background: #38bdf8;
}

.chat-body--light .online-pill {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #0f172a;
}

.chat-body--light .online-label {
  color: #64748b;
}

.chat-body--light .filter-select {
  background: #f9fafb;
  border-color: #e5e7eb;
}

.chat-body--light .filter-select select {
  color: #0f172a;
}

.chat-body--light .video-card {
  background:
    radial-gradient(circle at 10% 0, rgba(248, 250, 252, 0.9), transparent 55%),
    radial-gradient(circle at 90% 100%, rgba(241, 245, 249, 0.9), transparent 55%),
    #ffffff;
  border-color: #e2e8f0;
}

.chat-body--light .video-label {
  background: rgba(248, 250, 252, 0.96);
  border-color: #e2e8f0;
  color: #0f172a;
}

.chat-body--light .icon-btn {
  background: rgba(248, 250, 252, 0.96);
  border-color: #e2e8f0;
  color: #0f172a;
}

.chat-body--light .icon-btn:hover {
  background: #ffffff;
}

.chat-body--light .icon-btn.is-off {
  background: #fee2e2;
  border-color: #fca5a5;
}

.chat-body--light .chat-panel {
  background: #f9fafb;
  border-color: #e5e7eb;
}

.chat-body--light .chat-messages {
  max-height: 45vh;
}

.chat-body--light .chat-input-row {
  border-top-color: #e5e7eb;
}

.chat-body--light .chat-input {
  background: #ffffff;
  color: #0f172a;
}

.chat-body--light .chat-input::placeholder {
  color: #9ca3af;
}

.chat-body--light .chat-bubble--remote {
  background: #e5edff;
  color: #111827;
}

.chat-body--light .video-placeholder {
  background: radial-gradient(circle at 15% 0, rgba(96, 165, 250, 0.18), transparent 60%),
    radial-gradient(circle at 85% 100%, rgba(251, 113, 133, 0.18), transparent 60%),
    #f9fafb;
}

/* Animations */
@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.6);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(248, 113, 113, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(248, 113, 113, 0);
  }
}

/* Loading animations for buttons */
.primary-btn.loading {
  position: relative;
  opacity: 0.85;
}

.primary-btn.loading::after {
  content: "";
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Better message bubbles with timestamps */
.chat-bubble {
  position: relative;
  margin-bottom: 10px;
  transition: transform 0.2s ease;
}

.chat-bubble:hover {
  transform: translateY(-1px);
}

.chat-bubble::after {
  content: attr(data-time);
  display: block;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.7);
  margin-top: 3px;
  text-align: right;
  opacity: 0.8;
}

.chat-bubble--remote::after {
  color: rgba(0,0,0,0.6);
}

/* Connection status pulse animation */
.status--connecting {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 113, 133, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(251, 113, 133, 0); }
  100% { box-shadow: 0 0 0 0 rgba(251, 113, 133, 0); }
}

/* Responsive video containers */
.video-card {
  min-height: auto;
  aspect-ratio: 16/9;
}

.video-card--remote {
  min-height: auto;
  aspect-ratio: 16/9;
}

/* Responsive */
@media (max-width: 960px) {
  .chat-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .remote-column {
    order: -1;
    margin-bottom: 0.7rem;
  }

  .chat-shell {
    padding: 0.9rem 0.85rem 1.1rem;
  }
}

@media (min-width: 961px) {
  .local-column .video-card--self {
    min-height: 320px;
    flex: 1.1;
  }

  .local-column .chat-panel {
    min-height: 260px;
    flex: 1;
  }
}

@media (max-width: 768px) {
  body.home-page .header-content {
    flex-wrap: wrap;
  }

  body.home-page .menu-toggle {
    display: flex;
  }

  body.home-page nav {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
  }

  body.home-page nav.active {
    max-height: 300px;
  }

  body.home-page nav ul {
    flex-direction: column;
    width: 100%;
    padding: 1rem 0;
  }

  body.home-page nav ul li {
    margin: 0.5rem 0;
    text-align: center;
  }

  body.home-page .auth-buttons {
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
    display: none;
  }

  body.home-page .auth-buttons.active {
    display: flex;
  }

  body.home-page .hero {
    padding: 10rem 0 4rem;
  }

  body.home-page .hero h1 {
    font-size: 2.5rem;
  }

  body.home-page .hero p {
    font-size: 1.2rem;
  }

  body.home-page .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  body.home-page .about-content {
    flex-direction: column;
  }

  body.home-page .section-title h2 {
    font-size: 2rem;
  }

  body.home-page .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .chat-main {
    height: auto;
  }
  
  .chat-grid {
    grid-template-rows: auto auto;
    grid-template-columns: 1fr;
  }
  
  .remote-column,
  .local-column {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding-inline: 1rem;
  }

  .chat-main {
    padding-inline: 1rem;
  }

  .main-nav {
    gap: 0.4rem;
  }

  .nav-link {
    padding-inline: 0.55rem;
  }

  .chat-top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .controls-row {
    flex-wrap: wrap;
  }

  .primary-btn {
    font-size: 0.8rem;
  }
}

@media (max-width: 576px) {
  body.home-page section {
    padding: 3rem 0;
  }

  body.home-page .footer-content {
    grid-template-columns: 1fr;
  }
}
