/* style.css */

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  margin: 0;
  font-family: sans-serif;
  background: url("https://raw.githubusercontent.com/aflacake/fantasygirl-chatbot/main/assets/20251003_144849.jpg") no-repeat center center fixed;
  background-size: cover;
}

#sakura-kontainer {
  width: 100%;
  height: 100dvh;
  position: fixed;
  top: 0;
  left: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.sakura {
  width: 30px;
  height: 30px;
  position: absolute;
  background-image: url("https://raw.githubusercontent.com/aflacake/fantasygirl-chatbot/main/assets/20251005_063944.png");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.9;
  animation: jatuhSakura linear forwards;
}

  @keyframes jatuhSakura {
    0% {
      transform: translateY(-10px) rotate(0deg);
      opacity: 0;
    }
    10% {
      opacity: 1;
    }
    100% {
      transform: translateY(80vh) rotate(360deg);
      opacity: 0;
    }
  }

#pesan-kontainer {
  flex: 1;
  width: 100%;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

#karakter {
  display: flex;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
}

#gmbr-karak {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  transition: all 0.3s ease;
}

  #gmbr-karak.berbicara {
    filter: drop-shadow(0 0 15px rgba(255,182,193,0.8));
    animation: bounceTalk 0.6s infinite alternate;
  }

    @keyframes bounceTalk {
      from { transform: scale(1); }
      to { transform: scale(1.02); }
    }

  #gmbr-karak.shake {
    animation: charShake 0.4s ease-in-out;
  }

    @keyframes charShake {
      0%   { transform: translate(0, 0) rotate(0); }
      20%  { transform: translate(-5px, 0) rotate(-2deg); }
      40%  { transform: translate(5px, 0) rotate(2deg); }
      60%  { transform: translate(-5px, 0) rotate(-2deg); }
      80%  { transform: translate(5px, 0) rotate(2deg); }
      100% { transform: translate(0, 0) rotate(0); }
    }

#garis-kecepatan {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("https://raw.githubusercontent.com/aflacake/fantasygirl-chatbot/main/assets/20251002_160555.png");
  background-size: 50px 100%;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

  #garis-kecepatan.active {
    animation: speedFlash 0.4s ease;
  }

    @keyframes speedFlash {
      0% { opacity: 0; transform: scale(1.2); }
      30% { opacity: 1; transform: scale(1); }
      100% { opacity: 0; transform: scale(1); }
    }

#pesan {
  display: flex;
  flex-direction: column;
  position: absolute;
  overflow-y: auto;
  bottom: 60px;
  left: 0;
  right: 0;
  gap: 0.5rem;
  max-height: 40%;
  padding: .5rem;
  margin: 0;
  background: rgba(255,255,255,0.85);
  border-radius: 0;
  box-sizing: border-box;
  transform: translateY(100%);
  transition: transform 0.5s ease;
}

  #pesan.active {
    transform: translateY(0);
  }

#boks-masukkan {
  display: flex;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  gap: .5rem;
  padding: .5rem;
  background: rgba(255,255,255,0.95);
  border-top: 1px solid #ccc;
}

  #masukkan-pengguna {
    flex: 1;
    padding: .5rem;
    font-size: 1rem;
    border-radius: 8px;
    border: 1px solid #ccc;
  }

  #tmbl-kirim {
    padding: .5rem 1rem;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    background: #4a90e2;
    color: white;
    cursor: pointer;
  }

.pesan {
  position: relative;
  max-width: 70%;
  padding: .6rem .9rem;
  margin: .5rem 0;
  display: inline-block;
  word-wrap: break-word;
  border-radius: 0;
  box-shadow: 0 3px 5px rgba(0,0,0,0.1);
  animation: fadeInUp 0.5s ease;
}

.pengguna {
  align-self: flex-end;
  background: linear-gradient(135deg, #a1c4fd, #c2e9fb);
  border-bottom-right-radius: 2px;
}

.bot {
  align-self: flex-start;
  background: linear-gradient(135deg, #fbc2eb, #a6c1ee);
  border-bottom-left-radius: 2px;
}

    .pengguna::after {
        position: absolute;
        right: -15px;
        bottom: 8px;
        content: "";
        border-width: 8px;
        border-style: solid;
        border-color: transparent transparent transparent #c2e9fb;
    }

    .bot::after {
      position: absolute;
      left: -15px;
      bottom: 8px;
      content: "";
      border-width: 8px;
      border-style: solid;
      border-color: transparent #a6c1ee transparent transparent;
    }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 768px) {
  body {
    align-items: stretch;
  }

  #pesan-kontainer {
    width: 100%;
    height: 100vh;
    border-radius: 0;
    padding: 0;
    background: none;
    box-shadow: none;
    position: relative;
    overflow: hidden;
  }

  #karakter {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
  }

  #gmbr-karak {
    width: 100%;
    height: auto;
    max-height: 100vh;
    object-fit: contain;
  }

  #pesan {
    position: absolute;
    overflow-y: auto;
    bottom: 60px;
    left: 0;
    right: 0;
    max-height: 40%;
    margin: 0;
    padding: .5rem;
    background: rgba(255,255,255,0.85);
    border-radius: 0;
  }

  #boks-masukkan {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: .5rem;
    background: rgba(255,255,255,0.95);
    border-top: 1px solid #ccc;
  }

  #masukkan-pengguna {
    font-size: 1rem;
  }

  #tmbl-kirim {
    font-size: 1rem;
  }
}
