/* Dropabyte Call Center — iOS-style phone call UI */

* { box-sizing: border-box; }

:root {
  --bg-1: #0a0a0a;
  --bg-2: #1c1c1e;
  --fg: #ffffff;
  --fg-dim: rgba(255, 255, 255, 0.65);
  --green: #34c759;
  --red: #ff3b30;
  --grey: #2c2c2e;
  --grey-2: #3a3a3c;
  --accent: #ff8a3d;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #000;
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }
.ico { font-size: 22px; }
.lbl { font-size: 11px; letter-spacing: 0.2px; margin-top: 4px; }

/* ---------- Boot screen ---------- */

.boot {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #0a0a0a 0%, #1a0e0a 100%);
  padding: 24px;
}

.boot-card {
  max-width: 360px; width: 100%;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 32px 24px 24px;
  backdrop-filter: blur(20px);
}
.boot-logo { font-size: 64px; margin-bottom: 8px; }
.boot-card h1 { margin: 0; font-size: 28px; font-weight: 700; }
.boot-sub { color: var(--fg-dim); margin: 4px 0 16px; font-size: 14px; }
.boot-status { font-size: 12px; color: var(--fg-dim); margin: 0 0 18px; min-height: 16px; }
.boot-status.error { color: #ff7a7a; }
.boot-status.ok    { color: #7fffa0; }
.boot-cta {
  width: 100%; height: 52px; border: 0; border-radius: 14px;
  background: var(--green); color: white; font-size: 17px; font-weight: 600;
  cursor: pointer; transition: transform 0.06s, opacity 0.2s;
  box-shadow: 0 8px 20px rgba(52, 199, 89, 0.35);
}
.boot-cta:disabled { opacity: 0.4; cursor: not-allowed; }
.boot-cta:not(:disabled):active { transform: scale(0.97); }
.boot-hint { color: var(--fg-dim); font-size: 11px; margin-top: 14px; }

/* ---------- Screen base ---------- */

.screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0c0c0c 0%, #161616 100%);
}

/* ---------- Incoming call ---------- */

.incoming {
  align-items: center; justify-content: space-between;
  padding: 80px 24px 60px;
  animation: fadeIn 0.4s ease;
}
.incoming-top { text-align: center; margin-top: 30px; }
.incoming-avatar {
  width: 130px; height: 130px; border-radius: 50%;
  background: linear-gradient(135deg, #ff8a3d 0%, #d83a1a 100%);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 70px;
  box-shadow: 0 20px 60px rgba(216, 58, 26, 0.5);
  margin-bottom: 24px;
  position: relative;
}
.incoming-avatar.pulse::before,
.incoming-avatar.pulse::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(255, 138, 61, 0.6);
  animation: pulse 1.6s ease-out infinite;
}
.incoming-avatar.pulse::after { animation-delay: 0.8s; }
@keyframes pulse {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0; }
}
.incoming h2 { margin: 0; font-size: 32px; font-weight: 300; letter-spacing: 0.4px; }
.incoming-sub { margin: 6px 0 0; color: var(--fg-dim); font-size: 15px; }
.incoming-tag { margin-top: 26px; color: var(--fg-dim); font-size: 14px; }

.incoming-actions {
  display: flex; gap: 80px; justify-content: center; width: 100%;
}
.incoming-btn {
  width: 78px; height: 78px; border-radius: 50%; border: 0; color: white;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; transition: transform 0.08s, filter 0.2s;
  font-family: var(--font);
}
.incoming-btn:active { transform: scale(0.93); }
.incoming-btn.decline { background: var(--red); box-shadow: 0 8px 24px rgba(255, 59, 48, 0.4); }
.incoming-btn.accept  { background: var(--green); box-shadow: 0 8px 24px rgba(52, 199, 89, 0.4); }
.incoming-btn .ico { font-size: 32px; margin-bottom: 4px; }
.incoming-btn .lbl { font-size: 12px; font-weight: 500; }

/* ---------- Active call ---------- */

.active {
  padding: 40px 16px 20px;
  animation: fadeIn 0.3s ease;
}
.active-top { text-align: center; }
.active-avatar {
  width: 92px; height: 92px; border-radius: 50%;
  background: linear-gradient(135deg, #ff8a3d 0%, #d83a1a 100%);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 48px;
  box-shadow: 0 10px 30px rgba(216, 58, 26, 0.4);
  margin-bottom: 14px;
}
.active h2 { margin: 0; font-size: 26px; font-weight: 400; }
.active-sub { margin: 2px 0 0; color: var(--fg-dim); font-size: 13px; }
.active-timer { margin: 8px 0 0; font-size: 14px; color: var(--fg); font-variant-numeric: tabular-nums; }
.active-state {
  margin: 6px 0 0; color: var(--accent); font-size: 13px; min-height: 18px;
  font-weight: 500;
}

.transcript {
  margin: 18px 12px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 10px 12px;
  max-height: 240px; overflow-y: auto;
  font-size: 14px; line-height: 1.45;
  scrollbar-width: thin;
}
.transcript::-webkit-scrollbar { width: 4px; }
.transcript::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
.transcript .row { margin: 6px 0; display: flex; }
.transcript .row.user { justify-content: flex-end; }
.transcript .row .bubble {
  max-width: 80%; padding: 8px 12px; border-radius: 16px;
  word-wrap: break-word;
}
.transcript .row.agent .bubble { background: rgba(255, 138, 61, 0.15); border: 1px solid rgba(255,138,61,0.3); }
.transcript .row.user  .bubble { background: rgba(255,255,255,0.12); }
.transcript .row .who { font-size: 10px; color: var(--fg-dim); margin: 0 4px 2px; }

.dialpad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  max-width: 260px; margin: 4px auto 10px;
}
.dialpad button {
  height: 48px; border-radius: 50%; border: 0;
  background: var(--grey); color: white; font-size: 22px; cursor: pointer;
  font-family: var(--font);
}
.dialpad button:active { background: var(--grey-2); }

.action-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 24px;
  margin: 18px auto 8px; max-width: 320px;
}
.action {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--grey); color: white; border: 0; cursor: pointer;
  font-family: var(--font);
  transition: background 0.2s, transform 0.08s;
}
.action:active { background: var(--grey-2); transform: scale(0.95); }
.action.active { background: white; color: black; }
.action .ico { font-size: 24px; }
.action .lbl { font-size: 11px; margin-top: 2px; }

.hangup-row { display: flex; justify-content: center; margin-top: 8px; }
.hangup {
  width: 76px; height: 76px; border-radius: 50%; border: 0;
  background: var(--red); color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(255, 59, 48, 0.4);
  transition: transform 0.08s;
}
.hangup:active { transform: scale(0.93); }
.hangup .ico { font-size: 30px; transform: rotate(135deg); }

/* Home indicator at the very bottom (iOS X+) */
.home-bar {
  position: fixed; left: 0; right: 0; bottom: 8px; height: 5px;
  display: flex; justify-content: center; pointer-events: none;
}
.home-bar::before {
  content: ''; width: 134px; height: 5px; background: white; border-radius: 3px; opacity: 0.85;
}

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

/* Small screens: tighten things up */
@media (max-height: 720px) {
  .incoming { padding-top: 40px; padding-bottom: 40px; }
  .incoming-avatar { width: 110px; height: 110px; font-size: 60px; }
  .transcript { max-height: 160px; }
  .action { width: 64px; height: 64px; }
  .action-grid { gap: 14px 18px; }
}
