@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

body {
  font-family: "Inter", sans-serif;
  background: linear-gradient(to bottom right, #e0e7ff, #f9fafb);
  color: #1f2937;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  width: 100%;
  max-width: 860px;
  padding: 2rem;
}

.main-card {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 1.5rem;
  padding: 2rem;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: fadeIn 0.6s ease;
}

.header {
  text-align: center;
}

.header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  color: #111827;
}

.header p {
  margin-top: 0.5rem;
  color: #6b7280;
}

.video-container {
  border-radius: 1rem;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
  background-color: #1f2937;
  aspect-ratio: 16 / 9;
}

video {
  width: 100%;
  height: 100%;
}

.status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 0.75rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
}

.status-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.status-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.status-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
}

.dot-red {
  background-color: #ef4444;
}

.dot-green {
  background-color: #10b981;
}

.dot-yellow {
  background-color: #facc15;
}

.pulse {
  animation: pulse 1.5s infinite;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.form-input {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: none;
  background: rgba(255, 255, 255, 0.8);
  transition: box-shadow 0.2s ease;
  font-size: 1.1rem;
}

.form-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

.form-input:disabled {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.5;
}

.buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  color: white;
  border: none;
  font-size: 1.1rem;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.btn:active {
  transform: scale(0.97);
}

.btn-blue {
  background: linear-gradient(to right, #3b82f6, #6366f1);
}

.btn-red {
  background: linear-gradient(to right, #ef4444, #f87171);
}

.btn-disabled {
  background-color: #ccc !important;
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.7;
}

.close-btn {
  cursor: pointer;
  color: white;
  border: none;
  background: none;
  font-size: 25px;
}

.log-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 38rem;
  height: 100vh;
  background: rgba(17, 24, 39, 0.9);
  color: #f3f4f6;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
}

.log-open {
  transform: translateX(0);
}

.log-panel-header {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.log-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.4;
  scrollbar-width: thin;
  scrollbar-color: #4b5563 #1f2937;
}

.log-content::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.log-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.log-content::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 4px;
}

.log-content::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

.log-message {
  padding: 0.5rem;
  margin: 0.5rem 0;
  border-radius: 0.25rem;
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.4;
  word-break: break-word;
}

.log-info {
  background: rgba(59, 130, 246, 0.1);
  border-left: 3px solid #3b82f6;
}

.toggle-log-btn {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  background-color: #1f2937;
  color: white;
  padding: 1.3rem;
  border-radius: 0.5rem 0 0 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: background 0.3s ease;
  font-size: 1.6rem;
  border-bottom-left-radius: 50%;
  border-top-left-radius: 50%;
}

.toggle-log-btn:hover {
  background-color: #374151;
}

.session-id {
  color: #00000057;
  text-align: center;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-box {
  justify-content: space-between;
  display: flex;
  align-items: center;
  margin-top: 1rem;
}

.message-box input {
  width: 75%;
}

#functionCallBox {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-top: 0.5rem;
}

.function-call-box {
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.function-call-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.function-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.function-input-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #374151;
}

.send-func-btn {
  align-self: flex-end;
}

#functionCallBox textarea {
  width: 100%;
  resize: vertical;
  min-height: 100px;
  margin-bottom: 0.5rem;
  font-family: monospace;
}

#functionCallBox button {
  align-self: flex-end;
}

.send-msg-btn {
  display: inline-block;
  margin-left: 0.5rem;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 1rem;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(to right, #3b82f6, #6366f1);
  color: white;
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
}

.modal-header h2 {
  margin: 0;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.btn-light {
  background: linear-gradient(to right, #e5e7eb, #d1d5db);
  color: #374151;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.slider-container input[type="range"] {
  flex-grow: 1;
}

#temperatureValue {
  min-width: 2rem;
  text-align: center;
  font-weight: 600;
}

.helper-text {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.25rem;
  font-style: italic;
}

#eventBox {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-top: 0.5rem;
}

.event-call-box {
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

#eventData {
  margin-bottom: 1rem;
}

.avatar-settings {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
