/* ---------- Global ---------- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #eaf4ff, #f6fbff);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #1f3a5f;
}

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: 720px;
  background: #ffffff;
  border-radius: 18px;
  padding: 30px 28px;
  box-shadow: 0 20px 45px rgba(30, 100, 200, 0.15);
}

/* ---------- Heading ---------- */
.container h1 {
  margin: 0 0 25px;
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  color: #1d4ed8;
}

/* ---------- Video Form ---------- */
#videoForm {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#videoForm label {
  font-weight: 600;
  font-size: 14px;
  color: #1f3a5f;
}

#videoForm select,
#videoForm input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #cfe1ff;
  outline: none;
  font-size: 14px;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

#videoForm input:focus,
#videoForm select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
}

#video-process-btn {
  margin-top: 10px;
  padding: 13px;
  border-radius: 12px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#video-process-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

/* ---------- Loader ---------- */
#loader {
  margin-top: 30px;
  text-align: center;
}

.hidden {
  display: none;
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid #dbeafe;
  border-top-color: #2563eb;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#loader p {
  font-size: 14px;
  color: #1f3a5f;
}

/* ---------- Chat Section ---------- */
#chatSection {
  margin-top: 25px;
}

#chatSection h2 {
  margin-bottom: 15px;
  text-align: center;
  color: #1d4ed8;
}

/* ---------- Chat Box ---------- */
#chatBox {
  height: 360px;
  overflow-y: auto;
  padding: 15px;
  background: #f8fbff;
  border-radius: 14px;
  border: 1px solid #dbeafe;
}

/* Scrollbar */
#chatBox::-webkit-scrollbar {
  width: 6px;
}
#chatBox::-webkit-scrollbar-thumb {
  background: #bfdbfe;
  border-radius: 10px;
}

/* ---------- Messages ---------- */
.message {
  max-width: 75%;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* User */
.message.user {
  margin-left: auto;
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Bot */
.message.bot {
  margin-right: auto;
  background: #ffffff;
  border: 1px solid #dbeafe;
  color: #1f3a5f;
  border-bottom-left-radius: 4px;
}

/* ---------- Typing Indicator ---------- */
.message.typing {
  display: flex;
  gap: 5px;
  align-items: center;
  width: fit-content;
}

.message.typing span {
  width: 7px;
  height: 7px;
  background: #60a5fa;
  border-radius: 50%;
  animation: blink 1.4s infinite both;
}

.message.typing span:nth-child(2) {
  animation-delay: 0.2s;
}
.message.typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0% {
    opacity: 0.2;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0.2;
  }
}

/* ---------- Chat Input ---------- */
.chat-input {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.chat-input input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #cfe1ff;
  font-size: 14px;
  outline: none;
}

.chat-input input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
}

#msg-btn {
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#msg-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .container {
    padding: 22px 18px;
  }

  #chatBox {
    height: 300px;
  }
}
