/* =============================================
   Noor Voice Call — Warm, fashion-forward UI
   ============================================= */

:root {
  --bg:          #FFF8F3;
  --bg-subtle:   #FFF1E8;
  --coral:       #E8836B;
  --coral-light: #F4A999;
  --coral-dark:  #C96650;
  --peach:       #FDDACB;
  --text:        #2C2320;
  --text-muted:  #8C7B74;
  --red:         #D94F4F;
  --red-dark:    #B33B3B;
  --white:       #FFFFFF;
  --mono:        'DM Mono', monospace;
  --sans:        'DM Sans', system-ui, -apple-system, sans-serif;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  min-height: 100dvh;
  padding: 2rem 1.5rem;
  text-align: center;
}

/* ---- Header / Branding ---- */

header {
  margin-bottom: 3rem;
}

header h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-weight: 400;
}

/* ---- State containers ---- */

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.hidden {
  display: none !important;
}

/* ---- Idle: Call button ---- */

.call-ring {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.call-ring::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--peach);
  animation: ring-breathe 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes ring-breathe {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.06); opacity: 1; }
}

.btn-call {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--coral-light), var(--coral));
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 16px rgba(232, 131, 107, 0.35),
    0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-call:hover {
  transform: scale(1.04);
  box-shadow:
    0 6px 24px rgba(232, 131, 107, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.1);
}

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

.hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---- Connecting: Dots animation ---- */

.connecting-dots {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  height: 60px;
}

.connecting-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--coral);
  animation: dot-bounce 1.4s ease-in-out infinite;
}

.connecting-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.connecting-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes dot-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.status-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.connected-text {
  color: var(--coral);
}

/* ---- Connected: Pulse ring ---- */

.pulse-ring {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-ring::before,
.pulse-ring::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--coral-light);
  animation: pulse-expand 2.4s ease-out infinite;
}

.pulse-ring::after {
  animation-delay: 1.2s;
}

@keyframes pulse-expand {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}

.pulse-core {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--coral-light), var(--coral));
  box-shadow: 0 2px 12px rgba(232, 131, 107, 0.3);
  animation: core-breathe 2s ease-in-out infinite;
}

@keyframes core-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* Timer */

.timer {
  font-family: var(--mono);
  font-size: 1.5rem;
  color: var(--text);
  letter-spacing: 0.04em;
  font-weight: 400;
}

/* End call button */

.btn-end {
  margin-top: 1rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--red);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(217, 79, 79, 0.3);
  transition: transform 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-end:hover {
  background: var(--red-dark);
  transform: scale(1.05);
}

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

/* ---- Ended state ---- */

.ended-message {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
}

/* ---- Error box ---- */

.error-box {
  margin-top: 1.5rem;
  padding: 0.85rem 1.25rem;
  background: #FFF0EE;
  border: 1px solid #F5C6C0;
  border-radius: 12px;
  max-width: 320px;
}

.error-box p {
  font-size: 0.85rem;
  color: var(--red-dark);
  line-height: 1.45;
}

/* ---- Responsive tweaks ---- */

@media (max-height: 580px) {
  header {
    margin-bottom: 1.5rem;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .call-ring {
    width: 96px;
    height: 96px;
  }

  .btn-call {
    width: 80px;
    height: 80px;
  }

  .btn-call svg {
    width: 26px;
    height: 26px;
  }
}

@media (min-width: 600px) {
  header h1 {
    font-size: 2.4rem;
  }

  .subtitle {
    font-size: 1.05rem;
  }
}
