/* Call UI — video call overlay styles */

.call-overlay {
  display: none;
  position: fixed;
  z-index: 10000;
}

.call-overlay.visible {
  display: block;
}

/* Incoming / Outgoing modal */
.call-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1e1e2e;
  border: 1px solid #3a3a5c;
  border-radius: 16px;
  padding: 32px 40px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  min-width: 280px;
  animation: callFadeIn 0.25s ease;
}

.call-modal.call-ended {
  padding: 20px 32px;
  min-width: 200px;
}

.call-modal-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.call-incoming-icon {
  animation: callPulse 1.5s ease-in-out infinite;
}

.call-modal-name {
  font-size: 20px;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 6px;
}

.call-modal-status {
  font-size: 14px;
  color: #888;
  margin-bottom: 20px;
}

.call-modal-actions {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.call-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.call-btn-accept {
  background: #2ecc71;
  color: white;
}

.call-btn-decline {
  background: #e74c3c;
  color: white;
}

/* Active call — floating window */
.call-window {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 360px;
  background: #1a1a2e;
  border: 1px solid #3a3a5c;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.6);
  animation: callFadeIn 0.25s ease;
}

.call-window-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #16162a;
  cursor: move;
  user-select: none;
}

.call-window-name {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
}

.call-window-state {
  font-size: 14px;
}

.call-video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
}

#call-remote-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#call-local-video {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 100px;
  height: 75px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid #3a3a5c;
  z-index: 2;
}

.call-remote-off {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a2e;
  color: #666;
  font-size: 14px;
  z-index: 1;
}

.call-controls {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 10px;
  background: #16162a;
}

.call-ctrl-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #3a3a5c;
  background: #2a2a4a;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.call-ctrl-btn:hover {
  background: #3a3a5c;
  transform: scale(1.1);
}

.call-ctrl-btn.muted {
  background: #e74c3c;
  border-color: #e74c3c;
}

.call-ctrl-end {
  background: #e74c3c;
  border-color: #e74c3c;
}

.call-ctrl-end:hover {
  background: #c0392b;
}

/* Animations */
@keyframes callFadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes callPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* Override fadeIn for call-window (no translate centering) */
.call-window {
  animation: callWindowIn 0.25s ease;
}

@keyframes callWindowIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* === Minimize button in header === */
.call-minimize-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  margin-left: auto;
}

.call-minimize-btn:hover { color: #e0e0e0; }

.call-window-timer {
  font-size: 12px;
  color: #2ecc71;
  font-family: monospace;
  margin-left: 8px;
}

/* === Minimized call widget === */
.call-mini {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #1a1a2e;
  border: 1px solid #3a3a5c;
  border-radius: 24px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  cursor: pointer;
  animation: callMiniPulse 2s ease-in-out infinite;
  z-index: 10001;
}

.call-mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #3498db;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.call-mini-info {
  display: flex;
  flex-direction: column;
}

.call-mini-name {
  font-size: 13px;
  font-weight: 500;
  color: #e0e0e0;
}

.call-mini-timer {
  font-size: 11px;
  color: #2ecc71;
  font-family: monospace;
}

.call-mini-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.call-mini-btn:hover { transform: scale(1.1); }

.call-mini-expand { background: #3a3a5c; color: #e0e0e0; }
.call-mini-end { background: #e74c3c; color: #fff; }

@keyframes callMiniPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(0,0,0,0.5); }
  50% { box-shadow: 0 4px 20px rgba(46,204,113,0.3); }
}

/* === Screen share === */
.call-screen-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #e74c3c;
  color: #fff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 3;
}

#call-screen-btn.active {
  background: #2ecc71;
  border-color: #2ecc71;
}
