* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
  color: white;
  font-family: system-ui, -apple-system, sans-serif;
}

.header-section {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 15px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  text-align: center;
}

.header-section h1 {
  font-size: 1.5rem;
  margin: 0;
}

.video-container {
  position: fixed;
  top: 60px;
  left: 0;
  width: 100vw;
  height: calc(100vh - 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  margin-top: 120px;
}

video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-output {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 100px;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 180px;
}

.chat-output p {
  padding: 10px;
  border-radius: 15px;
  max-width: 80%;
  word-wrap: break-word;
}

.user-message {
  background: #0084ff;
  align-self: flex-end;
  margin-left: 20%;
}

.gemini-message {
  background: #333;
  align-self: flex-start;
  margin-right: 20%;
}

.error-message {
  /* background: rgba(255, 68, 68, 0.9); */
  align-self: center;
  margin: 10px 15%;
  text-align: center;
  padding: 12px 20px;
  border-radius: 20px;
  font-weight: 500;
  animation: fadeIn 0.3s ease-out;
}

.connection-error {
  background: rgba(255, 68, 68, 0.95);
  position: fixed;
  top: 200px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  padding: 15px 25px;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 90%;
  animation: slideDown 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from { 
    transform: translate(-50%, -20px);
    opacity: 0;
  }
  to { 
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.controls {
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  z-index: 1000;
}

.centered-button-container {
  display: flex;
  justify-content: center;
  padding: 10px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.media-buttons-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.media-buttons-container.hidden {
  display: none;
}

.action-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.action-button:active {
  transform: scale(0.95);
}

.material-symbols-outlined {
  font-size: 24px;
}

.hidden {
  display: none !important;
}

/* Style for connect and stop buttons */
#connectButton, #stopButton {
  width: 70px;
  height: 70px;
  background: rgba(0, 128, 255, 0.2);
}

#connectButton:not(:disabled):hover,
#stopButton:not(:disabled):hover {
  background: rgba(0, 128, 255, 0.3);
}

#connectButton:not(:disabled):active,
#stopButton:not(:disabled):active {
  background: rgba(0, 128, 255, 0.4);
}

@media (min-width: 768px) {
  #connectButton, #stopButton {
    width: 80px;
    height: 80px;
  }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
  .header-section {
    padding-top: max(15px, env(safe-area-inset-top));
    padding-left: max(15px, env(safe-area-inset-left));
    padding-right: max(15px, env(safe-area-inset-right));
  }

  .controls {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    padding-left: max(15px, env(safe-area-inset-left));
    padding-right: max(15px, env(safe-area-inset-right));
  }
}

/* Desktop-specific styles */
@media (min-width: 768px) {
  .header-section {
    padding: 20px;
  }

  .header-section h1 {
    font-size: 2rem;
  }

  .video-container {
    top: 80px;
    height: calc(100vh - 200px);
    padding: 0 20px;
  }

  video {
    max-width: 80%;
    border-radius: 8px;
  }

  .chat-output {
    top: 80px;
    bottom: 120px;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
  }

  .controls {
    bottom: 30px;
    gap: 30px;
  }

  .action-button {
    width: 70px;
    height: 70px;
  }

  .material-symbols-outlined {
    font-size: 28px;
  }

  #playButton {
    width: 80px;
    height: 80px;
  }
}

/* Hover effects for non-touch devices */
@media (hover: hover) {
  .action-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
  }

  .action-button:active {
    transform: scale(0.95);
  }
}

/* Active state for media buttons */
.action-button.active {
  background: rgba(255, 0, 0, 0.2);
  border: 1px solid rgba(255, 0, 0, 0.3);
}

.action-button.active:hover {
  background: rgba(255, 0, 0, 0.3);
}

.action-button.active:active {
  background: rgba(255, 0, 0, 0.4);
}

.function-info {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: 60%;
  max-width: 1200px;
  background-color: #1a1a1a;
  color: white;
  padding: 15px;
  border-radius: 10px;
  font-family: monospace;
  white-space: pre-wrap;
  word-break: break-all;
  backdrop-filter: blur(10px);
  margin-top: 20px;
  text-align: left;
  font-size: 0.85rem;
}

/* Adjust for desktop screens */
@media (min-width: 768px) {
  .function-info {
    padding: 20px;
    font-size: 0.9rem;
  }
}

.endpoint-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.endpoint-button {
  background-color: #333;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.endpoint-button:active {
  transform: scale(0.95);
}

.endpoint-button.switched {
  background-color: #007bff;
}

.endpoint-label {
  font-weight: 500;
}

.function-info pre {
  margin: 0; 
  white-space: pre-wrap; 
  word-wrap: break-word; 
}

.function-name-display {
  color: rgb(155, 155, 230);
}

.function-params-display {
  color: rgb(233, 203, 148);
}

.function-response-display {
  color: rgb(158, 240, 158);
} 