﻿/* CallInYou - Gaya umum */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --danger-dark: #b91c1c;
  --success: #16a34a;
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Landing */
.landing-page .container {
  max-width: 700px;
  margin: 80px auto;
  padding: 0 20px;
  text-align: center;
}
.landing-page h1 { font-size: 2.5rem; margin-bottom: 8px; color: var(--primary); }
.landing-page p { font-size: 1.1rem; color: var(--muted); margin-bottom: 24px; }
.auth-buttons { margin-bottom: 40px; }
.features { text-align: left; margin-top: 40px; }
.features h2 { margin-bottom: 16px; color: var(--text); }
.features li { margin: 8px 0; color: var(--muted); }
footer { margin-top: 60px; color: var(--muted); font-size: 0.9rem; }
/* Auth */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.auth-card {
  background: var(--card);
  padding: 40px 32px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  width: 100%;
  max-width: 400px;
}
.auth-card h2 { margin-bottom: 24px; color: var(--primary); text-align: center; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.95rem; color: var(--text); }
.form-group input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 1rem; outline: none;
}
.form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.btn {
  display: inline-block; width: 100%; padding: 10px 14px; border: none;
  border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: background 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--muted); color: #fff; margin-top: 10px; }
.btn-secondary:hover { opacity: 0.9; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: #f9fafb; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-dark); }
.btn-sm { padding: 6px 10px; font-size: 0.85rem; }
.btn-icon { padding: 8px 12px; font-size: 1.1rem; }
.alert { padding: 10px 12px; border-radius: 8px; margin-bottom: 16px; font-size: 0.95rem; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.auth-footer { margin-top: 16px; font-size: 0.9rem; color: var(--muted); text-align: center; }
.auth-footer a { font-weight: 600; }
/* App layout */
.app-page, .call-page, .admin-page { min-height: 100vh; }
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 12px 24px; position: sticky; top: 0; z-index: 50;
}
.nav-brand { font-weight: 800; font-size: 1.25rem; color: var(--primary); }
.nav-user { font-size: 0.95rem; color: var(--muted); }
.navbar .btn-outline { padding: 6px 12px; font-size: 0.9rem; margin-left: 8px; }
.container { max-width: 900px; margin: 32px auto; padding: 0 20px; }
h1 { font-size: 1.75rem; margin-bottom: 8px; }
.subtitle { color: var(--muted); margin-bottom: 24px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; margin-bottom: 24px; box-shadow: 0 4px 6px rgba(0,0,0,0.04); }
.card h3 { margin-bottom: 16px; font-size: 1.15rem; }
.empty { color: var(--muted); font-style: italic; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 8px; font-size: 0.85rem; color: var(--muted); border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.05em; }
td { padding: 12px 8px; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
tr:last-child td { border-bottom: none; }
/* Call page */
.call-page { background: #0b0c10; color: #eee; min-height: 100vh; }
.call-page .call-wrap { max-width: 900px; margin: 0 auto; padding: 24px; }
.call-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; margin-bottom: 16px;
}
.call-info strong { color: #60a5fa; }
.call-id { font-size: 0.85rem; color: #94a3b8; margin-left: 10px; background: #111827; padding: 4px 10px; border-radius: 6px; border: 1px solid #334155; }
.call-status { font-size: 0.95rem; color: #94a3b8; }
.call-videos { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; min-height: 400px; }
.video-box { background: #000; border: 1px solid #334155; border-radius: 10px; position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.video-box video { width: 100%; height: 100%; object-fit: cover; background: #000; display: block; }
.video-label { position: absolute; bottom: 12px; left: 12px; font-size: 0.9rem; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.8); z-index: 10; }
.pause-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.55); display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: #fff; gap: 8px; font-size: 1rem; z-index: 20; display: none;
}
.pause-overlay .pause-icon { font-size: 3rem; }
.pause-overlay.show { display: flex; }
.call-controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }\n\n/* Incoming call / ringtone visual */\n.call-status.ringing {\n  color: #dc2626;\n  font-weight: 700;\n  animation: ringPulse 1.5s infinite;\n}\n@keyframes ringPulse {\n  0%, 100% { opacity: 1; }\n  50% { opacity: 0.5; }\n}\n.call-wrap.ringing .call-header {\n  border: 2px solid #dc2626;\n  box-shadow: 0 0 20px rgba(220, 38, 38, 0.4);\n}
.hangup-screen { display:flex; flex-direction:column; align-items:center; justify-content:center; height:100%; text-align:center; color:#fff; }
.hangup-screen .hangup-icon { font-size:4rem; margin-bottom:1rem; }
.hangup-screen .hangup-title { font-size:1.5rem; font-weight:700; margin-bottom:0.5rem; }
.hangup-screen .hangup-subtitle { color:#94a3b8; margin-bottom:1.5rem; }
/* Admin fullscreen */
.call-videos:fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  background: #000 !important;
  grid-template-columns: 1fr !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
}
.call-videos:-webkit-full-screen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  background: #000 !important;
  grid-template-columns: 1fr !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
}
.call-videos:fullscreen .video-box,
.call-videos:-webkit-full-screen .video-box {
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.call-videos:fullscreen video,
.call-videos:-webkit-full-screen video {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}
/* Admin */
/* Call page */
.admin-page .navbar { background: #111827; color: #fff; border-bottom-color: #374151; }
.admin-page .nav-brand { color: #60a5fa; }
.admin-page .nav-user { color: #9ca3af; }
.admin-page .navbar a { color: #fff; }
.admin-page .card { border-color: #374151; background: #1f2937; color: #f9fafb; }
.admin-page .card h3 { color: #60a5fa; }
.admin-page table { color: #f9fafb; }
.admin-page th { color: #9ca3af; border-bottom-color: #374151; }
.admin-page td { border-bottom-color: #374151; color: #e5e7eb; }
.admin-page .empty { color: #9ca3af; }
.admin-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700; background: #dc2626; color: #fff;
}
.admin-badge.ok { background: #16a34a; }
.observer-badge { margin-left: 12px; font-size: 0.85rem; color: #60a5fa; font-weight: 700; background: rgba(96,165,250,0.15); border: 1px solid rgba(96,165,250,0.35); padding: 4px 10px; border-radius: 6px; }
.stat-row { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.stat {
  background: #1f2937; border: 1px solid #374151; border-radius: 10px; padding: 16px; flex: 1; min-width: 170px;
}
.stat .val { font-size: 1.75rem; font-weight: 800; color: #60a5fa; }
.stat .lbl { font-size: 0.85rem; color: #9ca3af; margin-top: 4px; }
.monitor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 16px; }
.monitor-card { background: #000; border: 2px solid #374151; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; height: 240px; }
.monitor-card video { width: 100%; height: 100%; object-fit: cover; background: #000; display: block; }
.monitor-card .foot { padding: 8px 12px; background: #111827; border-top: 1px solid #374151; font-size: 0.85rem; color: #9ca3af; display: flex; justify-content: space-between; }
.monitor-card .foot .tag { font-weight: 700; color: #60a5fa; }
/* Online users list item */
.user-list-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
.user-list-item:hover {
  background: #f9fafb;
}
.user-list-item .user-action-btn {
  position: relative;
  z-index: 10;
  border-radius: 4px;
}
.user-list-item .user-dropdown {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 200px;
  display: block;
}
.user-list-item .user-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-list-item .user-dropdown .dropdown-item:hover {
  background: #f0f7ff;
}
.user-list-item .user-dropdown .dropdown-divider {
  border-color: var(--border);
}
.user-list-item.user-selected {
  background: #e7f5ff;
  border-color: #3b82f6;
}
.user-list-item.user-selected .user-dropdown {
  display: block !important;
}
.user-dropdown {
  display: none;
  animation: fadeIn 0.15s;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.no-video { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #4b5563; font-size: 0.95rem; background: #000; }
