:root {
  --bg-primary: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.85);
  --bg-card-hover: rgba(51, 65, 85, 0.9);
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #10b981;
  --success-hover: #059669;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --warning: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.15);
  --glass: backdrop-filter: blur(12px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  user-select: none;
}

body {
  background: transparent;
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 12px;
}

.phone-container {
  width: 100%;
  max-width: 360px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5), 0 0 20px rgba(37, 99, 235, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Header */
.phone-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.3px;
}

.brand svg {
  color: var(--accent);
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  transition: all 0.3s ease;
}

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

.status-dot.connecting {
  background: var(--warning);
  animation: pulse 1.5s infinite;
}

.status-dot.incall {
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Display */
.phone-display {
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 90px;
  justify-content: center;
}

.number-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 26px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 1px;
  outline: none;
}

.number-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 18px;
}

.call-info-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Dialpad Grid */
.dialpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 0 20px 20px 20px;
}

.digit-btn {
  aspect-ratio: 1.35;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.digit-btn:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.digit-btn:active {
  transform: translateY(1px);
  background: rgba(37, 99, 235, 0.2);
}

.digit {
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}

.letters {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  margin-top: 3px;
  text-transform: uppercase;
}

/* Call Actions */
.phone-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 0 20px 24px 20px;
}

.action-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.3);
}

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

.btn-call {
  background: var(--success);
  color: #ffffff;
}

.btn-call:hover {
  background: var(--success-hover);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.btn-hangup {
  background: var(--danger);
  color: #ffffff;
}

.btn-hangup:hover {
  background: var(--danger-hover);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.btn-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

.btn-icon.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* In-Call HUD */
.incall-hud {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px;
  text-align: center;
}

.incall-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  box-shadow: 0 0 25px rgba(37, 99, 235, 0.35);
}

.incall-name {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.incall-timer {
  font-size: 14px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 24px;
}

.incall-controls {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

/* Incoming Call Modal */
.incoming-modal {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.incoming-title {
  color: var(--text-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.incoming-name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.incoming-number {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.incoming-actions {
  display: flex;
  gap: 36px;
}

/* Audio visualizer bar */
.audio-waves {
  display: flex;
  gap: 3px;
  align-items: center;
  height: 24px;
  margin-bottom: 16px;
}

.wave-bar {
  width: 3px;
  height: 8px;
  background: #38bdf8;
  border-radius: 2px;
  animation: wave 1.2s infinite ease-in-out;
}

.wave-bar:nth-child(2) { animation-delay: 0.2s; height: 16px; }
.wave-bar:nth-child(3) { animation-delay: 0.4s; height: 24px; }
.wave-bar:nth-child(4) { animation-delay: 0.1s; height: 12px; }
.wave-bar:nth-child(5) { animation-delay: 0.3s; height: 20px; }

@keyframes wave {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}
