/**
 * Incoming Call Overlay
 * ---------------------
 * Full-screen overlay shown when a Colloq voice call is active in a channel
 * the user belongs to.  Uses the Androma design language with dark-mode card
 * styling, green pulse rings, and slide-up/fade-out transitions.
 */

/* ── Overlay backdrop ── */

.incoming-call-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  animation: incomingCallFadeIn 0.3s ease forwards;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.incoming-call-overlay.is-dismissing {
  animation: incomingCallFadeOut 0.35s ease forwards;
}

/* ── Card ── */

.incoming-call-card {
  width: 380px;
  max-width: calc(100vw - 32px);
  background: #1c1c1e;
  border-radius: 24px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
  padding: 40px 32px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: translateY(40px);
  opacity: 0;
  animation: incomingCallSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.08s forwards;
}

.incoming-call-overlay.is-dismissing .incoming-call-card {
  animation: incomingCallSlideDown 0.3s ease forwards;
}

/* ── "INCOMING CALL" label ── */

.incoming-call-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 28px;
}

/* ── Avatar with pulse rings ── */

.incoming-call-avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin-bottom: 24px;
}

/* Pulse rings */
.incoming-call-avatar-wrap::before,
.incoming-call-avatar-wrap::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid #22c55e;
  opacity: 0;
  animation: incomingCallPulse 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.incoming-call-avatar-wrap::after {
  animation-delay: 0.6s;
}

.incoming-call-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.incoming-call-avatar-fallback {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 600;
  color: #fff;
  user-select: none;
}

/* ── Caller info ── */

.incoming-call-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
  line-height: 1.3;
}

.incoming-call-channel {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 36px;
  line-height: 1.4;
}

/* ── Action buttons row ── */

.incoming-call-actions {
  display: flex;
  align-items: flex-start;
  gap: 56px;
}

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

.incoming-call-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.2s ease;
  outline: none;
}

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

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

.incoming-call-btn--decline {
  background: #dc2626;
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.35);
}

.incoming-call-btn--decline:hover {
  box-shadow: 0 6px 28px rgba(220, 38, 38, 0.5);
}

.incoming-call-btn--accept {
  background: #22c55e;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.35);
}

.incoming-call-btn--accept:hover {
  box-shadow: 0 6px 28px rgba(34, 197, 94, 0.5);
}

.incoming-call-btn svg {
  width: 24px;
  height: 24px;
  color: #fff;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Rotated phone icon for decline */
.incoming-call-btn--decline svg {
  transform: rotate(135deg);
}

.incoming-call-action-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
}

/* ── Keyframe animations ── */

@keyframes incomingCallFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes incomingCallFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

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

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

@keyframes incomingCallPulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.7);
    opacity: 0;
  }
}

/* ── Responsive tweaks ── */

@media (max-width: 440px) {
  .incoming-call-card {
    padding: 32px 24px 28px;
  }

  .incoming-call-actions {
    gap: 40px;
  }
}
