/* ============================================
 * FazeOne — RingCentral Widget Styles
 * Extracted from app.html inline styles
 * ============================================ */

/* RingCentral Widget Styles */
/* Widget is off-screen by default. Shown during sign-in, then moved off-screen again.
   We use off-screen positioning instead of display:none so WebRTC device stays registered. */
.rc-widget-toggle { display: none !important; }
.rc-call-badge { display: none !important; }
#rc-widget-container { position: fixed; bottom: -9999px; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
#rc-widget-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}
.rc-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #ff6a00 0%, #ff8533 100%);
  color: white;
  font-weight: 600;
  font-size: 14px;
  flex: 0 0 auto;
}
.rc-widget-minimize {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  display: flex;
  opacity: 0.8;
}
.rc-widget-minimize:hover { opacity: 1; }
.rc-widget-minimize svg { width: 16px; height: 16px; }

/* Tabs */
.rc-widget-tabs { display: flex; gap: 4px; }
.rc-tab {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}
.rc-tab.active { background: rgba(255,255,255,0.35); }
.rc-tab-panel {
  display: none;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.rc-tab-panel.active {
  display: flex;
  flex-direction: column;
  width: 100%;
}
#rc-softphone-panel {
  width: 100%;
  min-width: 0;
}
#rc-softphone-panel iframe,
#rc-softphone-loading {
  width: 100%;
  flex: 1 1 auto;
  min-width: 0;
}

/* Dialpad */
.rc-dialpad {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}
.rc-phone-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 24px;
  text-align: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: white;
  margin-bottom: 20px;
  letter-spacing: 2px;
}
.rc-phone-input::placeholder { color: rgba(255,255,255,0.4); letter-spacing: 0; font-size: 14px; }
.rc-dialpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  padding: 0 8px;
}
.rc-dial-btn {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  color: white;
  font-size: 28px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 70px;
}
.rc-dial-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.05); }
.rc-dial-btn:active, .rc-dial-btn.pressed { transform: scale(0.95); background: rgba(255, 106, 0, 0.4); }
.rc-dial-btn span { font-size: 9px; letter-spacing: 1px; opacity: 0.6; margin-top: 2px; }
.rc-dial-actions { display: flex; justify-content: center; gap: 32px; margin-top: 8px; }
.rc-call-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
  transition: all 0.2s;
}
.rc-call-btn:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(34, 197, 94, 0.5); }
.rc-call-btn svg { width: 32px; height: 32px; color: white; }
.rc-clear-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}
.rc-clear-btn:hover { background: rgba(239, 68, 68, 0.3); }
.rc-clear-btn svg { width: 20px; height: 20px; color: white; }

/* Active Call Controls */
.rc-call-controls {
  padding: 16px;
  text-align: center;
}
.rc-call-status {
  margin-bottom: 20px;
}
.rc-call-timer {
  display: block;
  font-size: 32px;
  font-weight: 600;
  color: white;
  font-family: monospace;
}
.rc-call-state {
  font-size: 13px;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.rc-call-state.on-hold { color: #fbbf24; }
.rc-call-state.muted { color: #ef4444; }
.rc-call-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
}
.rc-control-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
}
.rc-control-btn:hover { background: rgba(255,255,255,0.2); }
.rc-control-btn.active { background: var(--accent); border-color: var(--accent); }
.rc-control-btn svg { width: 24px; height: 24px; }
.rc-control-btn span { font-size: 10px; font-weight: 500; }
.rc-end-call-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
  transition: all 0.2s;
}
.rc-end-call-btn:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5); }
.rc-end-call-btn svg { width: 28px; height: 28px; }

/* Audio + end call rows */
.rc-audio-row { margin-top: 8px; }
.rc-end-row { margin-top: 12px; justify-content: center; }
.rc-audio-btn.playing {
  background: rgba(34, 197, 94, 0.3) !important;
  border-color: rgba(34, 197, 94, 0.6) !important;
  animation: audioPulse 1.5s ease-in-out infinite;
}
@keyframes audioPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}
.rc-control-btn.recording {
  background: rgba(239, 68, 68, 0.3) !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
}
.rc-control-btn.recording svg circle[fill] { fill: #ef4444; }

/* DTMF keypad overlay */
.rc-dtmf-pad {
  padding: 12px;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  margin-top: 8px;
}
.rc-dtmf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.rc-dtmf-btn {
  padding: 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: white;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.rc-dtmf-btn:hover { background: rgba(255,255,255,0.2); }
.rc-dtmf-btn:active { background: rgba(255, 106, 0, 0.4); transform: scale(0.95); }
.rc-dtmf-close {
  width: 100%;
  padding: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 12px;
}
.rc-dtmf-close:hover { background: rgba(255,255,255,0.2); color: white; }

/* Call control button grid sizing */
.rc-call-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.rc-call-controls .rc-control-btn {
  width: 56px;
  height: 56px;
}
.rc-call-controls .rc-control-btn svg { width: 20px; height: 20px; }
.rc-call-controls .rc-control-btn span { font-size: 9px; }

/* Call Logs */
.rc-logs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.rc-logs-title { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.9); }
.rc-refresh-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 4px;
}
.rc-refresh-btn:hover { color: white; }
.rc-refresh-btn svg { width: 16px; height: 16px; }
.rc-logs-list {
  flex: 1;
  overflow-y: auto;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}
.rc-logs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255,255,255,0.4);
  text-align: center;
  padding: 24px;
}
.rc-logs-empty svg { width: 40px; height: 40px; margin-bottom: 12px; opacity: 0.5; }
.rc-logs-empty p { font-size: 13px; }
.rc-log-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background 0.15s;
}
.rc-log-item:hover { background: rgba(255,255,255,0.05); }
.rc-log-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rc-log-icon.incoming { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.rc-log-icon.outgoing { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.rc-log-icon.missed { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.rc-log-icon svg { width: 18px; height: 18px; }
.rc-log-details { flex: 1; min-width: 0; }
.rc-log-phone { font-size: 14px; font-weight: 500; color: white; }
.rc-log-name { font-size: 12px; color: rgba(255,255,255,0.5); }
.rc-log-meta { text-align: right; }
.rc-log-time { font-size: 11px; color: rgba(255,255,255,0.4); }
.rc-log-duration { font-size: 11px; color: rgba(255,255,255,0.6); }
.rc-log-worm {
  font-size: 9px;
  padding: 2px 6px;
  background: rgba(255, 106, 0, 0.2);
  color: #ff6a00;
  border-radius: 3px;
  margin-top: 4px;
  display: inline-block;
}

/* Customer Context in Phone Widget */
.rc-customer-context {
  padding: 10px;
  background: rgba(0, 156, 115, 0.1);
  border: 1px solid rgba(0, 156, 115, 0.3);
  border-radius: 8px;
  margin-bottom: 12px;
}
.rc-customer-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rc-customer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
}
.rc-customer-details {
  flex: 1;
  min-width: 0;
}
.rc-customer-name {
  font-size: 13px;
  font-weight: 500;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rc-customer-meta {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rc-view-customer-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  color: rgba(255,255,255,0.6);
  transition: all 0.15s ease;
}
.rc-view-customer-btn:hover {
  background: rgba(255,255,255,0.1);
  color: white;
  border-color: rgba(255,255,255,0.4);
}

/* Call state colors */
.rc-call-state.connecting { color: #f2a900; }
.rc-call-state.connected { color: #22c55e; }
.rc-call-state.muted { color: #ef4444; }
.rc-call-state.on-hold { color: #f2a900; }

/* Compact mode: collapse to just phone input + call button */
.rc-widget-wrapper.rc-compact {
  height: auto !important;
  max-height: 80px;
}
.rc-widget-wrapper.rc-compact .rc-widget-header,
.rc-widget-wrapper.rc-compact .rc-dialpad-grid,
.rc-widget-wrapper.rc-compact .rc-dial-actions,
.rc-widget-wrapper.rc-compact .rc-tab-panel:not(.active),
.rc-widget-wrapper.rc-compact .rc-call-controls,
.rc-widget-wrapper.rc-compact .rc-logs-header,
.rc-widget-wrapper.rc-compact .rc-logs-list {
  display: none !important;
}
.rc-widget-wrapper.rc-compact .rc-tab-panel.active {
  display: flex !important;
}
.rc-widget-wrapper.rc-compact .rc-dialpad {
  padding: 10px 12px;
  flex-direction: row;
  gap: 8px;
  align-items: center;
}
.rc-widget-wrapper.rc-compact .rc-phone-input {
  font-size: 16px;
  padding: 8px 12px;
  margin-bottom: 0;
  text-align: left;
  letter-spacing: 1px;
  flex: 1;
}
.rc-widget-wrapper.rc-compact .rc-dialpad::after {
  content: '';
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  cursor: pointer;
}

/* Incoming Call Notification - Floating Corner */
.incoming-call-notification {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 320px;
  background: linear-gradient(145deg, rgba(30, 30, 46, 0.98), rgba(22, 33, 62, 0.98));
  border: 2px solid rgba(34, 197, 94, 0.4);
  border-radius: 16px;
  padding: 20px;
  z-index: 9999;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(34, 197, 94, 0.2);
  backdrop-filter: blur(20px);
  opacity: 0;
  transform: translateX(120%);
  visibility: hidden;
  transition: all 0.3s ease-out;
}
.incoming-call-notification.active {
  opacity: 1;
  transform: translateX(0);
  visibility: visible;
  animation: notificationPulse 2s ease-in-out infinite;
}
@keyframes notificationPulse {
  0%, 100% {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
  }
  50% {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 35px rgba(34, 197, 94, 0.5);
    border-color: rgba(34, 197, 94, 0.8);
  }
}
@keyframes phoneShake {
  0%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(-12deg); }
  20% { transform: rotate(12deg); }
  30% { transform: rotate(-10deg); }
  40% { transform: rotate(10deg); }
  50% { transform: rotate(0deg); }
}
.notification-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.notification-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: phoneShake 1s ease-in-out infinite;
}
.notification-icon svg {
  width: 20px;
  height: 20px;
  color: white;
}
.notification-label {
  font-size: 12px;
  font-weight: 700;
  color: #22c55e;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.notification-caller {
  margin-bottom: 16px;
}
.caller-number {
  font-size: 22px;
  font-weight: 600;
  color: white;
  margin-bottom: 4px;
}
.caller-name {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
}
.caller-vehicle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}
.caller-vehicle svg {
  color: rgba(255, 255, 255, 0.4);
}
.notification-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.notif-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.notif-btn.decline {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
}
.notif-btn.decline:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.6);
}
.notif-btn.accept {
  background: rgba(34, 197, 94, 0.25);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #22c55e;
}
.notif-btn.accept:hover {
  background: rgba(34, 197, 94, 0.35);
  border-color: rgba(34, 197, 94, 0.7);
}
.notification-timer {
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   Call Log Recording Badge (RC Widget)
   ============================================ */

.rc-log-rec-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 106, 0, 0.15);
  margin-left: 4px;
  vertical-align: middle;
  flex-shrink: 0;
}

.rc-log-rec-badge svg {
  stroke: var(--accent, #ff6a00);
}
