:root {
  --background: 0 0% 4%;
  --foreground: 225 14% 94%;

  --card: 0 0% 6%;
  --card-foreground: 225 14% 94%;

  --muted: 0 0% 12%;
  --muted-foreground: 225 14% 75%;
  --border: 0 0% 15%;
  --input: 0 0% 10%;
  --ring: 81 85% 63%;

  --primary: 81 85% 63%;
  --primary-foreground: 0 0% 4%;

  --radius: 0.75rem;

  --shadow-input: 0 0 0 1px hsl(var(--ring) / 0.9),
    0 0 35px hsl(81 85% 63% / 0.3);
  --shadow-card: 0 8px 32px hsl(0 0% 0% / 0.45);

  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Body als flex-column zodat footer altijd onderaan staat */

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter",
    "Segoe UI", sans-serif;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Container */

.container-custom {
  max-width: 1200px;          /* brede content, dus brede vraagbalk */
  margin: 0 auto;
  padding-left: 0rem;
}

.chat-input-row {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
}

.chat-shell {
  margin-top: -50px;   /* maak -20, -40, -60 afhankelijk van wat mooi is */
}


/* Navbar */

.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: hsl(var(--background));
  border-bottom: 1px solid hsl(var(--border));
}

.navbar-inner {
  height: 6.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.nav-logo img {
  height: 5rem;
  width: auto;
  display: block;
}

/* Main: neemt alle ruimte tussen navbar en footer,
   en centreert de content verticaal */

.page {
  flex: 1;
  padding-top: 5rem;
  display: flex;
  align-items: center;
}


/* Sectie vult gewoon de breedte */

.section-top {
  width: 100%;
}

/* Chat shell */

.chat-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

/* Header boven de vraagbalk */

.chat-header {
  text-align: center;
  margin-bottom: 0.25rem;
}

.chat-title {
  margin: 0;
  font-size: 1.8rem;
}

.chat-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  color: hsl(var(--muted-foreground));
}

/* Vraagbalk, breed en met groene glow */

.chat-input-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: center;
}

/* Form styling */
#chat-form {
  width: 100%;
  position: relative;
}

/* Base styles for all devices */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 4px 0;
}

.chat-input {
  flex: 1;
  resize: none;
  min-height: 40px;
  padding: 12px 50px 6px 20px;  /* top, right, bottom, left */
  line-height: 1.25;
  border-radius: 8px;
  border: 1px solid hsl(var(--ring));
  background: hsl(var(--input));
  color: hsl(var(--foreground));
  font-size: 1rem;
  outline: none;
  box-shadow: var(--shadow-input);
  overflow-y: auto;
  transition: all 0.2s ease-out;
  box-sizing: border-box;
  max-height: none !important;
  width: 100%;
  margin: 0;
}

@media (max-width: 768px) {
  .chat-input {
    padding-top: 8px !important;
    padding-bottom: 6px !important;
  }

  .input-wrapper {
    min-height: 44px;
  }
  
  .submit-button {
    right: 4px;
    width: 36px;
    height: 36px;
  }
  
  .submit-button svg {
    width: 18px;
    height: 18px;
  }
}

/* Hide scrollbar for Chrome, Safari and Opera */
.chat-input::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.chat-input {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

.chat-input::placeholder {
  color: hsl(var(--muted-foreground));
  position: relative;
  top: 0; /* padding-top on .chat-input already sets both 8px down */
  line-height: 1.5;
}

.chat-input:focus {
  box-shadow: 0 0 0 1px hsl(var(--ring)),
    0 0 40px hsl(81 85% 63% / 0.4);
}

/* Submit button styles */
.submit-button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 0 1px hsl(var(--ring) / 0.9), 0 0 15px hsl(81 85% 63% / 0.3);
  flex-shrink: 0;
  padding: 0;
}

/* Mobile-specific adjustments */
@media (max-width: 640px) {
  .submit-button {
    width: 32px;
    height: 32px;
    right: 6px;
  }
  
  .submit-button svg {
    width: 18px;
    height: 18px;
  }
  
  .chat-input {
    min-height: 44px;
    padding: 0 42px 0 16px;
  }

  .input-wrapper {
    min-height: 44px;
    padding: 0;              /* geen extra boven/onder-padding op mobiel */
    align-items: center;     /* centreer inhoud verticaal */
  }
}

.submit-button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.9), 0 0 20px hsl(81 85% 63% / 0.4);
}

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

.submit-button svg {
  width: 20px;
  height: 20px;
}

.status-line {
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
  text-align: center;

  /* exact dezelfde breedte als de zoekbalk */
  max-width: 1000px;
  width: 100%;
  margin: 0.5rem auto 0 auto;

  opacity: 0.9;
  display: block;
}

/* Chatlog onder de input */

.chat-log {
  margin-top: 1.1rem;
  padding: 0.75rem 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 55vh;
  overflow-y: auto;
}

/* Messages */
.message-row {
  width: 100%;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.message-row-user {
  align-items: flex-end;
}

.message-sender-container {
  margin-bottom: 0.25rem;
  padding: 0 0.5rem;
}

.message-sender {
  font-weight: 600;
  font-size: 0.8rem;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  margin: 0;
}

.message-bubble {
  width: 100%;
  padding: 12px 16px;
  border-radius: 0.9rem;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.5;
  max-width: 90%;
}

/* Assistant message styling */
.message-row-assistant .message-sender {
  background: hsl(158 96% 55% / 0.2);
  color: hsl(158 96% 55%);
  border: 1px solid hsl(158 96% 55% / 0.5);
  box-shadow: 0 0 10px hsl(158 96% 55% / 0.2);
}

.message-bubble-assistant {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-card);
}

/* User message styling */
.message-row-user .message-sender {
  background: hsl(217 91% 60% / 0.2);
  color: #bfdbfe;
  border: 1px solid hsl(217 91% 60% / 0.5);
  box-shadow: 0 0 10px hsl(217 91% 60% / 0.2);
}

.message-bubble-user {
  background: hsl(217 91% 60% / 0.32);
  border: 1px solid hsl(217 91% 60% / 0.8);
  box-shadow: 0 6px 18px hsl(217 91% 60% / 0.35);
}

.message-text {
  line-height: 1.5;
}

/* Footer: staat als laatste flex-child in body,
   daardoor altijd onderaan zichtbaar */

.page-footer {
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--background));
}

/* When AI has answered, hide the footer until the user types again */
.footer-hidden .page-footer {
  opacity: 0;
  pointer-events: none;
}

.footer-inner {
  padding-top: 1.3rem;
  padding-bottom: 1.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.footer-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.85rem;
  color: hsl(var(--foreground));
  text-decoration: none;
  background: transparent;
  transition: var(--transition-fast);
}

.footer-pill:hover {
  background: hsl(var(--primary) / 0.18);
  border-color: hsl(var(--primary) / 0.5);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.footer-link {
  font-size: 0.85rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: var(--transition-fast);
}

.footer-link:hover {
  background: hsl(var(--primary) / 0.18);
  border-color: hsl(var(--primary) / 0.5);
}

.footer-text {
  margin: 0;
  font-size: 0.78rem;
  color: hsl(var(--muted-foreground));
  text-align: center;
}

/* Responsive */

@media (max-width: 640px) {
  .navbar-inner {
    height: 4.5rem;
  }

  .nav-logo img {
    height: 4rem;
  }

  .page {
    padding-top: 4.5rem;
  }

  .container-custom {
    padding: 0 1.25rem;
  }

  .chat-title {
    font-size: 1.4rem;
  }
  
  .chat-subtitle {
    font-size: 0.9rem;
  }
  
  .message-bubble {
    font-size: 0.9rem;
    padding: 10px 14px;
  }
  
  .message-sender {
    font-size: 0.8rem;
  }

  .chat-subtitle {
    font-size: 0.9rem;
  }
}
