/* ─── FreePBX Click2Call Pro – Widget Styles ─── */

/* Base widget */
.c2c-widget {
  --c2c-primary:    #0073aa;
  --c2c-primary-dk: #005a87;
  --c2c-success:    #28a745;
  --c2c-danger:     #dc3545;
  --c2c-text:       #2c3e50;
  --c2c-muted:      #6c757d;
  --c2c-bg:         #ffffff;
  --c2c-border:     #dee2e6;
  --c2c-radius:     12px;
  --c2c-shadow:     0 4px 20px rgba(0,0,0,0.10);

  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 380px;
  background: var(--c2c-bg);
  border: 1px solid var(--c2c-border);
  border-radius: var(--c2c-radius);
  padding: 24px;
  box-shadow: var(--c2c-shadow);
  color: var(--c2c-text);
}

/* ── Themes ─────────────────────────────────────── */
.c2c-theme-blue   { --c2c-primary: #0073aa; --c2c-primary-dk: #005a87; }
.c2c-theme-green  { --c2c-primary: #1a7f4b; --c2c-primary-dk: #145c37; }
.c2c-theme-dark   {
  --c2c-primary: #4f9cf9; --c2c-primary-dk: #3a86e8;
  --c2c-bg: #1a1d24; --c2c-text: #e8eaf0; --c2c-border: #2f3240;
  --c2c-muted: #9aa0b4;
}
.c2c-theme-minimal {
  --c2c-shadow: none;
  border-color: transparent;
  padding: 0;
}

/* ── Header ─────────────────────────────────────── */
.c2c-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}
.c2c-icon { font-size: 2rem; line-height: 1; flex-shrink: 0; }
.c2c-title {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c2c-text);
  line-height: 1.3;
}
.c2c-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--c2c-muted);
  line-height: 1.4;
}

/* ── Input group ─────────────────────────────────── */
.c2c-input-group {
  position: relative;
  margin-bottom: 10px;
}
.c2c-flag {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
}
.c2c-phone-input,
.c2c-name-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px 11px 38px;
  border: 1.5px solid var(--c2c-border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--c2c-bg);
  color: var(--c2c-text);
  transition: border-color 0.2s;
}
.c2c-name-input { padding-left: 14px; }
.c2c-phone-input:focus,
.c2c-name-input:focus {
  outline: none;
  border-color: var(--c2c-primary);
  box-shadow: 0 0 0 3px rgba(0,115,170,0.15);
}

/* ── Call buttons ────────────────────────────────── */
.c2c-call-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, opacity 0.2s;
  margin-top: 6px;
}
.c2c-ami-btn,
.c2c-webrtc-call-btn {
  background: var(--c2c-primary);
  color: #fff;
}
.c2c-ami-btn:hover,
.c2c-webrtc-call-btn:hover {
  background: var(--c2c-primary-dk);
  transform: translateY(-1px);
}
.c2c-ami-btn:active,
.c2c-webrtc-call-btn:active { transform: translateY(0); }
.c2c-ami-btn:disabled,
.c2c-webrtc-call-btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

.c2c-webrtc-hangup-btn {
  background: var(--c2c-danger);
  color: #fff;
  animation: c2c-pulse 1.5s infinite;
}
.c2c-webrtc-hangup-btn:hover { background: #b02a37; }

/* ── Status message ─────────────────────────────── */
.c2c-status-msg {
  margin-top: 12px;
  min-height: 0;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  padding: 0;
  transition: all 0.3s;
}
.c2c-status-msg.c2c-msg-success {
  background: #d4edda; color: #155724;
  padding: 10px 14px;
}
.c2c-status-msg.c2c-msg-error {
  background: #f8d7da; color: #721c24;
  padding: 10px 14px;
}
.c2c-status-msg.c2c-msg-info {
  background: #d1ecf1; color: #0c5460;
  padding: 10px 14px;
}

/* ── Privacy note ────────────────────────────────── */
.c2c-privacy {
  margin: 12px 0 0;
  font-size: 0.75rem;
  color: var(--c2c-muted);
  text-align: center;
}

/* ── WebRTC status dot ───────────────────────────── */
.c2c-webrtc-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--c2c-muted);
  margin-bottom: 12px;
}
.c2c-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.c2c-dot-idle     { background: #adb5bd; }
.c2c-dot-ringing  { background: #ffc107; animation: c2c-blink 0.8s infinite; }
.c2c-dot-answered { background: var(--c2c-success); }
.c2c-dot-failed   { background: var(--c2c-danger); }

/* ── Timer ───────────────────────────────────────── */
.c2c-webrtc-timer {
  text-align: center;
  margin-bottom: 10px;
}
.c2c-timer-display {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--c2c-success);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

/* ── Animations ──────────────────────────────────── */
@keyframes c2c-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.75; }
}
@keyframes c2c-blink {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.2; }
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 480px) {
  .c2c-widget { padding: 18px; }
  .c2c-title  { font-size: 1rem; }
}
