/* --- CHATBOT --- */
:root {
  --first-color: #3e3efa; /* A nice green, for example */
  --second-color: #333;   /* A dark grey */
}
.chat-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.chat-icon {
    width: 60px;
    height: 60px;
    background-color: var(--first-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    
}

.chat-icon:hover {
    transform: scale(1.1);
}

.chat-window {
    width: 320px;
    height: 400px;
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    display: none; /* Hidden by default */
    flex-direction: column;
    position: absolute;
    bottom: 80px;
    right: 0;
    transform-origin: bottom right;
    animation: fadeInScale 0.3s ease-out forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-header {
    background-color: var(--first-color);
    color: #fff;
    padding: 1rem;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* ===== CHAT HEADER UPGRADE ===== */

.chat-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
}

/* Left */
.chat-header-left{
  width:20%;
  display:flex;
  align-items:center;
}
.chat-header-logo{
  width:36px;
  height:36px;
  border-radius:50%;
  object-fit:cover;
  border:2px solid #fff;
}

/* Center */
.chat-header-center{
  width:60%;
  text-align:center;
}
.chat-header-center h3{
  margin:0;
  font-size:1.05rem;
  font-weight:600;
}

/* Right */
.chat-header-right{
  width:20%;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
}

/* Moon icon */
.dark-toggle{
  cursor:pointer;
  font-size:1.2rem;
  transition:transform .3s ease;
}
.dark-toggle:hover{
  transform:scale(1.2);
}

/* ===== DARK MODE ===== */
.chat-window.dark-mode{
  background:#f5f5f6 !important;
  color:#fff;
}

.chat-window.dark-mode .chat-messages{
  background:#484747;
}

.chat-window.dark-mode .chat-input{
  background:#181818;
}

.chat-window.dark-mode input{
  background:#222;
  color:#fff;
  border:1px solid #444;
}

.chat-window.dark-mode .bot-text{
  background:#1f1f1f;
  color:#fff;
}

.chat-window.dark-mode .user-message{
  background:#261bea !important;
  color:#fff !important;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.close-chat {
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.chat-messages {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message {
    padding: 0.75rem;
    border-radius: 0.5rem;
    max-width: 85%;
    word-wrap: break-word;
}

.user-message {
    align-self: flex-end;
    background-color: var(--second-color);
    color: #fff;
}



/* Chat input */
.chat-input {
  padding: 0.7rem;
  background: #fff;
  border-top: 1px solid #e5e5e5;
}

.chat-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

/* Text input */
.chat-input-wrapper input {
  width: 100%;
  padding: 0.75rem 4.8rem 0.75rem 3rem;

  border-radius: 2rem;
  border: 1px solid #ddd;

  font-size: 0.95rem;
  outline: none;
}

.chat-input-wrapper input:focus {
  border-color: #3e3efa;
}

/* File upload (LEFT) */
.chat-attach-btn {
  position: absolute;
  left: 0.9rem;

  color: #666;
  font-size: 1.25rem;
  cursor: pointer;
}

.chat-attach-btn:hover {
  color: #000;
}


/* Emoji (RIGHT) */
.chat-emoji-btn {
  position: absolute;
  right: 3.2rem;

  background: none;
  border: none;
  outline: none;
  box-shadow: none;

  color: #d21515;
  font-size: 1.25rem;
  cursor: pointer;
}

/* Hover only */
.chat-emoji-btn:hover {
  color: #000;
}

/* After click or focus return to original */
.chat-emoji-btn:focus,
.chat-emoji-btn:active {
  background: none;
  outline: none;
  box-shadow: none;
  color: #d21515;
}

/* Send button */
.chat-send-btn {
  position: absolute;
  right: 0.4rem;

  width: 34px;
  height: 34px;

  border-radius: 50%;
  border: none;

  background: #3e3efa;
  color: #fff;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 1.4rem;
  cursor: pointer;
}

.chat-send-btn:hover {
  background: #0c0c0c;
  color: #fff;
}

/* Powered by */
.chat-powered {
  text-align: center;
  font-size: 0.7rem;
  color: #888;
  padding: 0.35rem 0 0.6rem;
}

.chat-powered i {
  font-size: 0.85rem;
  vertical-align: middle;
   color: #3e3efa;
}
/* Powered by gradient text */
.chat-powered .powered-name {
  background: linear-gradient(90deg, #e63946, #8de271, #6f63ee, #eb6e83);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  user-select: none;
  font-weight: 600;  /* optional: make it bold */
}
/*emoji picker*/
.emoji-picker {
  position: absolute;
  bottom: 70px;
  right: 1rem;

  width: 260px;
  padding: 0.7rem;

  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);

  display: none;
  flex-wrap: wrap;
  gap: 0.4rem;

  font-size: 1.4rem;
  z-index: 2000;
}

.emoji-picker span {
  cursor: pointer;
  transition: transform 0.1s ease;
}

.emoji-picker span:hover {
  transform: scale(1.2);
}


/* Chat icon */
.chat-icon {
  position: relative;
  overflow: hidden;
}

/* Hide chat icon symbol on hover */
.chat-icon:hover i {
  opacity: 0;
}

/* smooth dancing typing animation */
.typing {
  display: flex;
  align-items: center;
  gap: 6px;

  padding: 8px 12px;
  margin: 6px 0;

  background: #f9f9f9;
  border-radius: 16px;
  max-width: fit-content;
}

.typing .dot {
  width: 6px;
  height: 6px;
  background-color: #3e3efa;
  border-radius: 50%;
  animation: typingWave 1.2s infinite ease-in-out;
}

.typing .dot:nth-child(1) { animation-delay: 0s; }
.typing .dot:nth-child(2) { animation-delay: 0.15s; }
.typing .dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingWave {
  0%   { transform: translateY(0); opacity: 0.6; }
  30%  { transform: translateY(-6px); opacity: 1; }
  60%  { transform: translateY(0); opacity: 0.6; }
  100% { transform: translateY(0); opacity: 0.6; }
}
/* dot message icon */
.bot-message {
  position: relative;
  padding-left: 38px; /* space for icon */
}

/* chat icon hover typing animation */
.chat-icon-typing {
  position: absolute;
  display: flex;
  gap: 6px;
  opacity: 0;
  pointer-events: none;

  transition: opacity 0.2s ease;
}

.chat-icon:hover .chat-icon-typing {
  opacity: 1;
}

/* Dots */
.chat-icon-typing span {
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: iconTyping 1.2s infinite ease-in-out;
}

/* Delay for wave effect */
.chat-icon-typing span:nth-child(1) { animation-delay: 0s; }
.chat-icon-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-icon-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes iconTyping {
  0%   { transform: translateY(0); opacity: 0.6; }
  30%  { transform: translateY(-6px); opacity: 1; }
  60%  { transform: translateY(0); opacity: 0.6; }
  100% { transform: translateY(0); opacity: 0.6; }
}
/* Close chat icon */
.close-chat {
  position: relative;

  width: 36px;
  height: 36px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 1.5rem;
  font-weight: bold;

  color: #fff;
  background: linear-gradient(135deg, #ff4d4d, #d90429);
  border-radius: 50%;

  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

/* Hover animation */
.close-chat:hover {
  transform: scale(1.1) rotate(90deg);
  background: black;
}

/* Click effect */
.close-chat:active {
  transform: scale(0.95);
}
@media screen and (max-width: 600px) {
  .close-chat {
    width: 35px;
    height: 35px;
    min-width: 35px;
    min-height: 35px;
  }
}
/* ===============================
   CHAT BUTTON LAYOUT UPGRADE
   (DESKTOP/TABLET ONLY)
=============================== */
@media (min-width: 468px) {

  .chat-icon {                 /* button-71 feel */
    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 1.8rem;
    box-shadow: 
      rgba(255, 255, 255, .15) 0 3px 15px inset,
      rgba(0, 0, 0, .12) 0 3px 5px,
      rgba(0, 0, 0, .12) 0 10px 13px;

    transition: all .3s ease;
  }

  /* glossy top shine like button-71 */
  .chat-icon::before {
    content: "";
    position: absolute;
    top: 6%;
    left: 4%;
    width: 92%;
    height: 50%;
    border-radius: 125px;

    background-image: linear-gradient(
      rgba(255,255,255,0.7) 0%,
      rgba(255,255,255,0) 100%
    );

    opacity: 0.5;
    pointer-events: none;
  }

  /* hover effect like button-71 */
  .chat-icon:hover {
    transform: scale(1.05);
    box-shadow: 
      rgba(255, 255, 255, .25) 0 3px 15px inset,
      rgba(0, 0, 0, .15) 0 3px 5px,
      rgba(0, 0, 0, .15) 0 12px 18px;
  }
  .chat-window {
    width: 380px;
    height: 450px;
  }
}

/* Mobile = unchanged */
@media (min-width: 668px) {

  .chat-icon {
    border-radius: 56px;                 /* pill shape */
    padding: 14px 26px;                  /* button-71 feel */
    width: auto;
    height: auto;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 1.8rem;
    box-shadow: 
      rgba(255, 255, 255, .15) 0 3px 15px inset,
      rgba(0, 0, 0, .12) 0 3px 5px,
      rgba(0, 0, 0, .12) 0 10px 13px;

    transition: all .3s ease;
  }

  /* glossy top shine like button-71 */
  .chat-icon::before {
    content: "";
    position: absolute;
    top: 6%;
    left: 4%;
    width: 92%;
    height: 50%;
    border-radius: 125px;

    background-image: linear-gradient(
      rgba(255,255,255,0.7) 0%,
      rgba(255,255,255,0) 100%
    );

    opacity: 0.5;
    pointer-events: none;
  }

  /* hover effect like button-71 */
  .chat-icon:hover {
    transform: scale(1.05);
    box-shadow: 
      rgba(255, 255, 255, .25) 0 3px 15px inset,
      rgba(0, 0, 0, .15) 0 3px 5px,
      rgba(0, 0, 0, .15) 0 12px 18px;
  }
  .chat-window {
    width: 380px;
    height: 480px;
  }
}

/* Larger screens = more padding */
@media (min-width: 1024px) {
  .chat-icon {
    padding: 16px 42px;
    font-size: 2rem;
  }
  .chat-window {
    width: 420px;
    height: 496px;
  }
}

/* Large desktop */
@media (min-width: 1100px) {
  .chat-icon {
    padding: 18px 52px;
    font-size: 2.2rem;
  }
  .chat-window {
    width: 450px;
    height: 500px;
  }
}
/* ────────────────────────────────────────
   Bot message layout with avatar + status dot
───────────────────────────────────────── */

.bot-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;                    /* space between avatar and bubble */
  margin: 12px 0;
  max-width: 85%;
}

.bot-avatar-container {
  position: relative;
  flex-shrink: 0;
}

.bot-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #e0e0e0;
  background: #f8f9fa;
  margin-left: -35px;
}

.status-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  background: #28c76f;         /* green - active/online */
  border: 2.5px solid white;
  border-radius: 50%;
  box-shadow:0 0 8px rgba(0,255,90,0.9);
  animation:activePulse 1.8s infinite;
}

/* Bot text bubble */
.bot-text {
  background: #e9ecef;
  color: #212529;
  padding: 10px 14px;
  border-radius: 18px;
  border-top-left-radius: 4px;   /* slightly flattened on avatar side */
  font-size: 15px;
  line-height: 1.38;
  word-wrap: break-word;
}

/* Optional: make user messages align right (cleaner look) */
.user-message {
  margin-left: auto;
  text-align: right;
  background: #6366f1 !important;   /* or your preferred user bubble color */
  color: white !important;
  border-radius: 18px;
  border-top-right-radius: 4px;
  max-width: 80%;
  padding: 10px 14px;
}

/* FOOTER SECTION */

footer {
  height: 26vh;
  margin: 0 1rem;
}

footer p {
  text-align: center;
}