/* ============================================
   Voice Center — Webphone Widget CSS
   ============================================ */

/* Floating Widget Container */
.webphone-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Inter', sans-serif;
}

/* FAB Button */
.wp-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed 0%, #533483 100%);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4), 0 2px 8px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
}

.wp-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(124, 58, 237, 0.5);
}

.wp-fab:active { transform: scale(0.95); }

.wp-status-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #0a0a1a;
}

.wp-status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.wp-status-dot.offline { background: #64748b; }

.wp-status-dot.online::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid #22c55e;
  animation: wp-pulse-ring 2s ease-in-out infinite;
  opacity: 0;
}

@keyframes wp-pulse-ring {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* Panel */
.wp-panel {
  position: absolute;
  bottom: 68px;
  right: 0;
  width: 320px;
  background: rgba(18, 18, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 20px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.5), 0 0 30px rgba(124, 58, 237, 0.1);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.wp-panel.expanded {
  max-height: 600px;
  opacity: 1;
  pointer-events: auto;
  overflow: visible;
}

/* Panel Header */
.wp-header {
  padding: 14px 20px;
  background: rgba(26, 26, 62, 0.8);
  border-bottom: 1px solid rgba(124, 58, 237, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wp-header-title {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
}

.wp-status-text {
  font-size: 11px;
  color: #22c55e;
  font-weight: 500;
}

.wp-status-text.error { color: #ef4444; }

/* Idle View */
.wp-idle {
  padding: 24px 20px;
  text-align: center;
}

.wp-idle-icon { font-size: 48px; margin-bottom: 8px; opacity: 0.6; }
.wp-idle-text { font-size: 13px; color: #94a3b8; margin-bottom: 16px; }

.wp-quick-dial-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: white;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.wp-quick-dial-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
}

/* Dial View */
.wp-dial { padding: 16px 20px; }

.wp-dial-input-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.wp-dial-input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(20, 20, 46, 0.8);
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  letter-spacing: 1px;
  text-align: center;
}

.wp-dial-input:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.wp-dial-input::placeholder {
  color: #64748b;
  font-size: 13px;
  letter-spacing: 0;
  font-family: 'Inter', sans-serif;
}

/* Dial Pad Grid */
.wp-dialpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.wp-key {
  height: 48px;
  border: 1px solid #2a2a4a;
  border-radius: 12px;
  background: rgba(26, 26, 62, 0.6);
  color: #e2e8f0;
  font-size: 18px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wp-key:hover {
  background: rgba(124, 58, 237, 0.2);
  border-color: #7c3aed;
}

.wp-key:active {
  transform: scale(0.93);
  background: rgba(124, 58, 237, 0.35);
}

.wp-dial-actions { display: flex; gap: 8px; }

.wp-btn-call {
  flex: 1;
  padding: 12px;
  background: #22c55e;
  color: white;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.wp-btn-call:hover {
  background: #16a34a;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
}

.wp-btn-back {
  padding: 12px 16px;
  background: rgba(42, 42, 74, 0.6);
  color: #94a3b8;
  border: 1px solid #2a2a4a;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.wp-btn-back:hover {
  background: rgba(42, 42, 74, 0.9);
  color: #e2e8f0;
}

/* Incoming Call View */
.wp-incoming {
  padding: 24px 20px;
  text-align: center;
}

.wp-incoming .wp-call-icon {
  font-size: 56px;
  animation: wp-ring 1s ease-in-out infinite;
  margin-bottom: 12px;
}

@keyframes wp-ring {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(15deg); }
  50% { transform: rotate(0deg); }
  75% { transform: rotate(-15deg); }
}

.wp-caller-phone {
  font-size: 22px;
  font-weight: 700;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.wp-caller-name {
  font-size: 14px;
  color: #a78bfa;
  font-weight: 500;
  margin-bottom: 4px;
}

.wp-caller-subtext {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 20px;
}

.wp-incoming-actions {
  display: flex;
  gap: 24px;
  justify-content: center;
  padding-bottom: 8px;
}

.wp-btn-answer {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #22c55e;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
  animation: wp-glow-green 2s ease-in-out infinite;
}

@keyframes wp-glow-green {
  0%, 100% { box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 4px 28px rgba(34, 197, 94, 0.7); }
}

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

.wp-btn-reject {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #ef4444;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

.wp-btn-reject:hover { transform: scale(1.1); background: #dc2626; }

/* Calling View */
.wp-calling {
  padding: 24px 20px;
  text-align: center;
}

.wp-calling .wp-call-icon {
  font-size: 48px;
  animation: wp-pulse 1.5s ease-in-out infinite;
  margin-bottom: 12px;
}

@keyframes wp-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.7; }
}

.wp-cancel-btn {
  margin-top: 16px;
  padding: 10px 32px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.wp-cancel-btn:hover { background: #dc2626; }

/* Active Call View */
.wp-active {
  padding: 20px;
  text-align: center;
}

.wp-call-timer {
  font-size: 32px;
  font-weight: 700;
  color: #22c55e;
  font-family: 'JetBrains Mono', monospace;
  margin: 8px 0 4px;
  letter-spacing: 2px;
}

.wp-active-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

.wp-ctrl-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid #2a2a4a;
  background: rgba(26, 26, 62, 0.6);
  color: #e2e8f0;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wp-ctrl-btn:hover {
  background: rgba(124, 58, 237, 0.2);
  border-color: #7c3aed;
}

.wp-ctrl-btn.active {
  background: rgba(124, 58, 237, 0.4);
  border-color: #7c3aed;
  color: #a78bfa;
}

.wp-ctrl-btn.hangup {
  background: #ef4444;
  border-color: #ef4444;
  width: 56px;
  height: 56px;
  font-size: 22px;
}

.wp-ctrl-btn.hangup:hover {
  background: #dc2626;
  transform: scale(1.05);
}

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

/* Responsive */
@media (max-width: 480px) {
  .webphone-widget { bottom: 16px; right: 16px; }
  .wp-panel { width: calc(100vw - 32px); right: 0; bottom: 72px; }
}
