/* ================================================================
   domogle — light theme (Omegle-inspired, non-AI)
   ================================================================ */

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

:root {
  --bg:       #f0f2f5;
  --surface:  #ffffff;
  --surface2: #f9fafb;
  --border:   #e5e7eb;
  --border2:  #d1d5db;
  --blue:     #1a56db;
  --blue-h:   #1245b8;
  --red:      #e02424;
  --red-h:    #c81e1e;
  --green:    #057a55;
  --yellow:   #c27803;
  --orange:   #d03801;
  --text:     #111827;
  --text2:    #374151;
  --muted:    #6b7280;
  --radius:   5px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font-family: inherit; font-size: inherit; }

/* ----------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 7px 18px; border: 1px solid transparent;
  border-radius: var(--radius); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.1s; white-space: nowrap; outline: none;
  text-decoration: none;
}
.btn:active { opacity: 0.85; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary   { background: var(--blue);  color: #fff; border-color: var(--blue-h); }
.btn-primary:hover:not(:disabled)   { background: var(--blue-h); }

.btn-danger    { background: var(--red);   color: #fff; border-color: var(--red-h); }
.btn-danger:hover:not(:disabled)    { background: var(--red-h); }

.btn-secondary { background: var(--surface2); color: var(--text); border-color: var(--border2); }
.btn-secondary:hover:not(:disabled) { background: var(--border); }

.btn-ghost  { background: transparent; color: var(--text2); border-color: var(--border2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface2); }

.btn-lg { padding: 11px 28px; font-size: 16px; }
.btn-sm { padding: 5px 12px; font-size: 13px; }

.btn-google  { background: #fff; color: #3c4043; border-color: #dadce0; }
.btn-google:hover  { background: #f8f9fa; }
.btn-discord { background: #5865F2; color: #fff; border-color: #4752c4; }
.btn-discord:hover { background: #4752c4; }

/* ----------------------------------------------------------------
   Form inputs
   ---------------------------------------------------------------- */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text2); }
.form-input {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius); color: var(--text); font-size: 14px;
  padding: 8px 11px; outline: none; width: 100%;
  transition: border-color 0.1s;
}
.form-input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(26,86,219,0.15); }
.form-input::placeholder { color: var(--muted); }
.form-error { color: var(--red); font-size: 12px; }
.form-hint  { color: var(--muted); font-size: 12px; }

/* ----------------------------------------------------------------
   Shared: header nav
   ---------------------------------------------------------------- */
.site-header {
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px; height: 48px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.site-logo {
  font-size: 22px; font-weight: 800; color: var(--text);
  letter-spacing: -0.5px; text-decoration: none;
}
.site-logo:hover { text-decoration: none; }
.header-nav { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.header-user { font-size: 13px; color: var(--muted); }

/* ----------------------------------------------------------------
   Shared: modal
   ---------------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 24px; width: 380px;
  max-width: calc(100vw - 32px);
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}
.modal h3 { font-size: 16px; font-weight: 700; }
.modal p  { font-size: 13px; color: var(--text2); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ----------------------------------------------------------------
   Shared: status badges
   ---------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 3px;
  border: 1px solid transparent;
}
.badge-idle      { background: #f3f4f6; color: var(--muted); border-color: var(--border); }
.badge-searching { background: #fef3c7; color: #92400e;  border-color: #fde68a; }
.badge-connected { background: #d1fae5; color: #065f46;  border-color: #a7f3d0; }
.badge-error     { background: #fee2e2; color: #991b1b;  border-color: #fca5a5; }
.badge-green  { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.badge-red    { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.badge-yellow { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge-blue   { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }

/* ----------------------------------------------------------------
   Shared: GDPR consent banner
   ---------------------------------------------------------------- */
#consent-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #1f2937; color: #e5e7eb;
  padding: 12px 24px; display: flex; align-items: center; gap: 16px;
  z-index: 999; flex-wrap: wrap; border-top: 1px solid #374151;
}
#consent-banner p { font-size: 13px; flex: 1; min-width: 200px; }
#consent-banner a { color: #93c5fd; }
#consent-banner .consent-btns { display: flex; gap: 8px; flex-shrink: 0; }

/* ----------------------------------------------------------------
   Shared: interest tags input
   ---------------------------------------------------------------- */
.tags-container {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px; padding: 6px 10px;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius); min-height: 36px; cursor: text;
}
.tags-container:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(26,86,219,0.15); }
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd;
  border-radius: 3px; padding: 1px 7px; font-size: 12px; font-weight: 600;
}
.tag-chip button {
  background: none; border: none; cursor: pointer;
  color: #3b82f6; font-size: 13px; line-height: 1; padding: 0; margin-left: 2px;
}
.tag-chip button:hover { color: #1d4ed8; }
.tags-input-field {
  border: none; outline: none; background: transparent;
  font-size: 13px; color: var(--text); min-width: 100px; flex: 1;
}
.tags-input-field::placeholder { color: var(--muted); }

/* oauth icon */
.oauth-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* ================================================================
   HOME PAGE
   ================================================================ */
.home-body { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }

.home-hero {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 24px; text-align: center;
}
.home-logo-big {
  font-size: 52px; font-weight: 900; color: var(--text);
  letter-spacing: -2px; margin-bottom: 8px;
}
.home-logo-big span { color: var(--blue); }
.home-tagline {
  font-size: 18px; color: var(--muted); max-width: 420px;
  margin: 0 auto 32px;
}
.home-interests-row {
  width: 100%; max-width: 560px; margin: 0 auto 20px;
}
.home-interests-label {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; text-align: left;
}
.home-cta-group {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; margin-bottom: 40px;
}
.home-features {
  display: flex; gap: 0; border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; max-width: 560px;
  background: var(--surface);
}
.feature-card {
  flex: 1; padding: 16px 18px; border-right: 1px solid var(--border);
}
.feature-card:last-child { border-right: none; }
.feature-icon { font-size: 20px; margin-bottom: 6px; }
.feature-title { font-size: 13px; font-weight: 700; margin-bottom: 3px; color: var(--text); }
.feature-desc  { font-size: 12px; color: var(--muted); }
.home-notice {
  margin-top: 24px; font-size: 12px; color: var(--muted); max-width: 500px;
  line-height: 1.6;
}
.home-footer {
  padding: 16px 24px; text-align: center;
  border-top: 1px solid var(--border); background: var(--surface);
  display: flex; gap: 20px; justify-content: center; flex-wrap: wrap;
}
.home-footer a { font-size: 13px; color: var(--muted); }
.home-footer a:hover { color: var(--text2); }

/* ================================================================
   AUTH PAGES
   ================================================================ */
.auth-body {
  min-height: 100vh; background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
}
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 32px; width: 100%; max-width: 400px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.auth-logo { text-align: center; margin-bottom: 4px; }
.auth-logo a { font-size: 26px; font-weight: 900; color: var(--text); letter-spacing: -1px; }
.auth-title { text-align: center; font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.auth-sub   { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.auth-form  { display: flex; flex-direction: column; gap: 14px; }
.auth-submit { margin-top: 4px; }
.auth-divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 12px; margin: 4px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-oauth { display: flex; flex-direction: column; gap: 8px; }
.auth-oauth .btn { width: 100%; }
.auth-switch { text-align: center; font-size: 13px; color: var(--muted); margin-top: 18px; }
.auth-guest  { text-align: center; margin-top: 10px; }
.auth-guest a { font-size: 13px; color: var(--muted); }
.auth-error {
  background: #fee2e2; border: 1px solid #fca5a5;
  border-radius: var(--radius); padding: 9px 12px;
  font-size: 13px; color: #991b1b; display: none;
}
.auth-error.visible { display: block; }

/* ================================================================
   CHAT PAGE (Omegle layout)
   ================================================================ */
.chat-body { height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }

.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px; height: 44px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-logo { font-size: 20px; font-weight: 900; color: var(--text); text-decoration: none; letter-spacing: -0.5px; }
.chat-logo:hover { text-decoration: none; }

/* Top notice bar */
.chat-notice {
  background: #fffbeb; border-bottom: 1px solid #fde68a;
  padding: 6px 16px; font-size: 12px; color: #92400e;
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.chat-notice.connected-notice {
  background: #f0fdf4; border-color: #bbf7d0; color: #065f46;
}

/* Main layout */
.chat-main { display: flex; flex: 1; overflow: hidden; }

/* ---- Left: video column ---- */
/* Width = half the available height → each flex:1 slot is a perfect square */
.video-column {
  width: clamp(260px, calc((100vh - 92px) / 2), 520px);
  flex-shrink: 0; display: flex; flex-direction: column;
  background: #1a1a1a; border-right: 1px solid var(--border);
}

/* Video slots — flex:1 so both split height equally; column width = half height = square */
.video-slot {
  position: relative; flex: 1; background: #000; overflow: hidden;
  display: flex; align-items: center; justify-content: center; min-height: 0;
}
.video-slot video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.video-slot-label {
  position: absolute; top: 8px; left: 10px;
  background: rgba(0,0,0,0.55); color: rgba(255,255,255,0.9);
  font-size: 11px; font-weight: 700; padding: 2px 7px;
  border-radius: 3px; letter-spacing: 0.3px; z-index: 5;
}
.video-slot-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: #555; pointer-events: none;
}
.video-slot-placeholder .ph-icon { font-size: 36px; opacity: 0.5; }
.video-slot-placeholder .ph-text { font-size: 12px; }

/* Watermark on video */
.video-watermark {
  position: absolute; bottom: 8px; right: 10px;
  color: rgba(255,255,255,0.35); font-size: 12px; font-weight: 700;
  letter-spacing: 1px; pointer-events: none; z-index: 5;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  user-select: none;
}

/* Divider between videos */
.video-divider { height: 1px; background: #2a2a2a; flex-shrink: 0; }

.you-slot video { transform: scaleX(-1); } /* mirror local */

/* ---- Right: chat column ---- */
.chat-column {
  flex: 1; display: flex; flex-direction: column;
  background: var(--surface); min-width: 0;
}
.chat-log {
  flex: 1; overflow-y: auto; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.msg { font-size: 14px; line-height: 1.5; word-break: break-word; }
.msg-system {
  color: var(--muted); font-style: italic; font-size: 12px;
  text-align: center; padding: 3px 0; border-bottom: 1px solid var(--border);
  margin: 2px 0;
}
.msg-you .msg-sender     { color: var(--blue);  font-weight: 700; }
.msg-stranger .msg-sender { color: var(--text2); font-weight: 700; }

.chat-input-area {
  border-top: 1px solid var(--border); display: flex; flex-direction: column;
  gap: 0; flex-shrink: 0;
}
.chat-input-row {
  display: flex; gap: 0; align-items: flex-end;
}
#chat-input {
  flex: 1; border: none; border-top: none;
  background: var(--surface); color: var(--text); font-size: 14px;
  padding: 10px 12px; resize: none; outline: none; max-height: 100px;
  overflow-y: auto; line-height: 1.4; border-right: 1px solid var(--border);
}
#chat-input::placeholder { color: var(--muted); }
#chat-input:disabled { background: var(--surface2); }
.btn-send {
  background: var(--blue); color: #fff; border: none;
  padding: 10px 18px; font-size: 13px; font-weight: 700;
  cursor: pointer; flex-shrink: 0; align-self: stretch;
  transition: background 0.1s;
}
.btn-send:hover:not(:disabled) { background: var(--blue-h); }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Bottom controls bar ---- */
.controls-bar {
  border-top: 1px solid var(--border); padding: 8px 12px;
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  background: var(--surface2); flex-wrap: wrap;
}
.controls-left { display: flex; gap: 6px; flex-shrink: 0; }
.controls-divider { width: 1px; height: 24px; background: var(--border); flex-shrink: 0; }
.controls-interests { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.controls-interests-label { font-size: 12px; color: var(--muted); white-space: nowrap; font-weight: 600; }
.controls-interests .tags-container { flex: 1; min-width: 0; padding: 4px 8px; }

.btn-stop { background: var(--red); color: #fff; border-color: var(--red-h); }
.btn-stop:hover:not(:disabled) { background: var(--red-h); }
.btn-skip { background: #fff; color: var(--text); }
.btn-report-sm {
  background: transparent; color: var(--muted);
  border-color: var(--border); font-size: 12px;
  margin-left: auto;
}
.btn-report-sm:hover { color: var(--yellow); border-color: var(--yellow); }

/* ESC hint */
.esc-hint {
  font-size: 11px; color: var(--muted);
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.esc-hint kbd {
  background: var(--border); border: 1px solid var(--border2);
  border-radius: 3px; padding: 1px 5px; font-size: 11px;
  font-family: monospace; color: var(--text2);
}

/* ================================================================
   LEGAL PAGES
   ================================================================ */
.legal-body { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.legal-content { flex: 1; max-width: 720px; margin: 0 auto; padding: 48px 24px; width: 100%; }
.legal-content h1 { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.legal-content .legal-updated { font-size: 13px; color: var(--muted); margin-bottom: 32px; }
.legal-content h2 { font-size: 16px; font-weight: 700; margin: 28px 0 8px; }
.legal-content p  { font-size: 14px; color: var(--text2); margin-bottom: 10px; line-height: 1.7; }
.legal-content ul { padding-left: 18px; margin-bottom: 10px; }
.legal-content li { font-size: 14px; color: var(--text2); margin-bottom: 5px; line-height: 1.6; }
.legal-content strong { color: var(--text); }
.legal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  background: var(--surface);
  text-align: center; display: flex; gap: 20px; justify-content: center;
}
.legal-footer a { font-size: 13px; color: var(--muted); }

/* ================================================================
   ADMIN PANEL
   ================================================================ */
.admin-body { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.admin-layout { display: flex; flex: 1; overflow: hidden; }

.admin-sidebar {
  width: 200px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px 0;
}
.admin-sidebar-title {
  padding: 0 14px 10px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted);
}
.admin-nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; font-size: 13px; color: var(--text2);
  cursor: pointer; transition: background 0.1s;
  border-left: 3px solid transparent;
}
.admin-nav-item:hover  { background: var(--surface2); }
.admin-nav-item.active { background: #eff6ff; color: var(--blue); border-left-color: var(--blue); }
.admin-nav-icon { font-size: 14px; }

.admin-main { flex: 1; overflow-y: auto; padding: 24px; }
.admin-section { display: none; }
.admin-section.active { display: block; }
.admin-page-title { font-size: 20px; font-weight: 800; margin-bottom: 18px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 14px 16px;
}
.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 4px; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--text); }

.admin-table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted);
  background: var(--surface2); border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--text2); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #f9fafb; }
.admin-table .cell-ip { font-family: monospace; font-size: 12px; color: var(--text); }
.admin-table .cell-time { font-size: 11px; color: var(--muted); }
.report-screenshot-thumb {
  width: 60px; height: 44px; object-fit: cover; border-radius: 3px;
  cursor: pointer; border: 1px solid var(--border); transition: transform 0.1s;
}
.report-screenshot-thumb:hover { transform: scale(1.1); }
.screenshot-preview-img { width: 100%; border-radius: 5px; max-height: 300px; object-fit: contain; }

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 680px) {
  .chat-main { flex-direction: column; }
  .video-column { width: 100%; height: 280px; flex-direction: row; border-right: none; border-bottom: 1px solid var(--border); }
  .you-slot { height: auto; width: 120px; flex-shrink: 0; }
  .video-divider { width: 1px; height: auto; }
  .chat-column { height: 0; flex: 1; }
  .home-features { flex-direction: column; }
  .feature-card { border-right: none; border-bottom: 1px solid var(--border); }
  .feature-card:last-child { border-bottom: none; }
  .controls-bar { flex-wrap: wrap; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; flex-direction: row; overflow-x: auto; padding: 8px; border-right: none; border-bottom: 1px solid var(--border); }
  .admin-nav-item { flex-direction: column; font-size: 11px; padding: 8px; border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .admin-nav-item.active { border-left-color: transparent; border-bottom-color: var(--blue); }
}
