/* ==========================================================================
   EDGE AI INFINITE - DEDICATED PHONE CALL INTERFACE STYLING
   ========================================================================== */

:root {
  --color-bg-page: #050508;
  --color-orange-glow: rgba(255, 107, 0, 0.15);
  --color-blue-glow: rgba(59, 130, 246, 0.08);
  
  --phone-width: 370px;
  --phone-height: 760px;
  --phone-radius: 46px;
  --phone-border-color: #1a1a1f;
  
  --color-accent-orange: #ff6b00;
  --color-accent-orange-hover: #ff8533;
  --color-accent-gold: #c5a880;
  --color-active-red: #ef4444;
  --color-active-red-hover: #f87171;
  --color-control-grey: #2a2a35;
  --color-control-grey-hover: #3a3a4b;
}

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

body {
  background-color: var(--color-bg-page);
  color: #ffffff;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Ambient Backlighting */
.background-glows {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.glow-leak {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
}

.glow-orange {
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 450px;
  height: 450px;
  background-color: var(--color-orange-glow);
  opacity: 0.8;
}

.glow-dark-blue {
  bottom: 10%;
  left: 30%;
  width: 600px;
  height: 600px;
  background-color: var(--color-blue-glow);
  opacity: 0.6;
}

/* Page Layout Container */
.page-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 20px;
  align-items: center;
}

/* Header navigation */
.call-page-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #a1a1aa;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.3s ease, transform 0.3s ease;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.back-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(-4px);
}

.brand-logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
}

/* Phone Simulator Layout */
.phone-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
  width: 100%;
}

.phone-container {
  position: relative;
  width: var(--phone-width);
  height: var(--phone-height);
  z-index: 5;
  user-select: none;
}

/* Side Hardware Buttons */
.button-hardware {
  position: absolute;
  background: #111115;
  width: 4px;
  border-radius: 3px 0 0 3px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-right: none;
}

.vol-up {
  top: 150px;
  left: -4px;
  height: 50px;
}

.vol-down {
  top: 215px;
  left: -4px;
  height: 50px;
}

.lock-btn {
  top: 180px;
  right: -4px;
  left: auto;
  width: 4px;
  height: 75px;
  border-radius: 0 3px 3px 0;
  border-left: none;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

/* Outer Phone Frame styling */
.phone-frame {
  width: 100%;
  height: 100%;
  border-radius: var(--phone-radius);
  background: #09090b;
  padding: 11px;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.8),
    0 0 0 3px #2d2d35,
    inset 0 0 3px 1px rgba(255, 255, 255, 0.2);
  border: 1px solid var(--phone-border-color);
  position: relative;
}

/* Inner Phone Screen */
.phone-screen {
  width: 100%;
  height: 100%;
  background: #000000;
  border-radius: calc(var(--phone-radius) - 10px);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.9);
}

/* Glare & Reflection overlay */
.screen-reflection {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 50%, rgba(255,255,255,0) 100%);
  z-index: 50;
  pointer-events: none;
  border-radius: calc(var(--phone-radius) - 10px);
}

/* Camera Notch (Dynamic Island style) */
.phone-notch {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 25px;
  background: #000000;
  border-radius: 13px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.notch-camera {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle, #0e122b 0%, #000 60%);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.2);
}

.notch-speaker {
  width: 45px;
  height: 3px;
  background: #111;
  border-radius: 2px;
  box-shadow: inset 0 0.5px 1px rgba(255,255,255,0.1);
}

/* Screen Core Content Container */
.screen-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px 20px 30px;
  position: relative;
  z-index: 10;
}

/* Status Bar */
.screen-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.01em;
}

.status-time {
  padding-left: 6px;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 6px;
}

.status-network {
  font-size: 9px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 3px;
  border-radius: 3px;
}

.battery-icon {
  width: 20px;
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 3px;
  padding: 1px;
  position: relative;
  display: flex;
  align-items: center;
}

.battery-icon::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 2px;
  width: 2px;
  height: 4px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 0 1px 1px 0;
}

.battery-level {
  width: 85%;
  height: 100%;
  background: #ffffff;
  border-radius: 1px;
}

/* Agent Profile details */
.agent-profile {
  text-align: center;
  margin-top: 15px;
  z-index: 15;
}

.call-link-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 107, 0, 0.08);
  border: 1px solid rgba(255, 107, 0, 0.2);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 9px;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--color-accent-orange);
  margin-bottom: 12px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--color-accent-orange);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-accent-orange);
  animation: glow-pulse 1.5s infinite ease-in-out;
}

.agent-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #ffffff 40%, #ff8533 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2px;
}

.agent-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-accent-gold);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Canvas & Glowing Orb Container */
.orb-container {
  position: relative;
  width: 100%;
  height: 240px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0;
}

#orb-canvas {
  width: 100%;
  height: 100%;
  z-index: 12;
}

.orb-glow-back {
  position: absolute;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(255, 107, 0, 0.2) 0%, rgba(255, 60, 0, 0) 70%);
  border-radius: 50%;
  filter: blur(15px);
  z-index: 10;
  pointer-events: none;
  animation: orb-back-pulse 4s infinite ease-in-out;
}

/* Call Metadata information */
.call-meta {
  text-align: center;
  margin-bottom: 10px;
}

.call-status {
  font-size: 14px;
  font-weight: 400;
  color: #a1a1aa;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
  transition: color 0.3s ease;
}

.call-status.active {
  color: var(--color-accent-orange);
}

.call-timer {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transform: translateY(5px);
  transition: all 0.4s ease;
}

.call-timer.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Custom Interactive Call Controls */
.call-controls {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 90px;
}

/* Control Buttons Base */
.ctrl-btn {
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

/* Start Call (Idle state) Button */
.start-call-btn {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: #ffffff;
  box-shadow: 
    0 8px 24px rgba(16, 185, 129, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.start-call-btn:hover {
  transform: scale(1.06);
  box-shadow: 
    0 12px 30px rgba(16, 185, 129, 0.5),
    0 0 20px rgba(16, 185, 129, 0.2);
}

.start-call-btn:active {
  transform: scale(0.96);
}

/* Active Control Buttons Group */
.active-controls-group {
  display: flex;
  align-items: center;
  gap: 34px;
  animation: controls-fade-in 0.4s ease-out;
}

.active-controls-group.hidden {
  display: none;
}

/* Hang up Button */
.hangup-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-active-red) 0%, #b91c1c 100%);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.hangup-btn:hover {
  background: linear-gradient(135deg, var(--color-active-red-hover) 0%, #dc2626 100%);
  transform: scale(1.05) rotate(135deg);
  box-shadow: 0 12px 28px rgba(239, 68, 68, 0.5);
}

.hangup-btn:active {
  transform: scale(0.96) rotate(135deg);
}

/* Mute Button */
.mute-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--color-control-grey);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.mute-btn:hover {
  background: var(--color-control-grey-hover);
  color: #ffffff;
  transform: translateY(-2px);
}

.mute-btn.muted {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-active-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
}

.mute-btn.muted:hover {
  background: rgba(239, 68, 68, 0.25);
}

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

.hidden {
  display: none !important;
}

/* Call page footer styling */
.call-page-footer {
  width: 100%;
  text-align: center;
  font-size: 11px;
  color: #4a4a52;
  margin-top: 20px;
}

/* Position native Retell Widget directly behind the smartphone inside the viewport.
   This satisfies browser security checks for background audio/WebRTC capture (which blocks
   media capture when the requesting element is positioned off-screen). */
#retell-widget-root {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 350px !important;
  height: 500px !important;
  opacity: 0.01 !important;
  pointer-events: none !important;
  z-index: 2 !important; /* Behind the phone mockup (which has z-index: 5) */
  display: block !important;
  visibility: visible !important;
  overflow: hidden !important;
}

/* Animations */
@keyframes glow-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 107, 0, 0.6);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 107, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 107, 0, 0);
  }
}

@keyframes orb-back-pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.9;
  }
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}

@keyframes controls-fade-in {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
