/* ============================================================
   StreamLive - Estilos Globales
   ============================================================ */

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

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111118;
  --bg-card: #1a1a2e;
  --bg-input: #16162a;
  --bg-glass: rgba(26, 26, 46, 0.85);
  --text-primary: #ffffff;
  --text-secondary: #a0a0b8;
  --text-muted: #6a6a82;
  --accent-1: #00d4ff;
  --accent-2: #7b2ffc;
  --accent-3: #00ff88;
  --gradient-main: linear-gradient(135deg, #00d4ff, #7b2ffc);
  --gradient-btn: linear-gradient(135deg, #00d4ff, #7b2ffc);
  --gradient-danger: linear-gradient(135deg, #ff4444, #cc2222);
  --gradient-success: linear-gradient(135deg, #00ff88, #00cc66);
  --danger: #ff4444;
  --warning: #ffaa00;
  --success: #00ff88;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 212, 255, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 50%;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

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

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

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }

/* --- Typography --- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
a { color: var(--accent-1); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Utility --- */
.hidden { display: none !important; }

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1a2e 50%, var(--bg-primary) 100%);
  padding: 20px;
}

.landing-container {
  text-align: center;
  max-width: 480px;
  width: 100%;
  animation: fadeInUp 0.8s ease-out;
}

.hero {
  margin-bottom: 48px;
}

.logo-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: pulse 3s ease-in-out infinite;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

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

/* --- Buttons --- */
.actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 48px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--accent-1); outline-offset: 2px; }

.btn-primary {
  background: var(--gradient-btn);
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 30px rgba(0, 212, 255, 0.4);
  transform: translateY(-2px);
}

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

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

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

.btn-danger:hover {
  box-shadow: 0 4px 15px rgba(255, 68, 68, 0.3);
  transform: translateY(-1px);
}

.btn-lg { padding: 18px 36px; font-size: 1.1rem; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-size: 1rem;
}
.btn-icon:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.25s ease-out;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  transition: var(--transition);
}

.modal-close:hover { color: var(--text-primary); }

.modal-title {
  font-size: 1.5rem;
  margin-bottom: 24px;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Form --- */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group label small { color: var(--text-muted); font-weight: 400; }

.form-group input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-sans);
  transition: var(--transition);
  outline: none;
}

.form-group input:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

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

.form-group small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.input-with-copy {
  display: flex;
  gap: 8px;
}

.input-with-copy input {
  flex: 1;
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: 6px;
  text-align: center;
  text-transform: uppercase;
}

.input-with-copy .btn-icon {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

/* --- Footer --- */
.landing-footer {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.landing-footer i { margin-right: 4px; }

/* ============================================================
   ROOM LAYOUT
   ============================================================ */
.room-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg-primary);
}

.room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  z-index: 10;
  flex-shrink: 0;
}

.header-left, .header-center, .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-center { flex: 1; justify-content: center; }

.logo-small {
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-host {
  background: rgba(0, 255, 136, 0.1);
  color: var(--success);
  border: 1px solid rgba(0, 255, 136, 0.2);
}

.badge-viewer {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-1);
  border: 1px solid rgba(0, 212, 255, 0.2);
}

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

.room-code {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-primary);
}

.room-code i { color: var(--accent-1); margin-right: 4px; }

.room-name-display {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.room-name-display i { color: var(--accent-1); margin-right: 6px; }

.quality-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.quality-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--text-muted);
  transition: var(--transition);
}

.quality-dot.green { background: var(--success); box-shadow: 0 0 8px rgba(0, 255, 136, 0.4); }
.quality-dot.yellow { background: var(--warning); box-shadow: 0 0 8px rgba(255, 170, 0, 0.4); }
.quality-dot.red { background: var(--danger); box-shadow: 0 0 8px rgba(255, 68, 68, 0.4); }

.quality-label {
  color: var(--text-secondary);
  font-family: monospace;
}

.viewer-count {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.viewer-count i { color: var(--accent-1); }

/* --- Video --- */
.room-content {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
}

.video-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

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

.video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  color: var(--text-secondary);
  gap: 12px;
  z-index: 5;
  animation: fadeIn 0.3s ease-out;
}

.video-overlay i {
  font-size: 3rem;
  color: var(--text-muted);
}

.video-overlay span {
  font-size: 1.1rem;
  font-weight: 500;
}

.video-overlay small {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-1);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

/* --- Controls --- */
.room-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--bg-glass);
  border-top: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.controls-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
  font-size: 0.75rem;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.ctrl-btn i { font-size: 1.2rem; }

.ctrl-btn.ctrl-active {
  color: var(--accent-1);
  border-color: rgba(0, 212, 255, 0.3);
  background: rgba(0, 212, 255, 0.08);
}

.ctrl-btn.ctrl-danger {
  color: var(--danger);
  border-color: rgba(255, 68, 68, 0.3);
}

.ctrl-btn.ctrl-danger:hover {
  background: rgba(255, 68, 68, 0.1);
}

.control-volume {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.control-volume input[type="range"] {
  width: 100px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border-color);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.control-volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--accent-1);
  cursor: pointer;
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

/* --- Toast --- */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  box-shadow: var(--shadow-md);
  animation: slideInUp 0.3s ease-out;
  pointer-events: auto;
  max-width: 360px;
  backdrop-filter: blur(10px);
}

.toast i { margin-right: 8px; }

.toast-success { border-color: rgba(0, 255, 136, 0.3); }
.toast-error { border-color: rgba(255, 68, 68, 0.3); }
.toast-info { border-color: rgba(0, 212, 255, 0.3); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ============================================================
   FULLSCREEN FAKE: oculta header/footer, expande video
   ============================================================ */
.room-layout.fullscreen-mode .room-header,
.room-layout.fullscreen-mode .room-controls {
  display: none !important;
}

.room-layout.fullscreen-mode .room-content {
  flex: 1 1 100% !important;
  max-height: 100vh !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .hero-title { font-size: 2.5rem; }
  .modal { padding: 24px; margin: 12px; }
  .room-header { padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
  .room-header .header-center { order: 3; flex-basis: 100%; }
  .room-controls { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .ctrl-btn { padding: 6px 10px; font-size: 0.7rem; }
  .ctrl-btn i { font-size: 1rem; }
  .control-volume input[type="range"] { width: 60px; }
  .badge span { display: none; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2rem; }
  .btn-lg { padding: 14px 24px; font-size: 1rem; }
  .logo-icon { font-size: 2.2rem; }
  .room-name-display { font-size: 0.95rem; }
}
