/* ===== BASE / RESET ===== */

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

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Helvetica", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: #0b0b0d;
  color: white;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

/* ===== LAYOUT ===== */

.container {
  display: flex;
  height: 100dvh; /* iOS-vriendelijker dan 100vh */
}

/* ===== LEFT (LUNA) ===== */

.left {
  width: 45%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;

  background: radial-gradient(
    circle at center bottom,
    rgba(214, 0, 122, 0.08) 0%,
    rgba(0, 0, 0, 0) 60%
  );
}

.luna-image {
  max-height: 92dvh;
  width: auto;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 40px 60px rgba(0, 0, 0, 0.6));
  display: block;
}

/* STATUS */

.status {
  position: absolute;
  bottom: 24px;
  font-size: 13px;
  opacity: 0.7;
  letter-spacing: 0.3px;
  pointer-events: none;
}

.dot {
  height: 8px;
  width: 8px;
  background-color: #d6007a;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* ===== RIGHT (CHAT) ===== */

.right {
  width: 55%;
  display: flex;
  flex-direction: column;
  padding: 60px 60px 40px 60px;

  min-width: 0; /* belangrijk: laat kolom krimpen op small screens */
}

/* Chat scroll in flex layout: min-height:0 is essentieel */
.chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 10px;
  -webkit-overflow-scrolling: touch;
}

/* BUBBLES */

.message {
  max-width: 70%;
  padding: 14px 18px;
  margin-bottom: 18px;
  border-radius: 22px;
  font-size: 15px;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
  word-wrap: break-word;
}

.user {
  background: #d6007a;
  color: white;
  align-self: flex-end;
}

.luna {
  background: #1a1a1d;
  color: white;
  align-self: flex-start;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* INPUT */

.input-area {
  display: flex;
  gap: 12px;

  width: 100%;
  max-width: 700px;
}

input {
  flex: 1;
  min-width: 0; /* voorkomt “te breed” op mobiel */
  padding: 14px 20px;
  border-radius: 28px;
  border: none;
  background: #1a1a1d;
  color: white;
  font-size: 15px;
  outline: none;
}

input::placeholder {
  color: rgba(255,255,255,0.4);
}

button {
  flex-shrink: 0;
  padding: 0 22px;
  border-radius: 28px;
  border: none;
  background: #d6007a;
  color: white;
  cursor: pointer;
  font-size: 16px;
  transition: 0.2s ease;
}

button:hover {
  background: #b80068;
}

/* ===== TABLET ===== */

@media (min-width: 769px) and (max-width: 1024px) {

  .left {
    width: 45%;
  }

  .luna-image {
    max-height: 72dvh; /* lager op tablet */
  }

  .right {
    width: 55%;
    padding: 36px;
  }

  .input-area {
    max-width: 560px;
  }
}

/* ===== MOBILE PORTRAIT ===== */

@media (max-width: 768px) and (orientation: portrait) {

  .container {
    flex-direction: column;
    height: 100dvh;
  }

  .left {
    width: 100%;
    flex: 0 0 45%;
    justify-content: flex-end;
  }

  .luna-image {
    max-height: 45dvh;
  }

  .right {
    width: 100%;
    flex: 1;
    padding: 18px;
    align-items: center; /* centreer chat + input blok */
  }

  .chat {
    width: 100%;
    max-width: 520px;
    padding-right: 0;
  }

  .input-area {
    width: 100%;
    max-width: 520px;
  }

  .message {
    max-width: 85%;
  }
}

/* ===== MOBILE LANDSCAPE (zoals desktop links/rechts) ===== */

@media (max-width: 768px) and (orientation: landscape) {

  .container {
    flex-direction: row;
    height: 100dvh;
  }

  .left {
    width: 40%;
    justify-content: center;
  }

  .luna-image {
    max-height: 58dvh; /* lager zodat ze niet “te hoog” voelt */
  }

  .right {
    width: 60%;
    padding: 14px 14px 12px 14px;
  }

  .message {
    max-width: 85%;
    font-size: 14px;
  }

  .input-area {
    max-width: 420px; /* input + knop minder breed in landscape */
  }
}

/* ===== EXTRA SMALL PHONES ===== */

@media (max-width: 480px) and (orientation: portrait) {
  .luna-image { max-height: 42dvh; }
  .chat, .input-area { max-width: 460px; }
}