/**
 * Everyday Voice™ — Standalone Mobile & Web Softphone App Stylesheet
 */

:root {
  --v-app-bg: #030712;
  --v-app-surface: #0a0f1d;
  --v-app-card: rgba(15, 23, 42, 0.85);
  --v-app-card-hover: rgba(30, 41, 59, 0.9);
  --v-app-border: rgba(255, 255, 255, 0.08);
  --v-app-border-focus: rgba(192, 132, 252, 0.4);
  
  --v-purple: #c084fc;
  --v-purple-glow: rgba(192, 132, 252, 0.35);
  --v-cyan: #38bdf8;
  --v-cyan-glow: rgba(56, 189, 248, 0.3);
  --v-emerald: #10b981;
  --v-emerald-glow: rgba(16, 185, 129, 0.3);
  --v-rose: #f43f5e;
  --v-rose-glow: rgba(244, 63, 94, 0.4);
  --v-amber: #f59e0b;
  
  --v-text-primary: #f8fafc;
  --v-text-muted: #94a3b8;
  --v-text-dim: #64748b;
  
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tab-bar-height: 68px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body.voice-app-body {
  background-color: var(--v-app-bg);
  color: var(--v-text-primary);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(192, 132, 252, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 90% 90%, rgba(56, 189, 248, 0.08) 0%, transparent 45%);
  background-attachment: fixed;
}

/* App Header */
.voice-app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--v-app-border);
  padding: calc(12px + var(--safe-top)) 16px 12px;
}

.voice-app-header-inner {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.voice-app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
}

.voice-app-brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #a855f7 0%, #38bdf8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
}

.sip-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--v-emerald);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.5;
  animation: pulseBeacon 2s infinite;
}

@keyframes pulseBeacon {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(2.2); opacity: 0; }
}

/* App Main Container */
.voice-app-main {
  flex: 1;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 16px calc(var(--tab-bar-height) + var(--safe-bottom) + 20px);
  position: relative;
}

/* Tab Panels */
.tab-panel {
  display: none;
  animation: fadeInTab 0.2s ease-out;
}

.tab-panel.active {
  display: block;
}

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

/* DIALER SCREEN & KEYPAD */
.dialer-card {
  background: var(--v-app-card);
  border: 1px solid var(--v-app-border);
  border-radius: 28px;
  padding: 24px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.dialer-screen-box {
  background: rgba(3, 7, 18, 0.7);
  border: 1px solid var(--v-app-border);
  border-radius: 20px;
  padding: 18px 16px 12px;
  margin-bottom: 24px;
  text-align: center;
  position: relative;
}

.dialer-digits-input {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.85rem;
  font-weight: 800;
  text-align: center;
  outline: none;
  letter-spacing: 0.04em;
}

.dialer-digits-input::placeholder {
  color: #475569;
  font-size: 1.4rem;
  font-weight: 600;
}

.dialer-screen-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.screen-action-btn {
  background: none;
  border: none;
  color: var(--v-text-dim);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: color 0.2s;
}

.screen-action-btn:hover, .screen-action-btn:active {
  color: var(--v-purple);
}

/* DTMF Keypad Grid */
.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 360px;
  margin: 0 auto 24px;
}

.keypad-key {
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--v-app-border);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  user-select: none;
}

.keypad-key:hover {
  background: rgba(192, 132, 252, 0.12);
  border-color: rgba(192, 132, 252, 0.4);
  transform: translateY(-2px);
}

.keypad-key:active {
  background: rgba(192, 132, 252, 0.25);
  transform: scale(0.94);
  box-shadow: 0 0 20px var(--v-purple-glow);
}

.key-digit {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
}

.key-sub {
  font-size: 0.65rem;
  color: var(--v-text-muted);
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-top: 2px;
  text-transform: uppercase;
}

/* Dial Action Button */
.dial-action-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.btn-call-trigger {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px var(--v-emerald-glow);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-call-trigger:hover {
  transform: scale(1.06);
  box-shadow: 0 14px 40px var(--v-emerald-glow);
}

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

/* ACTIVE CALL OVERLAY MODAL */
.active-call-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(3, 7, 18, 0.96);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(40px + var(--safe-top)) 24px calc(40px + var(--safe-bottom));
  animation: callOverlaySlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.active-call-overlay.active {
  display: flex;
}

@keyframes callOverlaySlide {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.call-avatar-ring {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(168,85,247,0.3) 0%, rgba(56,189,248,0.2) 100%);
  border: 2px solid var(--v-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  color: #fff;
  margin-bottom: 20px;
  position: relative;
  box-shadow: 0 0 40px var(--v-purple-glow);
}

.call-in-controls-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 320px;
  width: 100%;
  margin: 30px 0;
}

.call-control-btn {
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--v-app-border);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.call-control-btn.active {
  background: #fff;
  color: #030712;
  border-color: #fff;
}

.call-control-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-end-call {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: #fff;
  border: none;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px var(--v-rose-glow);
  transition: all 0.2s;
}

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

/* LIST CARDS (RECENTS, VOICEMAIL, CONTACTS, SMS) */
.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-title-sm {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.app-card-item {
  background: var(--v-app-card);
  border: 1px solid var(--v-app-border);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: all 0.2s;
}

.app-card-item:hover {
  background: var(--v-app-card-hover);
  border-color: var(--v-app-border-focus);
}

.item-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  flex-shrink: 0;
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-subtitle {
  font-size: 0.8rem;
  color: var(--v-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

/* Visual Voicemail Card */
.voicemail-player-box {
  background: rgba(3, 7, 18, 0.6);
  border: 1px solid var(--v-app-border);
  border-radius: 14px;
  padding: 12px;
  margin-top: 10px;
}

.transcript-pill {
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.5;
  background: rgba(192, 132, 252, 0.08);
  border: 1px solid rgba(192, 132, 252, 0.2);
  padding: 8px 12px;
  border-radius: 10px;
  margin-top: 8px;
}

/* SMS Messaging View */
.sms-thread-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 380px;
  overflow-y: auto;
  padding: 12px;
  background: rgba(3, 7, 18, 0.6);
  border: 1px solid var(--v-app-border);
  border-radius: 20px;
  margin-bottom: 14px;
}

.sms-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.sms-bubble.incoming {
  align-self: flex-start;
  background: #1e293b;
  color: #f8fafc;
  border-bottom-left-radius: 4px;
}

.sms-bubble.outgoing {
  align-self: flex-end;
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.sms-input-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sms-text-input {
  flex: 1;
  background: #0b1120;
  border: 1px solid var(--v-app-border);
  border-radius: 14px;
  padding: 12px 16px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
}

.sms-text-input:focus {
  border-color: var(--v-purple);
}

.btn-sms-send {
  background: var(--v-purple);
  color: #fff;
  border: none;
  border-radius: 14px;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
}

/* BOTTOM MOBILE NAVIGATION TAB BAR */
.voice-app-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tab-bar-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(3, 7, 18, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--v-app-border);
  z-index: 500;
  display: flex;
  justify-content: center;
}

.bottom-nav-inner {
  max-width: 600px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 10px;
}

.nav-tab-item {
  background: none;
  border: none;
  color: var(--v-text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  flex: 1;
  padding: 8px 0;
  transition: all 0.2s;
  position: relative;
}

.nav-tab-item.active {
  color: var(--v-purple);
}

.nav-tab-icon {
  font-size: 1.25rem;
  position: relative;
}

.nav-tab-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav-badge-dot {
  position: absolute;
  top: -2px;
  right: -6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--v-rose);
  border: 2px solid var(--v-app-bg);
}
