*{
  box-sizing:border-box;
  margin:0;
  padding:0;
  font-family: 'Segoe UI', sans-serif;
}

body{
  background: radial-gradient(circle at top, #0b1220, #050816);
  color:white;
  min-height:100vh;

  display:flex;
  justify-content:center;
  align-items:flex-start;   /* IMPORTANT FIX */
  padding:20px;

  overflow-x:hidden;
  flex-direction:column;
}

/* BACKGROUND */
.bg-animation{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background: 
    radial-gradient(circle at 20% 20%, rgba(34,197,94,0.15), transparent 40%),
    radial-gradient(circle at 80% 30%, rgba(59,130,246,0.12), transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(168,85,247,0.12), transparent 40%);
  animation: moveBg 10s infinite alternate;
  z-index:-1;
}

@keyframes moveBg{
  from{transform:scale(1);}
  to{transform:scale(1.1);}
}

/* MAIN CONTAINER */
.container{
  width:100%;
  max-width:520px;

  margin:auto;

  background:rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:18px;

  box-shadow:0 0 30px rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);

  padding:20px;

  display:flex;
  flex-direction:column;
  gap:12px;
}

/* TOP BAR */
.top-bar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:15px;
}

.logo-area{
  display:flex;
  gap:10px;
  align-items:center;
}

.logo{
  width:45px;
  height:45px;
  border-radius:10px;
  box-shadow:0 0 15px #22c55e;
}

h1{
  font-size:18px;
  color:#22c55e;
}

.tagline{
  font-size:11px;
  color:#94a3b8;
}

/* STATUS */
.status{
  font-size:12px;
  padding:5px 10px;
  border-radius:20px;
  background:rgba(34,197,94,0.15);
  border:1px solid #22c55e;
  display:flex;
  align-items:center;
  gap:6px;
}

.dot{
  width:8px;
  height:8px;
  background:#22c55e;
  border-radius:50%;
  box-shadow:0 0 10px #22c55e;
}

/* HERO */
.hero{
  margin:15px 0;
  padding:15px;
  border-radius:15px;
  background:rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
  border:1px solid rgba(255,255,255,0.1);
}

.hero h2{
  font-size:16px;
  margin-bottom:5px;
}

.hero p{
  font-size:12px;
  color:#94a3b8;
}

/* SEARCH */
.search-box{
  display:flex;
  align-items:center;
  gap:10px;
  background:rgba(255,255,255,0.06);
  padding:10px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.1);
  margin-top:10px;
}

.search-box input{
  background:transparent;
  border:none;
  outline:none;
  color:white;
  width:100%;
}

/* INPUTS */
input, textarea{
  width:100%;
  padding:12px;
  margin-top:10px;
  border:none;
  border-radius:10px;
  background:rgba(255,255,255,0.06);
  color:white;
  font-size:13px;
  border:1px solid rgba(255,255,255,0.1);
  outline:none;
}

textarea{
  height:80px;
  resize:none;
}

/* BUTTON */
button{
  width:100%;
  margin-top:15px;
  padding:12px;
  border:none;
  border-radius:12px;
  background:linear-gradient(135deg,#22c55e,#16a34a);
  color:white;
  font-size:14px;
  cursor:pointer;
}

/* STATS */
.stats{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
  margin-top:15px;
}

.card{
  background:rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.1);
  border-radius:12px;
  padding:10px;
  text-align:center;
}

/* REPORTS */
#reports .card{
  margin-top:10px;
}

/* ALERT */
.alert-box{
  margin-top:15px;
  padding:10px;
  border-radius:10px;
  background:rgba(239,68,68,0.1);
  border:1px solid rgba(239,68,68,0.3);
  font-size:12px;
  color:#fca5a5;
}

/* SIDE PANEL */
.side-panel{
  position:fixed;
  left:10px;
  top:50%;
  transform:translateY(-50%);
  width:120px;
  padding:10px;
  background:rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.1);
  border-radius:12px;
  display:none;
}

/* EMPTY STATE */
#emptyState{
  padding:15px;
  border:1px dashed rgba(255,255,255,0.2);
  border-radius:12px;
  background:rgba(255,255,255,0.03);
  margin-top:10px;
}

/* LOADER */
.loader{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:#050816;
  display:flex;
  justify-content:center;
  align-items:center;
  flex-direction:column;
}

.scanner{
  width:60px;
  height:60px;
  border:3px solid #22c55e;
  border-top:3px solid transparent;
  border-radius:50%;
  animation:spin 1s linear infinite;
}

@keyframes spin{
  100%{transform:rotate(360deg);}
}

/* MOBILE */
@media (max-width:600px){
  .stats{
    grid-template-columns:1fr;
  }
}
.footer{
  width:100%;
  text-align:center;
  margin-top:20px;
  padding:12px;

  font-size:11px;
  color:#94a3b8;

  border-top:1px solid rgba(255,255,255,0.08);
  background:rgba(0,0,0,0.2);
  backdrop-filter: blur(10px);
}

.ai-box{
  margin-top:15px;
  padding:12px;
  border-radius:12px;
  background:rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.1);
}

.ai-box h3{
  font-size:13px;
  margin-bottom:8px;
  color:#22c55e;
}

.meter{
  width:100%;
  height:10px;
  background:rgba(255,255,255,0.1);
  border-radius:20px;
  overflow:hidden;
}

#riskBar{
  height:100%;
  width:0%;
  background:linear-gradient(90deg,#22c55e,#facc15,#ef4444);
  transition:0.4s;
}

#riskText{
  font-size:11px;
  margin-top:6px;
  color:#94a3b8;
}

#liveStatus{
  color:#22c55e;
  animation:pulse 1s infinite;
}

@keyframes pulse{
  0%{
    opacity:1;
  }

  50%{
    opacity:0.5;
  }

  100%{
    opacity:1;
  }
}

.chat-box{
  margin-top:20px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.1);
  border-radius:15px;
  overflow:hidden;
}

.chat-header{
  padding:12px;
  background:rgba(34,197,94,0.1);
  color:#22c55e;
  font-weight:bold;
}

.chat-messages{
  height:250px;
  overflow-y:auto;
  padding:10px;
}

.bot,
.user{
  padding:10px;
  border-radius:10px;
  margin-bottom:10px;
  font-size:13px;
  max-width:80%;
}

.bot{
  background:rgba(255,255,255,0.08);
}

.user{
  background:#22c55e;
  margin-left:auto;
  color:white;
}

.chat-input{
  display:flex;
  gap:10px;
  padding:10px;
  border-top:1px solid rgba(255,255,255,0.08);
}

.chat-input input{
  flex:1;
}

.chat-input button{
  width:90px;
}
