/* Optional expansion features — isolated from main TinyChats room UI */
:root {
  --exp-bg: #0d0f14;
  --exp-surface: #161a22;
  --exp-border: #2a3142;
  --exp-text: #e8ecf4;
  --exp-muted: #8b95a8;
  --exp-accent: #7c5cff;
  --exp-accent-glow: rgba(124, 92, 255, 0.35);
  --exp-neon: #00e5c0;
  --exp-danger: #ff4d6a;
}

* { box-sizing: border-box; }

body.expansion-page {
  margin: 0;
  min-height: 100vh;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--exp-bg);
  color: var(--exp-text);
}

.exp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--exp-border);
  background: rgba(22, 26, 34, 0.98);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.exp-nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.exp-nav-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--exp-accent), #5a3fd4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 16px var(--exp-accent-glow), 0 0 0 1px rgba(124, 92, 255, 0.4);
  transition: filter 0.2s, transform 0.15s;
}

.exp-nav-back:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  color: #fff;
}

.exp-nav-back-icon {
  font-size: 1.1em;
  line-height: 1;
}

.exp-nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--exp-text);
  text-decoration: none;
}

.exp-nav-brand span { color: var(--exp-neon); }

.exp-nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.exp-nav-links a {
  color: var(--exp-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: color 0.2s, background 0.2s;
}

.exp-nav-links a:hover,
.exp-nav-links a.active {
  color: var(--exp-text);
  background: var(--exp-surface);
}

.exp-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px 88px;
}

.exp-back-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: rgba(124, 92, 255, 0.16);
  border: 1px solid rgba(124, 92, 255, 0.45);
  border-radius: 10px;
  text-decoration: none;
  color: var(--exp-text);
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.2);
  transition: background 0.2s, border-color 0.2s;
}

.exp-back-top:hover {
  background: rgba(124, 92, 255, 0.22);
  border-color: var(--exp-neon);
  color: #fff;
}

.exp-back-top-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--exp-accent);
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
}

.exp-hero {
  text-align: center;
  margin-bottom: 32px;
}

.exp-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 0 0 8px;
  background: linear-gradient(135deg, var(--exp-text), var(--exp-neon));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.exp-hero p {
  color: var(--exp-muted);
  margin: 0;
}

.exp-card {
  background: var(--exp-surface);
  border: 1px solid var(--exp-border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.exp-card:hover {
  border-color: var(--exp-accent);
  box-shadow: 0 0 24px var(--exp-accent-glow);
}

.exp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}

.exp-btn-primary {
  background: linear-gradient(135deg, var(--exp-accent), #5a3fd4);
  color: #fff;
}

.exp-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--exp-accent-glow);
}

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

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

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

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

.exp-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  background: rgba(124, 92, 255, 0.2);
  color: var(--exp-accent);
  border: 1px solid rgba(124, 92, 255, 0.4);
}

.exp-video-wrap {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/10;
  margin-bottom: 16px;
}

.exp-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.exp-video-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
  min-height: 220px;
}

@media (max-width: 640px) {
  .exp-video-dual {
    grid-template-columns: 1fr;
  }
}

.exp-video-pane {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4/3;
  min-height: 180px;
}

.exp-video-pane video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.exp-video-pane-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.65);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  z-index: 2;
}

.exp-video-pane-remote .exp-remote-wrapper {
  width: 100%;
  height: 100%;
  min-height: 180px;
}

.exp-status {
  padding: 12px;
  border-radius: 8px;
  background: rgba(0, 229, 192, 0.1);
  border: 1px solid rgba(0, 229, 192, 0.3);
  color: var(--exp-neon);
  text-align: center;
  margin-bottom: 16px;
}

.exp-status.error {
  background: rgba(255, 77, 106, 0.1);
  border-color: rgba(255, 77, 106, 0.3);
  color: var(--exp-danger);
}

.exp-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--exp-border);
  background: var(--exp-bg);
  color: var(--exp-text);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.exp-input:focus {
  outline: none;
  border-color: var(--exp-accent);
}

.exp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.exp-back-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 101;
  padding: 10px 16px;
  padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, rgba(13, 15, 20, 0.98) 70%, rgba(13, 15, 20, 0));
  pointer-events: none;
}

.exp-back-footer-inner {
  pointer-events: auto;
  max-width: 1100px;
  margin: 0 auto;
}

.exp-back-footer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  color: #0d0f14;
  background: linear-gradient(135deg, var(--exp-neon), #00c9a7);
  border: none;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0, 229, 192, 0.35);
  transition: filter 0.2s, transform 0.15s;
}

.exp-back-footer-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  color: #0d0f14;
}

/* legacy class — keep for any old markup */
.exp-back-link {
  display: none;
}

@media (max-width: 600px) {
  .exp-nav {
    flex-wrap: wrap;
  }
  .exp-nav-left {
    width: 100%;
    justify-content: space-between;
  }
  .exp-nav-links {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .exp-nav-back {
    padding: 10px 16px;
    font-size: 0.95rem;
  }
  .exp-actions { flex-direction: column; }
  .exp-actions .exp-btn { width: 100%; }
}
