/* Make box-sizing actually apply everywhere */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #F4F4F4;

  /* Footer pinned to bottom */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background-color: #F4F4F4;
  color: black;
}

nav {
  display: flex;
  align-items: center;
}

nav a {
  color: black;
  text-decoration: none;
  margin-left: 15px;
}

nav a:hover {
  color: grey;
}

.white-space {
  height: 30px;
  background-color: white;
  width: 100%;
}

/* Main content should take remaining height so footer stays down */
.page-content {
  flex: 1;              /* <-- key */
  display: block;
}

.main-section {
  display: flex;
  gap: 20px;
  padding: 20px;
  align-items: stretch;
  flex-wrap: wrap;      /* helps on smaller screens */
}

.intro-content { flex: 2; }

.intro-section {
  flex: 4;
  display: flex;
  gap: 20px;
  padding: 20px;
  border: 1px solid #ccc;
  align-items: center;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease-in-out;
}

.intro-section h1 { font-size: 32px; }
.black-text { color: black !important; }
.grey-text { color: gray !important; }
.intro-section p { color: gray; font-size: 16px; }
.intro-section:hover { transform: scale(1.05); }

.video-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 15px;
  transition: transform 0.3s ease-in-out;
}

.video-container iframe,
.video-container video {
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

.video-container:hover { transform: scale(1.05); }

.project-links {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 15px;
  margin-top: 10px;
}

.icon-button {
  width: 40px;
  height: 40px;      /* ensure consistent size */
  object-fit: contain;
  transition: transform 0.3s ease-in-out;
  display: block;
}

.icon-button:hover { transform: scale(1.1); }

.image-container {
  width: 100%;
  max-width: 560px;
  height: 315px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.responsive-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

/* AI + Chat UI */
.ai-section {
  flex: 2;
  padding: 20px;
  border: 1px solid #ccc;
  text-align: center;
  background-color: black;
  border-radius: 12px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease-in-out;
  width: 100%;
  overflow: hidden;
  position: relative;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;

  height: 400px; /* fixed card height */
}

#ai-animation-container {
  width: 100%;
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  min-height: 250px;
}

.ai-button {
  padding: 10px 20px;
  background-color: white;
  color: black;
  border: 2px solid black;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease-in-out;
  margin-top: 10px; /* ✅ instead of top:-35px */
}


.ai-button:hover { background-color: black; color: white; }
.ai-section:hover { transform: scale(1.05); }
.how-it-works-in-ai {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 50;

  color: white;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;

  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  box-shadow: none;

  opacity: 0.9;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.how-it-works-in-ai:hover {
  opacity: 1;
  text-decoration: underline;
  transform: translateY(-1px);
}
/* Footer */
.footer {
  margin-top: auto;  /* <-- key */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: white;
  width: 100%;
  border-top: 1px solid #ddd;
}

.footer-links {
  display: flex;
  gap: 30px;
  font-size: 18px;
}

.footer-links a {
  text-decoration: none;
  color: black;
  font-weight: bold;
  transition: color 0.3s ease;
}

.footer-links a:hover { color: grey; }

/* Optional spacing helper */
.space {
  height: 30px;
  width: 100%;
}
/* ============================
   Chat UI (project detail)
   ============================ */

/* Make sure the chat fills the AI card */
.ai-section .chat-container {
  width: 100%;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.85);
  overflow: hidden;
}

/* Quota label */
.ai-section #ai-quota {
  color: white;
  font-size: 12px;
  opacity: 0.85;
  text-align: center;
  margin-bottom: 6px;
}

/* Scrollable message area */
.ai-section .chat-messages {
  flex: 1 1 auto;
  min-height: 0;              /* IMPORTANT: enables flex scrolling */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: white;
  text-align: left;
  scroll-behavior: smooth;
}

/* Message bubbles */
.ai-section .ai-message,
.ai-section .user-message {
  max-width: 80%;
  padding: 10px;
  border-radius: 8px;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.ai-section .ai-message {
  align-self: flex-start;
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

.ai-section .user-message {
  align-self: flex-end;
  color: white;
  background-color: #333;
}

/* Input row pinned at bottom */
.ai-section .chat-input-container {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.2);
}

.ai-section .chat-input {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: white;
  font-size: 16px;
}

.ai-section .send-button {
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: #007BFF;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.ai-section .send-button:hover {
  background: #0056b3;
}
