/* ========== RESET & BASE ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0a0a0a;
  color: #fff;
  min-height: 100vh;
  overflow: hidden;
}

a { color: #4ade80; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========== TOP SHARE ========== */
.top-share {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 100;
}
.share-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #fff;
}
.share-btn.fb { background: #1877f2; }
.share-btn.x { background: #000; border: 1px solid #333; }

/* ========== CHAT LAYOUT ========== */
.chat-page { height: 100vh; display: flex; flex-direction: column; }

.chat-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 0;
  margin-top: 36px;
}

.video-panel {
  position: relative;
  overflow: hidden;
  background: #111;
}

/* LEFT PANEL - Idle static */
.left-panel {
  border-right: 1px solid #222;
}

.static-bg {
  position: absolute;
  inset: 0;
  background: #1a1a1a;
  z-index: 1;
}

/* Animated TV static noise */
.static-bg::before {
  content: '';
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.35;
  animation: staticMove 0.4s steps(4) infinite;
  pointer-events: none;
}

@keyframes staticMove {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2%, 1%); }
  50%  { transform: translate(1%, -1%); }
  75%  { transform: translate(-1%, 2%); }
  100% { transform: translate(0, 0); }
}

.idle-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  pointer-events: none;
}

.idle-content.hidden { display: none; }

.ome-logo {
  filter: drop-shadow(0 6px 24px rgba(249, 115, 22, 0.45));
}

.online-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  color: #bbb;
}
.live-dot {
  width: 9px;
  height: 9px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.store-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.store { pointer-events: auto; opacity: 0.9; transition: opacity 0.15s; }
.store:hover { opacity: 1; }

.volume-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.5);
  padding: 6px 14px;
  border-radius: 20px;
}
.vol-track {
  width: 120px;
  height: 5px;
  background: #333;
  border-radius: 3px;
  overflow: hidden;
}
.vol-fill {
  width: 70%;
  height: 100%;
  background: #4ade80;
  border-radius: 3px;
}

/* Remote video (when connected, covers left panel) */
.remote-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 3;
  background: #000;
  display: none;
}
.remote-video.active { display: block; }

.status-overlay {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  padding: 10px 28px;
  border-radius: 30px;
  font-size: 0.95rem;
  z-index: 10;
  white-space: nowrap;
}
.status-overlay.hidden { display: none; }

/* RIGHT PANEL */
.right-panel {
  display: flex;
  flex-direction: column;
  background: #0f0f0f;
}

.partner-video-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.local-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  display: none;
}
.local-preview.active { display: block; }

.partner-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #555;
  font-size: 0.9rem;
}
.partner-placeholder.hidden { display: none; }

/* Chat box */
.chat-box {
  height: 220px;
  display: flex;
  flex-direction: column;
  border-top: 1px solid #2a2a2a;
  background: #1a1a1a;
}

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

.system-msg {
  background: #252525;
  border-radius: 10px;
  padding: 12px;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #ccc;
}
.ome-badge {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 4px;
}
.safety {
  margin-top: 8px;
  color: #fbbf24;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.msg {
  max-width: 88%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
}
.msg.mine {
  align-self: flex-end;
  background: #2563eb;
  border-bottom-right-radius: 3px;
}
.msg.theirs {
  align-self: flex-start;
  background: #333;
  border-bottom-left-radius: 3px;
}
.msg .from {
  font-size: 0.72rem;
  opacity: 0.65;
  margin-bottom: 2px;
}
.partner-info {
  background: #1a2e24;
  border: 1px solid #22c55e33;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.84rem;
  color: #a7f3d0;
}
.partner-info a { color: #f87171; }

.chat-input-wrap {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #222;
  border-top: 1px solid #333;
}
#chatInput {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #3a3a3a;
  border-radius: 22px;
  padding: 10px 16px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
}
#chatInput:focus { border-color: #22c55e; }
#chatInput:disabled { opacity: 0.45; }
#btnSend {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: #22c55e;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
#btnSend:disabled { opacity: 0.35; cursor: not-allowed; }

/* ========== BOTTOM CONTROLS ========== */
.bottom-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
  padding: 12px 16px;
  background: #1c1c1c;
  border-top: 1px solid #2a2a2a;
  z-index: 50;
}

.big-btn {
  padding: 18px 8px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.15s;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.big-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.big-btn.start {
  background: linear-gradient(180deg, #34d399, #16a34a);
  box-shadow: 0 4px 0 #15803d;
}
.big-btn.start:hover:not(:disabled) { filter: brightness(1.08); }
.big-btn.next {
  background: linear-gradient(180deg, #34d399, #16a34a);
  box-shadow: 0 4px 0 #15803d;
}
.big-btn.stop {
  background: linear-gradient(180deg, #f87171, #ef4444);
  box-shadow: 0 4px 0 #b91c1c;
}
.big-btn.stop:hover:not(:disabled) { filter: brightness(1.08); }
.big-btn.country,
.big-btn.gender {
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  color: #ddd;
}
.big-btn.country:hover,
.big-btn.gender:hover {
  background: #333;
}
.big-btn.hidden { display: none; }

.flag-svg { display: inline-flex; vertical-align: middle; }

/* ========== DROPDOWNS ========== */
.dropdown {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 92vw);
  background: #fff;
  color: #222;
  border-radius: 14px;
  max-height: 340px;
  overflow-y: auto;
  z-index: 80;
  box-shadow: 0 16px 50px rgba(0,0,0,0.5);
}
.dropdown.hidden { display: none; }

.dropdown-header {
  padding: 12px 16px;
  font-weight: 600;
  border-bottom: 1px solid #eee;
  background: #f7f7f7;
  border-radius: 14px 14px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.dropdown-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.dropdown-list button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 0.9rem;
  cursor: pointer;
  color: #333;
}
.dropdown-list button:hover { background: #f0f0f0; }
.dropdown-list button.active { background: #d1fae5; font-weight: 600; }

.gender-dd {
  display: flex;
  flex-direction: column;
  width: 220px;
  left: auto;
  right: 20px;
  transform: none;
}
.gender-dd button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 0.95rem;
  cursor: pointer;
  color: #333;
}
.gender-dd button:hover { background: #f0f0f0; }

/* ========== LANDING (kept simple) ========== */
.landing { background: #0a0a0a; position: relative; min-height: 100vh; }
.noise {
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.04; pointer-events: none; z-index: 0;
}
.top-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px; position: relative; z-index: 10;
}
.share { display: flex; gap: 8px; }
.btn-share {
  background: #1877f2; color: #fff; padding: 6px 12px;
  border-radius: 6px; font-size: 0.85rem; font-weight: 500;
}
.btn-share.x { background: #000; border: 1px solid #333; }

.hero {
  display: grid; grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 60px); position: relative; z-index: 5;
}
.hero-left {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 28px; padding: 40px;
}
.online {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.1rem; color: #a3a3a3;
}
.dot {
  width: 10px; height: 10px; background: #22c55e;
  border-radius: 50%; animation: pulse 1.5s infinite;
}
.stores { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.store-btn img { height: 42px; }
.auth-box {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; margin-top: 12px;
}
.btn-google {
  display: flex; align-items: center; gap: 12px;
  background: #fff; color: #333; padding: 12px 28px;
  border-radius: 50px; font-weight: 600; font-size: 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3); transition: transform 0.15s;
}
.btn-google:hover { transform: scale(1.03); text-decoration: none; }
.demo-link { font-size: 0.9rem; color: #888; }
.demo-link a { color: #60a5fa; }
.btn-primary {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff; padding: 14px 36px; border-radius: 12px;
  font-weight: 600; font-size: 1.1rem; border: none; cursor: pointer;
}
.btn-primary.large { padding: 16px 48px; }
.btn-ghost { color: #aaa; font-size: 0.9rem; }
.hero-right {
  display: flex; align-items: center; justify-content: center;
  padding: 40px; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}
.preview-window {
  width: 100%; max-width: 480px; aspect-ratio: 4/3;
  background: #0f0f0f; border-radius: 16px; overflow: hidden;
  border: 2px solid #333; display: flex; align-items: center; justify-content: center;
}
.preview-placeholder { text-align: center; color: #666; font-size: 1.2rem; line-height: 1.6; }

.tv-icon {
  display: inline-flex; align-items: center; justify-content: center;
  background: #f97316; border-radius: 12px; padding: 8px 16px;
  position: relative; box-shadow: 0 4px 20px rgba(249, 115, 22, 0.4);
}
.tv-icon::before {
  content: ''; position: absolute; top: -10px; left: 50%;
  transform: translateX(-50%); width: 20px; height: 12px;
  background: #f97316; border-radius: 4px 4px 0 0;
}
.tv-icon .tv-text { font-weight: 700; font-size: 1.4rem; letter-spacing: -0.5px; }
.tv-icon .orange { color: #fff; }
.tv-icon .green { color: #22c55e; }
.tv-icon.large { padding: 20px 40px; border-radius: 20px; }
.tv-icon.large .tv-text { font-size: 3rem; }
.tv-icon.large::before { width: 40px; height: 20px; top: -16px; }

/* Responsive */
@media (max-width: 800px) {
  .chat-layout { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .left-panel { border-right: none; border-bottom: 1px solid #222; }
  .chat-box { height: 160px; }
  .bottom-controls { grid-template-columns: 1fr 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero-right { display: none; }
}

/* ========== MOBILE (celular) ========== */
@media (max-width: 600px) {
  .chat-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    margin-top: 0;
  }
  .video-panel { min-height: 0; }
  .left-panel { border: none; }
  .right-panel { min-height: 45vh; }
  .partner-video-wrap { min-height: 0; }
  .local-preview { transform: scaleX(-1); }
  .partner-placeholder { font-size: 1rem; gap: 16px; }
  .partner-placeholder svg { width: 64px; height: 64px; }
  .chat-box {
    height: 140px;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    margin: 10px 12px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: none;
  }
  .chat-input-wrap {
    background: rgba(255,255,255,0.05);
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  #chatInput {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
  }
  #chatInput:focus { border-color: #22c55e; }
  .msg {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.06);
  }
  .msg.mine {
    background: rgba(37,99,235,0.5);
  }
  .msg.theirs {
    background: rgba(51,51,51,0.6);
  }
  .system-msg {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.06);
    color: #aaa;
  }
  .bottom-controls {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 12px;
  }
  .big-btn {
    padding: 14px 6px;
    font-size: 0.95rem;
  }
  .big-btn.country,
  .big-btn.gender { display: none; }
  .dropdown {
    width: 95vw;
    left: 50%;
    transform: translateX(-50%);
  }
  .top-share { top: 4px; gap: 4px; }
  .share-btn { padding: 4px 8px; font-size: 0.75rem; }
  .status-overlay {
    bottom: 16px;
    font-size: 0.9rem;
    padding: 8px 20px;
  }
  .volume-bar { display: none; }
  .online-line { font-size: 0.9rem; }
  .swipe-hint {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    pointer-events: none;
    z-index: 5;
    text-align: center;
  }
}
