/* CSS Reset & Variables */
:root {
  --bg-color: #0b0c10;
  --panel-bg: rgba(25, 27, 38, 0.45);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-glow: rgba(139, 92, 246, 0.4);
  
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-glow: rgba(239, 68, 68, 0.4);
  
  --success: #10b981;
  
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

/* Ambient Background Glows */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
}

.bg-glow-1 {
  width: 400px;
  height: 400px;
  top: -100px;
  right: -50px;
  background: radial-gradient(circle, var(--primary) 0%, rgba(0,0,0,0) 70%);
}

.bg-glow-2 {
  width: 500px;
  height: 500px;
  bottom: -150px;
  left: -100px;
  background: radial-gradient(circle, #3b82f6 0%, rgba(0,0,0,0) 70%);
}

/* Application Container */
.app-container {
  width: 100%;
  max-width: 480px;
  height: 85vh;
  max-height: 720px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

/* App Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  font-size: 24px;
}

.logo-text {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.status-badge {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.status-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.status-badge.connected {
  border-color: rgba(16, 185, 129, 0.2);
}

.status-badge.connected .dot {
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
}

/* Main Card - Glassmorphic */
.main-card {
  flex: 1;
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Screens Management */
.screen {
  display: none;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.screen.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

/* Screen Common Elements */
.title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 26px;
  margin-bottom: 12px;
  line-height: 1.2;
}

.subtitle {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 90%;
}

/* Buttons */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  padding: 15px 30px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-icon {
  transition: transform 0.3s ease;
}

.btn:hover .btn-icon {
  transform: scale(1.1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #a78bfa 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--primary-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #f87171 100%);
  color: white;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--danger-glow);
}

.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(45deg);
  transition: all 0.6s ease;
  pointer-events: none;
}

.btn-glow:hover::after {
  left: 120%;
  top: 120%;
}

/* Forms */
.form-group {
  width: 100%;
  margin-bottom: 24px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--panel-border);
  padding: 14px 18px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 15px;
  color: white;
  transition: all 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
  background: rgba(0, 0, 0, 0.3);
}

.disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 16px;
}

/* SCREEN 2: Matching / Radar Animation */
.radar-container {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 40px;
}

.radar-circle {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 1.5px solid var(--primary);
  border-radius: 50%;
  opacity: 0;
  animation: pulse-ring 3s cubic-bezier(0.215, 0.610, 0.355, 1) infinite;
}

.circle-2 {
  animation-delay: 1s;
}

.circle-3 {
  animation-delay: 2s;
}

.radar-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #a78bfa 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  z-index: 2;
  box-shadow: 0 0 20px var(--primary-glow);
}

.radar-icon {
  animation: float 2.5s ease-in-out infinite;
}

/* SCREEN 3: Active Call Screen */
.call-header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
}

.partner-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 36px;
  margin-bottom: 16px;
  box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.05);
}

.timer {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 20px;
  color: var(--success);
  margin-top: 8px;
  letter-spacing: 1px;
}

/* Audio Waves Animation */
.audio-waves {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  height: 80px;
  margin-bottom: 40px;
}

.wave {
  width: 6px;
  height: 10px;
  background-color: var(--primary);
  border-radius: 3px;
  animation: active-wave 1.2s ease-in-out infinite alternate;
}

.wave-1 { animation-delay: 0.1s; height: 15px; }
.wave-2 { animation-delay: 0.3s; height: 25px; }
.wave-3 { animation-delay: 0.6s; height: 40px; }
.wave-4 { animation-delay: 0.2s; height: 50px; }
.wave-5 { animation-delay: 0.5s; height: 45px; }
.wave-6 { animation-delay: 0.7s; height: 30px; }
.wave-7 { animation-delay: 0.4s; height: 20px; }
.wave-8 { animation-delay: 0.2s; height: 12px; }

/* Call Controls */
.call-controls {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.control-btn {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.control-btn.muted {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

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

.btn-hangup {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--danger);
}

.btn-hangup:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--danger);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

/* Animations */
@keyframes pulse-ring {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    transform: scale(1.1);
    opacity: 0;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes active-wave {
  0% {
    transform: scaleY(1);
    background-color: var(--primary);
  }
  100% {
    transform: scaleY(5);
    background-color: #a78bfa;
  }
}

.animate-pulse {
  animation: pulse-text 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-text {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: .5;
  }
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Proximity / Cheek Protection Lock Screen */
#proximity-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000000;
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}

.proximity-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #374151; /* Dark grey text to keep the screen dark */
  font-family: var(--font-body);
  max-width: 80%;
}

.lock-icon {
  font-size: 48px;
  margin-bottom: 24px;
  opacity: 0.15;
  animation: float 3s ease-in-out infinite;
}

.lock-title {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.lock-desc {
  font-size: 14px;
  margin-bottom: 30px;
}

.lock-hint {
  font-size: 11px;
  color: #4b5563;
  border: 1px dashed #1f2937;
  padding: 10px 16px;
  border-radius: 12px;
}

