.call-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #1a1a1a;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.call-error {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #f44336;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1001;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.call-error button {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.call-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.5);
}

.call-status {
  color: white;
  font-size: 18px;
  font-weight: 500;
}

.quality-indicator {
  padding: 6px 12px;
  border-radius: 20px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.video-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.remote-videos {
  width: 100%;
  height: 100%;
  display: grid;
  gap: 10px;
  padding: 10px;
}

/* Grid layouts for different participant counts */
.remote-videos:has(.remote-video-wrapper:nth-child(1):last-child) {
  grid-template-columns: 1fr;
}

.remote-videos:has(.remote-video-wrapper:nth-child(2)) {
  grid-template-columns: repeat(2, 1fr);
}

.remote-videos:has(.remote-video-wrapper:nth-child(3)),
.remote-videos:has(.remote-video-wrapper:nth-child(4)) {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.remote-videos:has(.remote-video-wrapper:nth-child(5)),
.remote-videos:has(.remote-video-wrapper:nth-child(6)) {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.remote-videos:has(.remote-video-wrapper:nth-child(7)) {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

.remote-video-wrapper {
  position: relative;
  background-color: #2c2c2c;
  border-radius: 12px;
  overflow: hidden;
  min-height: 200px;
}

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

.participant-name {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}

.local-video-wrapper {
  position: absolute;
  bottom: 100px;
  right: 20px;
  width: 200px;
  height: 150px;
  background-color: #2c2c2c;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #ffffff20;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.local-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror effect for local video */
}

.local-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.call-controls {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 16px 24px;
  border-radius: 50px;
  backdrop-filter: blur(10px);
}

.control-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background-color: #3c3c3c;
  color: white;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.2s ease;
  position: relative;
}

.control-btn:hover {
  transform: scale(1.1);
  background-color: #4c4c4c;
}

.control-btn:active {
  transform: scale(0.95);
}

.control-btn.active {
  background-color: #4CAF50;
}

.control-btn.inactive {
  background-color: #f44336;
}

.control-btn.accept-btn {
  background-color: #4CAF50;
  width: 120px;
  border-radius: 28px;
  font-size: 16px;
  gap: 8px;
}

.control-btn.accept-btn .icon {
  font-size: 20px;
}

.control-btn.reject-btn {
  background-color: #f44336;
  width: 120px;
  border-radius: 28px;
  font-size: 16px;
  gap: 8px;
}

.control-btn.reject-btn .icon {
  font-size: 20px;
}

.control-btn.end-btn {
  background-color: #f44336;
}

.control-btn.end-btn:hover {
  background-color: #d32f2f;
}

.call-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  padding: 40px;
}

.start-call-btn {
  padding: 16px 32px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
  color: white;
}

.start-call-btn.audio {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.start-call-btn.video {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.start-call-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.start-call-btn:active {
  transform: translateY(0);
}

/* Responsive design */
@media (max-width: 768px) {
  .local-video-wrapper {
    width: 120px;
    height: 90px;
    bottom: 110px;
    right: 10px;
  }
  
  .call-controls {
    gap: 12px;
    padding: 12px 16px;
  }
  
  .control-btn {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
  
  .control-btn.accept-btn,
  .control-btn.reject-btn {
    width: 100px;
    font-size: 14px;
  }
  
  .remote-videos {
    gap: 5px;
    padding: 5px;
  }
  
  .participant-name {
    font-size: 12px;
    padding: 4px 8px;
  }
  
  .call-actions {
    flex-direction: column;
    padding: 20px;
  }
  
  .start-call-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Animation for ringing */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

.call-status:has(:contains("Calling")) {
  animation: pulse 2s ease-in-out infinite;
}
