/* --- Global Resets & Fluidity --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f0f2f5;
  color: #333;
  line-height: 1.6;
  overflow-x: hidden;
}

/* --- Responsive Header --- */
header {
  background-color: #002d62;
  color: white;
  padding: 1rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.fbi-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fbi-logo img {
  width: 40px;
  height: auto;
}

.fbi-logo h1 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 15px;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
}

/* --- Main Content Containers --- */
main {
  width: 92%;
  max-width: 800px;
  margin: 20px auto;
  background: #ffffff;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  border-top: 6px solid #002d62;
}

h2 {
  font-size: 1.5rem;
  color: #002d62;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
}

/* --- Form Elements --- */
form { display: flex; flex-direction: column; gap: 15px; }

label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: bold;
  color: #555;
}

input[type="text"], input[type="email"], select, textarea {
  border: 1px solid #ddd;
  padding: 12px;
  border-radius: 8px;
  font-size: 1rem;
  background-color: #f9f9f9;
  width: 100%;
}

button, .cta-button, .donate-btn {
  width: 100%;
  padding: 15px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
  border: none;
  text-align: center;
}

/* --- Telegram Style Chat Box --- */
#chatBox {
  width: 92%;
  max-width: 340px;
  position: fixed;
  bottom: 15px;
  right: 4%;
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.2);
  z-index: 2000;
  overflow: hidden;
  display: none; /* Controlled by JS */
}

.chat-head {
  background: #002d62;
  color: white;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Status Indicator */
.status-dot { 
  height: 10px; width: 10px; 
  background-color: #28a745; 
  border-radius: 50%; 
  display: inline-block; 
  margin-right: 5px; 
  animation: pulse 2s infinite; 
}
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }
.status-text { font-size: 0.7rem; color: #28a745; font-weight: bold; text-transform: uppercase; }

.chat-msgs {
  height: 280px;
  padding: 15px;
  overflow-y: auto;
  background: #e5ddd5; /* Classic chat background */
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Message Bubbles */
.chat-msgs p {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 15px;
  font-size: 0.9rem;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  word-wrap: break-word;
}

.msg-user {
  align-self: flex-end;
  background-color: #dcf8c6;
  border-bottom-right-radius: 2px;
}

.msg-agent {
  align-self: flex-start;
  background-color: #ffffff;
  border-bottom-left-radius: 2px;
}

/* Read Receipts (Ticks) */
.read-status {
  font-size: 0.7rem;
  margin-left: 5px;
  float: right;
  margin-top: 5px;
}
.read-blue { color: #34b7f1; }
.read-gray { color: #999; }

/* Stacked Chat Input Area */
.chat-input-container {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #ddd;
  padding: 10px;
  background: #fff;
  gap: 8px;
}

.chat-input-container textarea {
  width: 100%;
  border: 1px solid #ccc;
  padding: 12px;
  outline: none;
  font-size: 0.9rem;
  border-radius: 6px;
  background: #f9f9f9;
  resize: none;
  height: 70px;
}

.send-btn-row {
  display: flex;
  justify-content: flex-end;
}

.send-btn {
  background: #002d62;
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- Landing Page & Grid --- */
.hero p { font-size: 1rem; margin-bottom: 20px; color: #666; }

.emergency-alert {
  background-color: #fff4f4;
  border: 2px solid #d93025;
  color: #b71c1c;
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
  font-size: 0.9rem;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}

.info-card {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #eee;
}

/* --- Media Queries --- */
@media screen and (min-width: 768px) {
  header { padding: 1rem 10%; }
  .fbi-logo h1 { font-size: 1.4rem; }
  main { margin: 40px auto; padding: 40px; }
  .info-grid { grid-template-columns: repeat(3, 1fr); }
  button, .cta-button, .donate-btn { width: auto; min-width: 180px; }
  #chatBox { right: 25px; bottom: 25px; width: 350px; }
}

/* Footer Styling */
footer {
  background: #1a1a1a;
  color: #bbb;
  padding: 30px;
  text-align: center;
  margin-top: 50px;
}

footer ul {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-top: 15px;
  list-style: none;
}

footer a { color: #bbb; font-size: 1.4rem; }
