/* ITA Browser Call — shared styles */

:root {
  --ita-bc-accent: #0b6e4f;
  --ita-bc-accent-hover: #095c42;
  --ita-bc-danger: #b42318;
  --ita-bc-surface: #0f1c17;
  --ita-bc-text: #f4f7f5;
  --ita-bc-muted: #a8b5af;
  --ita-bc-radius: 16px;
  --ita-bc-shadow: 0 12px 40px rgba(8, 28, 20, 0.35);
}

/* —— Frontend widget —— */
.ita-bc-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99990;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.ita-bc-fab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  cursor: pointer;
  color: var(--ita-bc-text);
  background: linear-gradient(145deg, #12805f 0%, var(--ita-bc-accent) 55%, #084c38 100%);
  padding: 14px 18px;
  border-radius: 999px;
  box-shadow: var(--ita-bc-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ita-bc-fab:hover,
.ita-bc-fab:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 44px rgba(8, 28, 20, 0.45);
  outline: none;
}

.ita-bc-fab[hidden] {
  display: none !important;
}

.ita-bc-fab-label {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.ita-bc-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: min(320px, calc(100vw - 32px));
  background: var(--ita-bc-surface);
  color: var(--ita-bc-text);
  border-radius: var(--ita-bc-radius);
  box-shadow: var(--ita-bc-shadow);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ita-bc-panel[hidden] {
  display: none !important;
}

.ita-bc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ita-bc-close {
  border: 0;
  background: transparent;
  color: var(--ita-bc-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.ita-bc-panel-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ita-bc-panel-body p {
  margin: 0;
  color: var(--ita-bc-muted);
  font-size: 14px;
  line-height: 1.4;
}

.ita-bc-name-field {
  font-size: 12px;
  color: var(--ita-bc-muted);
}

.ita-bc-panel-body input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ita-bc-text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
}

.ita-bc-btn {
  border: 0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ita-bc-text);
}

.ita-bc-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ita-bc-btn.primary {
  background: var(--ita-bc-accent);
}

.ita-bc-btn.primary:hover:not(:disabled) {
  background: var(--ita-bc-accent-hover);
}

.ita-bc-btn.danger {
  background: var(--ita-bc-danger);
}

.ita-bc-btn[hidden] {
  display: none !important;
}

.ita-bc-panel.is-calling .ita-bc-panel-head {
  animation: ita-bc-pulse-bar 1.4s ease-in-out infinite;
}

@keyframes ita-bc-pulse-bar {
  0%, 100% { background: rgba(18, 128, 95, 0.2); }
  50% { background: rgba(18, 128, 95, 0.45); }
}

/* —— Admin console —— */
.ita-bc-admin-wrap .ita-bc-console {
  max-width: 640px;
  margin-top: 16px;
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 12px;
  padding: 24px;
}

.ita-bc-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.ita-bc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.ita-bc-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  background: #9ca3af;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.25);
}

.ita-bc-dot.online {
  background: #12b76a;
  box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.25);
}

.ita-bc-dot.offline {
  background: #f04438;
  box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.2);
}

.ita-bc-incoming[hidden],
.ita-bc-active[hidden],
.ita-bc-idle[hidden] {
  display: none !important;
}

.ita-bc-incoming-card {
  text-align: center;
  padding: 28px 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ecfdf5 0%, #f8fafc 100%);
  border: 1px solid #a7f3d0;
  position: relative;
}

.ita-bc-ring-anim {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--ita-bc-accent);
  animation: ita-bc-ring 1.2s ease-out infinite;
}

@keyframes ita-bc-ring {
  0% { box-shadow: 0 0 0 0 rgba(11, 110, 79, 0.55); transform: scale(1); }
  70% { box-shadow: 0 0 0 22px rgba(11, 110, 79, 0); transform: scale(1.05); }
  100% { box-shadow: 0 0 0 0 rgba(11, 110, 79, 0); transform: scale(1); }
}

.ita-bc-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

.ita-bc-active {
  text-align: center;
  padding: 20px;
  background: #f0fdf4;
  border-radius: 12px;
  border: 1px solid #bbf7d0;
}

.ita-bc-active #ita-bc-timer {
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  margin: 8px 0 16px;
}

.ita-bc-idle {
  color: #64748b;
  padding: 24px;
  text-align: center;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
}

@media (max-width: 480px) {
  .ita-bc-fab-label {
    display: none;
  }

  .ita-bc-fab {
    padding: 16px;
  }

  .ita-bc-widget {
    right: 14px;
    bottom: 14px;
  }
}
