/* Background video */
#bg-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: fill;
  background: black;
  z-index: -1;
  pointer-events: none;
}

/* Overlay content */
.video-overlay {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 1rem;
  text-shadow: 0 0 5px black;
}

.video-overlay h1 {
  font-size: 3rem;
  margin: 0;
}

.video-overlay p {
  font-size: 1.5rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .video-overlay h1 {
    font-size: 2rem;
  }
  .video-overlay p {
    font-size: 1.2rem;
  }
}

/* Orientation warning */
#rotate-warning {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: black;
  color: white;
  z-index: 9999;
  font-size: 5vw;
  text-align: center;
  padding-top: 40vh;
}

/* Ask Cocoy button */
#ask-cocoy {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -30%);
  z-index: 9999;
  cursor: pointer;
  width: 60vw;
  max-width: 250px;
  opacity: 0;
  animation: slideUpToCenter 0.6s ease-out 1s forwards;
}

@keyframes slideUpToCenter {
  0% {
    transform: translate(-50%, -30%);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
}

#ask-cocoy img {
  width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#ask-cocoy img:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.4);
}

/* Chatbox container */
#chatbox {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  height: 80vh;
  max-width: 800px;
  background-color: #001122;
  border: 2px solid #00f0ff;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 0 25px #00f0ff, 0 0 100px #00f0ff inset;
  display: flex;
  flex-direction: column;
  z-index: 10;
  color: white;
  font-family: 'Segoe UI', sans-serif;
  box-sizing: border-box;
}

/* Chat message area */
#messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 80px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Common message layout */
.message {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  font-size: 1.6rem;
  line-height: 1.6;
  max-width: 100%;
}

/* AI (left-aligned) */
.message.ai {
  flex-direction: row;
  justify-content: flex-start;
  text-align: left;
  align-self: flex-start;
}

/* User (right-aligned) */
.message.user {
  flex-direction: row-reverse;
  justify-content: flex-start; /* changed from flex-end */
  text-align: right;
  align-self: flex-end;
}

/* Avatar styling */
.avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid #00f0ff;
  box-shadow: 0 0 10px #00f0ff;
  flex-shrink: 0;
}

/* AI message bubble */
.message.ai .text {
  background-color: #004466;
  color: white;
  padding: 14px 20px;
  border-radius: 15px;
  max-width: 70%;
  font-size: 1.4rem;
  word-wrap: break-word;
  white-space: normal;
  flex-shrink: 1;
  flex-grow: 0;
  min-width: 0;
  display: inline-block;
  width: auto;
}

/* User message bubble */
.message.user .text {
  background-color: #006688;
  color: white;
  padding: 14px 20px;
  border-radius: 15px;
  max-width: 70%;
  font-size: 1.4rem;
  word-wrap: break-word;
  white-space: normal;
  flex-shrink: 1;
  flex-grow: 0;
  min-width: 0;
  order: 1;
  display: inline-block;
  width: auto;
  margin-left: auto; /* keeps avatar on right */
}

/* Typing animation effect */
.typing-cursor::after {
  content: '|';
  animation: blink 1s step-start infinite;
  margin-left: 5px;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Input form styling */
#chat-form {
  position: absolute;
  bottom: 20px;
  left: 30px;
  right: 30px;
  display: flex;
  gap: 10px;
}

#chat-input {
  flex: 1;
  padding: 12px 18px;
  border-radius: 20px;
  border: none;
  background-color: #003344;
  color: white;
  font-size: 1.2rem;
}

#chat-input::placeholder {
  color: #99ccff;
}

#chat-form button {
  background-color: #00f0ff;
  border: none;
  border-radius: 20px;
  padding: 0 20px;
  font-weight: bold;
  cursor: pointer;
  color: #001122;
  font-size: 1.2rem;
  transition: background-color 0.3s;
}

#chat-form button:hover {
  background-color: #00c8cc;
}
  .camera-block video {
    width: 100%;
    max-width: 500px;
    margin-top: 10px;
    border-radius: 8px;
  }