*{
  margin:0;
  padding:0;
  box-sizing:border-box;
  font-family:Arial;
  }
  
  body{
  height:100vh;
  display:flex;
  flex-direction:column;
  background:#0f172a;
  color:white;
  }

  #chat{
    scroll-behavior:smooth;
  }

  .copy-btn{
    margin-top:5px;
    padding:5px 10px;
    border:none;
    border-radius:6px;
    background:#2196F3;
    color:white;
    cursor:pointer;
    font-size:12px;
  }
  
  .copy-btn:hover{
    background:#0b7dda;
  }


  .logo{
    cursor: pointer;
  }


  .bot, .user{
    white-space: pre-line;
  }

  
  #chat{
    white-space: pre-line;
  }

  #flash{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:white;
    opacity:0;
    pointer-events:none;
    }

  
  .upload-btn input{
    display:none;
  }
  
  .chat-img{
    max-width:150px;
    border-radius:10px;
    margin-top:5px;
    }

  /* HEADER */
  nav{
  height:55px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:0 10px;
  background:#1e293b;
  }
  
  .logo{
  display:flex;
  align-items:center;
  gap:5px;
  }
  
  .logo img{
  height:50px;
  }
  
  /* BUTTONS */
  .nav-btns{
  display:flex;
  gap:6px;
  }
  
  .nav-btns button,
  .upload-btn{
  width:32px;
  height:32px;
  border:none;
  border-radius:6px;
  background:#2563eb;
  color:white;
  font-size:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  }
  
  /* CHAT */
  #chat{
  flex:1;
  overflow-y:auto;
  padding:10px;
  display:flex;
  flex-direction:column;
  }
  
  .user, .bot{
  max-width:70%;
  padding:8px;
  margin:5px 0;
  border-radius:10px;
  }
  
  .user{
  background:#22c55e;
  align-self:flex-end;
  }
  
  .bot{
    background:#334155;
    align-self:flex-start;
  
    display:inline-block;   /* 🔥 ये main fix है */
    max-width:75%;
    padding:8px 10px;
    border-radius:10px;
  
    word-wrap:break-word;
  }
  
  /* IMAGE */
  .chat-img{
  width:150px;
  border-radius:8px;
  margin-top:5px;
  }
  
  /* INPUT */
  .input{
  display:flex;
  padding:8px;
  background:#1e293b;
  }
  
  .input input{
  flex:1;
  padding:8px;
  border:none;
  border-radius:6px;
  }
  
  .input button{
  margin-left:5px;
  padding:8px;
  border:none;
  background:#2563eb;
  color:white;
  border-radius:6px;
  cursor:pointer;
  }
  
  /* FOOTER */
  footer{
  height:30px;
  display:flex;
  justify-content:center;
  align-items:center;
  font-size:11px;
  background:#020617;
  }


  /* 🎤 MIC BUTTON */
.input .mic{
  width:40px;
  height:40px;
  border-radius:50%;
  border:none;
  margin:0 6px;

  background:#ef4444;
  color:white;
  font-size:18px;

  cursor:pointer;
  transition:0.25s;

  /* 🔥 glow */
  box-shadow:0 0 6px rgba(239,68,68,0.6);
}

/* HOVER */
.input .mic:hover{
  box-shadow:0 0 14px rgba(239,68,68,0.9);
  transform:scale(1.1);
}

/* CLICK */
.input .mic:active{
  transform:scale(0.9);
}

/* 🎙 LISTENING ANIMATION */
.mic.listening{
  animation:pulseRed 1s infinite;
}

@keyframes pulseRed{
  0%{box-shadow:0 0 0 0 rgba(239,68,68,0.7);}
  70%{box-shadow:0 0 0 12px rgba(239,68,68,0);}
  100%{box-shadow:0 0 0 0 rgba(239,68,68,0);}
}

/* 🚀 SEND BUTTON */
.send{
  padding:8px 16px;
  border:none;
  border-radius:10px;

  background:linear-gradient(135deg,#3b82f6,#2563eb);
  color:white;
  font-weight:bold;

  cursor:pointer;
  transition:0.25s;

  /* 🔥 glow */
  box-shadow:0 0 8px rgba(37,99,235,0.6);
}

/* arrow */
.send::after{
  content:"➤";
  margin-left:6px;
  font-size:14px;
}

/* HOVER */
.send:hover{
  box-shadow:0 0 18px rgba(37,99,235,1);
  transform:translateY(-2px);
}

/* CLICK */
.send:active{
  transform:scale(0.92);
}


/* ===== LOGO BIG ===== */
.logo img{
  height:48px;
}

/* MOBILE */
@media (max-width:500px){
  .logo img{
    height:50px;
  }
}

/* ===== SEND BUTTON ===== */
.send{
  padding:8px 16px;
  border:none;
  border-radius:10px;

  background:linear-gradient(135deg,#3b82f6,#2563eb);
  color:white;
  font-weight:bold;

  display:flex;
  align-items:center;
  gap:5px;

  cursor:pointer;
  transition:0.25s;

  box-shadow:0 0 8px rgba(37,99,235,0.6);
}

.send::after{
  content:"➤";
}

.send:hover{
  box-shadow:0 0 18px rgba(37,99,235,1);
  transform:translateY(-2px);
}

/* ===== MIC ===== */
.mic{
  width:38px;
  height:38px;
  border-radius:50%;
  border:none;
  margin:0 6px;

  background:#ef4444;
  color:white;

  cursor:pointer;
  transition:0.25s;

  box-shadow:0 0 6px rgba(239,68,68,0.6);
}

.mic:hover{
  box-shadow:0 0 15px rgba(239,68,68,0.9);
  transform:scale(1.1);
}

/* ===== MESSAGE ANIMATION ===== */
.user, .bot{
  animation:msgPop 0.25s ease;
}

@keyframes msgPop{
  from{
    opacity:0;
    transform:translateY(10px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}


.chat-img{
  max-width:100%;     /* box से बाहर नहीं जाएगा */
  width:160px;        /* fixed size */
  border-radius:8px;
  margin-top:5px;
  display:block;
}


.pdf-btn{
  padding:6px 12px;
  border:none;
  border-radius:8px;

  background:linear-gradient(135deg,#22c55e,#16a34a);
  color:white;
  font-size:13px;

  cursor:pointer;
  transition:0.25s;

  box-shadow:0 0 6px rgba(34,197,94,0.5);
}

.pdf-btn:hover{
  box-shadow:0 0 12px rgba(34,197,94,0.9);
  transform:scale(1.05);
}


/* ===== ABOUT POPUP ===== */
.about-overlay{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;

  display:flex;
  justify-content:center;
  align-items:center;

  background:rgba(0,0,0,0.7);
  backdrop-filter:blur(8px);

  z-index:9999;
  animation:fadeIn 0.3s ease;
}

.about-box{
  background:linear-gradient(135deg,#1e293b,#0f172a);
  border:1px solid rgba(255,255,255,0.1);

  padding:25px;
  width:90%;
  max-width:380px;

  border-radius:15px;
  text-align:center;

  box-shadow:0 0 25px rgba(0,0,0,0.6);
}

.about-box h1{
  font-size:26px;
  margin-bottom:8px;
}

.about-box p{
  font-size:14px;
  color:#cbd5e1;
  margin:8px 0;
}

.about-box ul{
  text-align:left;
  margin-top:10px;
  font-size:14px;
}

.about-box li{
  margin:5px 0;
}

.about-box button{
  margin-top:15px;
  padding:8px 18px;

  border:none;
  border-radius:8px;

  background:linear-gradient(135deg,#22c55e,#16a34a);
  color:white;

  cursor:pointer;
  transition:0.25s;
}

.about-box button:hover{
  transform:scale(1.05);
  box-shadow:0 0 12px rgba(34,197,94,0.8);
}


/* ===== PRO ABOUT POPUP ===== */
.about-overlay{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;

  display:flex;
  justify-content:center;
  align-items:center;

  background:rgba(0,0,0,0.6);
  backdrop-filter:blur(12px);

  z-index:9999;
}

/* ANIMATION */
.about-box{
  background:rgba(30,41,59,0.8);
  backdrop-filter:blur(20px);

  border:1px solid rgba(255,255,255,0.1);

  padding:28px;
  width:90%;
  max-width:380px;

  border-radius:18px;
  text-align:center;

  box-shadow:0 20px 60px rgba(0,0,0,0.6);

  transform:scale(0.8);
  opacity:0;
  animation:zoomIn 0.35s ease forwards;
}

@keyframes zoomIn{
  to{
    transform:scale(1);
    opacity:1;
  }
}

/* TEXT */
.about-box h1{
  font-size:28px;
  margin-bottom:6px;
}

.about-box p{
  color:#cbd5e1;
  font-size:14px;
  margin:8px 0;
}

/* FEATURE LIST */
.about-box ul{
  text-align:left;
  margin-top:12px;
}

.about-box li{
  margin:6px 0;
}

/* BUTTON */
.about-box button{
  margin-top:18px;
  padding:10px 20px;

  border:none;
  border-radius:10px;

  background:linear-gradient(135deg,#3b82f6,#2563eb);
  color:white;
  font-weight:bold;

  cursor:pointer;
  transition:0.3s;

  box-shadow:0 0 10px rgba(37,99,235,0.5);
}

.about-box button:hover{
  transform:scale(1.08);
  box-shadow:0 0 20px rgba(37,99,235,1);
}


body.light{
  background:#f1f5f9;
  color:#000;
}

body.light nav{
  background:#e2e8f0;
}

body.light .bot{
  background:#cbd5e1;
}

body.light .user{
  background:#4ade80;
}

.voice-btn:hover{
  background:#555;
}



.nav-btns button:not(.voice-btn){
  width:32px;
  height:32px;
}


.voice-btn{
  width:28;
  height:28px;
  padding:0 10px;
  font-size:11px;
  display:flex;
  align-items:center;
  gap:5px;

  border-radius:6px;
  background:#222;
  color:#fff;

  white-space:nowrap;
}

html, body {
  width: 100%;
  overflow-x: hidden;   /* 🔥 right side cut बंद */
}


nav{
  width:100%;
  flex-wrap:nowrap;
}


.logo, .nav-btns{
  flex-shrink:0;
}



.mic.listening{
  animation:pulseRed 1s infinite, glowFix 1s infinite;
}

@keyframes glowFix{
  0%{
    box-shadow:0 0 5px rgba(239,68,68,0.4);
  }
  50%{
    box-shadow:0 0 20px rgba(239,68,68,1);
  }
  100%{
    box-shadow:0 0 5px rgba(239,68,68,0.4);
  }
}


* {
  -webkit-tap-highlight-color: transparent;
}