/* ==============================================================================
   ParrotGo - Phone Call Interface Style (Bright White / Light Theme)
   Modern, Clean, Authentic Phone Call UI with Crisp White Palette
   ============================================================================== */

:root {
  --bg-app: #f1f5f9;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #16a34a;

  --text-main: #0f172a;
  --text-sub: #475569;
  --text-muted: #94a3b8;

  --color-green: #16a34a;
  --color-green-hover: #15803d;
  --color-red: #ef4444;
  --color-red-hover: #dc2626;
  --color-blue: #2563eb;
  --color-amber: #d97706;

  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body.call-app {
  font-family: var(--font-family);
  background: radial-gradient(circle at 50% 0%, #ffffff 0%, #f8fafc 50%, #edf2f7 100%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  -webkit-font-smoothing: antialiased;
}

.call-container {
  width: 100%;
  max-width: 420px;
  min-height: 640px;
  display: flex;
  flex-direction: column;
}

.screen {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ==============================================================================
   SCREEN 1: SETUP SCREEN (Màn hình khởi động cuộc gọi)
   ============================================================================== */
.setup-screen {
  justify-content: center;
}

.phone-frame {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 28px;
  padding: 36px 30px;
  box-shadow: 0 20px 50px -10px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #16a34a;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.1);
}

.brand-icon {
  width: 24px;
  height: 24px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 0.8rem;
  color: var(--text-sub);
  font-weight: 500;
}

.card-intro {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-sub);
  line-height: 1.55;
}

.setup-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 4px;
}

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

.form-group label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #334155;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.form-control::placeholder {
  color: #94a3b8;
}

.form-control:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--color-green);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.select-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}

.btn-call-action {
  margin-top: 10px;
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 24px -4px rgba(22, 163, 74, 0.4);
  transition: all 0.15s ease;
}

.btn-call-action:hover {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px -4px rgba(22, 163, 74, 0.5);
}

.btn-call-action:active {
  transform: scale(0.98);
}

.phone-svg-icon {
  width: 22px;
  height: 22px;
}

.setup-footer {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ==============================================================================
   SCREEN 2: ACTIVE CALL SCREEN (Màn hình đang gọi điện thoại)
   ============================================================================== */
.active-call-screen {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 32px;
  padding: 34px 26px 36px;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.12), 0 1px 3px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 640px;
}

/* Call Header */
.call-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.call-connection-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 5px 14px;
  border-radius: 9999px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

/* Visual States */
.active-call-screen.speaking .status-dot {
  background-color: var(--color-green);
  box-shadow: 0 0 8px rgba(22, 163, 74, 0.6);
}
.active-call-screen.speaking .call-connection-status {
  color: #15803d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.active-call-screen.listening .status-dot {
  background-color: var(--color-blue);
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.6);
}
.active-call-screen.listening .call-connection-status {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.active-call-screen.thinking .status-dot {
  background-color: var(--color-amber);
  box-shadow: 0 0 8px rgba(217, 119, 6, 0.6);
}
.active-call-screen.thinking .call-connection-status {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

.caller-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.caller-subtitle {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-sub);
}

.call-timer {
  font-size: 1.05rem;
  font-weight: 600;
  color: #334155;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* Call Body & Realistic Avatar */
.call-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  margin: 16px 0;
  flex: 1;
  justify-content: center;
}

.caller-avatar-wrapper {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(22, 163, 74, 0.35);
  opacity: 0;
  pointer-events: none;
}

.ring-1 { width: 110px; height: 110px; }
.ring-2 { width: 138px; height: 138px; }
.ring-3 { width: 168px; height: 168px; }

/* Subtle pulse ring only when speaking */
.active-call-screen.speaking .avatar-ring {
  animation: audioPulse 2.2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}
.active-call-screen.speaking .ring-2 { animation-delay: 0.7s; }
.active-call-screen.speaking .ring-3 { animation-delay: 1.4s; }

@keyframes audioPulse {
  0% { transform: scale(0.92); opacity: 0.6; }
  100% { transform: scale(1.22); opacity: 0; }
}

.caller-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f8fafc, #edf2f7);
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  transition: all 0.25s ease;
}

.active-call-screen.speaking .caller-avatar {
  border-color: var(--color-green);
  color: #16a34a;
  background: #f0fdf4;
  box-shadow: 0 0 28px rgba(22, 163, 74, 0.25);
}

.active-call-screen.listening .caller-avatar {
  border-color: var(--color-blue);
  color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 28px rgba(37, 99, 235, 0.25);
}

.avatar-icon {
  width: 44px;
  height: 44px;
}

/* Captions Bubble (iOS Live Captions Style - Bright Light) */
.captions-bubble {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.caption-sender {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.caption-body {
  font-size: 0.98rem;
  color: var(--text-main);
  line-height: 1.5;
  font-weight: 500;
  word-break: break-word;
}

/* Call Actions Bar (Realistic Phone Keypad Buttons) */
.call-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding-top: 12px;
}

.action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.action-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1.5px solid #e2e8f0;
  background-color: #f8fafc;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
}

.action-btn:hover {
  background-color: #edf2f7;
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.action-btn:active {
  transform: scale(0.95);
}

.action-btn.active {
  background-color: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.btn-mic:not(.active) {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.btn-speaker:not(.active) {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.action-svg {
  width: 24px;
  height: 24px;
}

.btn-hangup {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: none;
  color: #ffffff;
  box-shadow: 0 6px 20px -2px rgba(239, 68, 68, 0.45);
}

.btn-hangup:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #ffffff;
  box-shadow: 0 8px 24px -2px rgba(220, 38, 38, 0.55);
}

.hangup-svg {
  width: 28px;
  height: 28px;
}

.action-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #64748b;
}
