 /* ===============================
   AI CHAT BOX SWEET STYLE
=============================== */
#ai-chat-box {
  position: fixed;
  right: 70px;
  top: 100px;
  width: 360px;   /* thawa wide */
  height: 480px;
  background: linear-gradient(145deg, #1e1e2f, #2a2a40);
  border-radius: 25px;
  display: none;
  flex-direction: column;
  z-index: 10000;
  border: 1px solid #000000;
  backdrop-filter: blur(15px);
  animation: slideIn .3s ease;
  font-family: 'Comic Sans MS', cursive, sans-serif; /* cute font */
}

/* --- PC එක සඳහා (Screen width > 1024px) --- */
@media screen and (min-width: 1024px) {
  #ai-chat-box {
    top: 207px !important;  /* PC එකේදී විතරක් උඩ ඉඳන් 205px පල්ලෙහාට */
    width: 450px !important;
    height: 650px !important;
    right: 30px !important;
  }
}

/* header */
.ai-header {
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #000000;
  font-weight: bold;
  border-bottom: 1px solid #000000;
  border-radius: 25px 25px 0 0;
  background: linear-gradient(90deg, #ffb6c1, #ff69b4, #dda0dd);
  box-shadow: inset 0 -1px 8px rgba(255, 255, 255, 0.05);
}

.ai-header span {
  letter-spacing: 1px;
  font-size: 18px;
}

/* messages */
/* ===============================
   CHAT MESSAGES AREA (WHATSAPP DARK CUTE)
=============================== */
.ai-messages {
  flex: 1 !important;
  padding: 20px 15px !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  /* WhatsApp Dark Background Pattern */
  background-color: #0b141a !important;
  background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png') !important;
  background-blend-mode: overlay !important;
  background-size: 400px !important;
}

/* Bot Message Bubble (Left) */
.ai-msg.bot {
  background: #202c33 !important; /* WA Dark Bubble */
  color: #e9edef !important;
  border-radius: 0 15px 15px 15px !important;
  padding: 10px 14px !important;
  max-width: 85% !important;
  align-self: flex-start !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3) !important;
  font-size: 14.5px !important;
  line-height: 1.4 !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* User Message Bubble (Right) */
.ai-msg.user {
  background: #005c4b !important; /* WA Dark Green */
  color: #ffffff !important;
  border-radius: 15px 0 15px 15px !important;
  padding: 10px 14px !important;
  max-width: 85% !important;
  align-self: flex-end !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3) !important;
  font-size: 14.5px !important;
  line-height: 1.4 !important;
}

/* ===============================
   INPUT AREA (STYLISH & CUTE)
=============================== */
.ai-input {
  padding: 12px 15px !important;
  display: flex !important;
  gap: 10px !important;
  background: #202c33 !important; /* WA Input Header */
  border-top: 1px solid #333 !important;
  border-radius: 0 0 25px 25px !important;
}

.ai-input input {
  flex: 1 !important;
  background: #2a3942 !important;
  border: none !important;
  color: #fff !important;
  border-radius: 20px !important;
  padding: 10px 16px !important;
  outline: none !important;
  font-family: 'Poppins', sans-serif !important;
}

.ai-input button {
  background: #00a884 !important; /* WA Green Send Button */
  border: none !important;
  border-radius: 50% !important;
  width: 42px !important;
  height: 42px !important;
  color: #fff !important;
  font-weight: bold !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.2s ease !important;
}

.ai-input button:hover {
  transform: scale(1.1) !important;
  background: #008f6f !important;
}


/* input area */
.ai-input {
  padding: 14px;
  display: flex;
  gap: 10px;
  border-top: 1px solid #ffffff;
  background: linear-gradient(90deg, #2a2a40, #1e1e2f);
  border-radius: 0 0 25px 25px;
}

.ai-input input {
  flex: 1;
  background: #1e1e2f;
  border: 1px solid #000000;
  color: #fff;
  border-radius: 15px;
  padding: 10px 14px;
  outline: none;
}

.ai-input button {
  background: linear-gradient(135deg, #ff69b4, #ffb6c1);
  border: none;
  border-radius: 15px;
  color: #000;
  font-weight: bold;
  padding: 0 16px;
  cursor: pointer;
  transition: transform .2s ease;
}

.ai-input button:hover {
  transform: scale(1.1);
}

/* cute floating glow effect */
#ai-float-btn {
  position: fixed;
  right: 11px;
  top: 130px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffb6c1, #dda0dd);
  padding: 2px;
  cursor: pointer;
  z-index: 9998;
  box-shadow: 0 0 10px rgba(255, 182, 193, 0.6), 0 0 25px rgba(221, 160, 221, 0.5);
  animation: floatGlow 2.5s ease-in-out infinite;
}

#ai-float-btn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}



/* mobile tweaks */
@media(max-width:768px){
  #ai-chat-box {
    right: 12px;
    width: calc(100% - 24px);
    height: 420px;
  }
}

.ai-header span.hana-name {
  font-size: 22px;
  font-weight: bold;
  font-family: 'Indie Flower', cursive;
  color: #ff69b4; 
  position: relative;
  letter-spacing: 1px;
  text-shadow: 
    0 0 4px #ffb6c1,
    0 0 8px #ff69b4,
    0 0 12px #ffa6c9,
    0 0 16px #ff85c1;
}



/* HANA name - black color, sweet font */
.ai-header span.hana-name {
  font-size: 24px;
  font-weight: bold;
  font-family: 'Indie Flower', cursive;
  color: #000; /* black */
  position: relative;
  letter-spacing: 1px;
  user-select: none;
  text-shadow: 
    0 0 2px #555, 
    0 0 4px #888; /* subtle shadow for cute effect */
}

/* Last A span */
.ai-header span.last-a {
  position: relative;
  display: inline-block;
}

/* floating pink heart */
.ai-header span.last-a::after {
  content: "💖";
  position: absolute;
  left: 50%;
  top: -8px; /* start just above A */
  transform: translateX(-50%) translateY(0);
  font-size: 18px;
  opacity: 0;
  animation: floatHeartBubble 4s infinite;
}

/* heart floating animation */
@keyframes floatHeartBubble {
  0% {
    transform: translateX(-50%) translateY(0) scale(0.6);
    opacity: 0;
  }
  10% {
    opacity: 1;
    transform: translateX(-50%) translateY(-2px) scale(0.8);
  }
  50% {
    transform: translateX(-50%) translateY(-30px) scale(1);
    opacity: 1;
  }
  80% {
    transform: translateX(-50%) translateY(-50px) scale(0.9);
    opacity: 0.6;
  }
  100% {
    transform: translateX(-50%) translateY(-70px) scale(0.6);
    opacity: 0;
  }
}


#ai-close {
  background: linear-gradient(135deg, #ff6ec7, #ff85c1);
  border: none;
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px #ff6ec7, 0 0 15px #ff85c1, 0 0 20px #ffb6c1;
  transition: all 0.25s ease;
  position: absolute;
  top: 10px;
  right: 10px;
}

/* hover effect - pulse glow + scale */
#ai-close:hover {
  transform: scale(1.2) rotate(20deg);
  box-shadow: 0 0 12px #ff6ec7, 0 0 25px #ff85c1, 0 0 30px #ffb6c1;
}

/* active click effect */
#ai-close:active {
  transform: scale(1) rotate(0deg);
  box-shadow: 0 0 6px #ff6ec7, 0 0 12px #ff85c1;
}

#ai-chat-box {
  font-family: 'Comic Neue', 'Poppins', sans-serif;
}
.yt-music-player{
  margin-top: 10px;
  border-radius: 16px;
}


#science-btn {
  position: fixed;
  right: 11px;  /* right side එක */
  top: 186px;    /* Science button එකට උඩින් */
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 9998;
}

#science-btn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.silent-lanka-pin {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(145deg, #1e1e2f, #2a2a40); /* cyberpunk dark gradient */
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5), 0 0 8px #ff69b4; /* neon subtle glow */
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.silent-lanka-pin img {
  width: 60%; /* icon image inside pin */
  height: 60%;
}

.silent-lanka-pin:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.6), 0 0 12px #ff69b4;
}













/* Thinking Container */
.thinking-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8696a0; /* WA secondary text color */
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
}

/* Status Text Animation (Slide from Top) */
.status-text {
  display: inline-block;
  color: #ffffff; /* Hana Pink */
  font-weight: 500;
  min-width: 140px;
  animation: slideStatus 0.5s ease-out;
}

@keyframes slideStatus {
  0% { transform: translateY(-10px); opacity: 0; filter: blur(5px); }
  100% { transform: translateY(0); opacity: 1; filter: blur(0); }
}

/* WA Dark Dot Animation */
.wa-typing {
  display: flex;
  align-items: center;
  gap: 3px;
  background: #202c33;
  padding: 6px 10px;
  border-radius: 12px;
}

.wa-typing span {
  width: 5px;
  height: 5px;
  background-color: rgb(0, 246, 255) !important;
  border-radius: 50%;
  display: inline-block;
  animation: waDot 1.4s infinite ease-in-out;
}

.wa-typing span:nth-child(2) { animation-delay: 0.2s; }
.wa-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes waDot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}



/* ===============================
   INPUT AREA & PLUS BUTTON
   =============================== */
.ai-input {
  position: relative;
  display: flex;
  align-items: center;
  padding: 12px 15px !important;
  gap: 8px;
  background: #161d21 !important; /* Deep Dark Background */
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0 0 25px 25px;
}

#ai-plus {
  background: transparent !important;
  border: none !important;
  color: #aebac1 !important; /* Subtle Gray */
  font-size: 32px !important;
  font-weight: 200 !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  padding: 0 5px !important;
  display: flex;
  align-items: center;
}

#ai-plus:hover {
  color: #ff69b4 !important; /* Hana Pink hover */
  transform: rotate(90deg); /* පොඩි ගැජට් එකක් */
}

/* ===============================
   PREVIEW CONTAINER (GEMINI DARK)
   =============================== */
#image-preview-container {
  position: absolute;
  bottom: 75px; 
  left: 15px;
  background: #232d36; /* Chat bubble dark */
  padding: 8px;
  border-radius: 15px;
  border: 1px solid rgba(255, 105, 180, 0.3); /* Soft pink border */
  display: flex;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  z-index: 100;
  animation: popIn 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

#image-preview-img {
  width: 55px;
  height: 55px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===============================
   DOCUMENT PREVIEW STYLE
   =============================== */
#file-name-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  color: #e9edef;
  font-size: 13px;
  font-family: 'Poppins', sans-serif;
}

/* Document එකක් තේරුවොත් පේන Icon එක */
.doc-icon-preview::before {
  content: "📄"; /* Document Emoji */
  font-size: 24px;
  background: #2a3942;
  padding: 10px;
  border-radius: 10px;
  display: inline-block;
}

#remove-image-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #ff4b4b;
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
  transition: background 0.2s;
}

#remove-image-btn:hover {
  background: #cc0000;
}
/* Loading Animation Spin */
@keyframes loading-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

#upload-progress-container {
    animation: loading-spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Loading වෙද්දී පින්තූරය Blur කරන්න */
.img-loading {
    filter: blur(3px) brightness(0.5);
    transition: filter 0.3s ease;
}
/* ===============================
   CHAT MESSAGES - IMAGES
   =============================== */
.user-sent-image {
  max-width: 220px;
  border-radius: 15px;
  margin-top: 8px;
  border: 2px solid rgba(255, 105, 180, 0.2);
  display: block;
  transition: transform 0.2s;
}

.user-sent-image:hover {
  transform: scale(1.02);
}





/* ===============================
   HANA AI CUSTOM SCROLLBAR
   =============================== */

/* 1. Scrollbar එකේ මුළු පළල (Width) - හීනියට තියන්න */
.ai-messages::-webkit-scrollbar {
    width: 5px !important;
}

/* 2. Scrollbar එක දිවෙන පසුබිම (Track) */
.ai-messages::-webkit-scrollbar-track {
    background: transparent !important; /* පසුබිම පේන්න ඕන නිසා */
    margin: 5px 0; /* උඩින් සහ යටින් පොඩි ඉඩක් */
}

/* 3. ඇදගෙන යන කොටස (Thumb) */
.ai-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1) !important; /* මුලින් බොඳ වෙලා පේන්න */
    border-radius: 20px !important; /* රවුම් කොන් */
    border: 1px solid rgba(255, 255, 255, 0.05); /* පොඩි border එකක් */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* 4. Mouse එක scroll bar එක උඩට ගියපුවාම හෝ scroll කරද්දී පේන විදිහ */
.ai-messages:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 105, 180, 0.4) !important; /* Hana Pink පාට (සයිබර්පන්ක් ගතියට) */
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.2); /* පොඩි Glow එකක් */
}

/* 5. Scrollbar එක ඇදගෙන යන වෙලාවට (Active state) */
.ai-messages::-webkit-scrollbar-thumb:active {
    background: rgba(255, 105, 180, 0.7) !important;
}

/* Firefox සඳහා (අලුත් Browsers වලට) */
.ai-messages {
    scrollbar-width: thin !important;
    scrollbar-color: rgba(255, 105, 180, 0.3) transparent !important;
}

/* Scroll කරද්දී පල්ලෙහාට යන එක තව සුමුදු කරන්න (Smooth Scroll) */
.ai-messages {
    scroll-behavior: smooth !important;
    overflow-y: overlay !important; /* Content එක උඩ පාවෙන විදිහට Scrollbar එක දාන්න */
}


.floating-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
  }

  .float-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    text-decoration: none;
    border: none;
  }

  .float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  }

  /* Hana Button Custom */
  #ai-float-btn {
    background: #fff;
  }
  #ai-float-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Science Map Button - Modern Style */
  #science-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Gradient background */
    color: white;
    font-size: 24px;
  }

  /* Png image ekak nathiwa icon ekak daganna eka lassanai */
  #science-btn i {
    font-style: normal;
  }

  