* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1d4ed8 0, #020617 45%, #000 100%);
  color: #f9fafb;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 16px;
}

.chat-container {
  background: rgba(15, 23, 42, 0.96);
  width: 100%;
  max-width: 640px;
  height: 80vh;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.3);
  backdrop-filter: blur(18px);
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  background: linear-gradient(90deg, #020617, #0b1120, #1d4ed8);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-header-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}

.chat-header h1 {
  font-size: 1.2rem;
}

.chat-subtitle {
  font-size: 0.8rem;
  color: #9ca3af;
}

.ghost-btn{
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #e5e7eb;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}
.ghost-btn:hover{
  border-color: rgba(148, 163, 184, 0.8);
}

.primary-btn{
  padding: 10px 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: white;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.5);
}
.primary-btn:active{
  transform: scale(0.98);
}

.chat-main {
  flex: 1;
  padding: 14px 16px;
  overflow-y: auto;
  background: radial-gradient(circle at 10% 0, rgba(37, 99, 235, 0.24), transparent 50%),
              radial-gradient(circle at 90% 100%, rgba(236, 72, 153, 0.18), transparent 55%);
}

.messages {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.messages li {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  font-size: 0.95rem;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.8);
  word-wrap: break-word;
  position: relative;
}

.messages li .meta {
  display: block;
  font-size: 0.7rem;
  color: #9ca3af;
  margin-bottom: 4px;
}

.messages li .time {
  font-size: 0.7rem;
  color: #6b7280;
  margin-top: 4px;
  text-align: right;
}

.messages li.self {
  margin-left: auto;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.messages li.other {
  margin-right: auto;
}

.chat-form {
  display: flex;
  padding: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  background: #020617;
  gap: 8px;
}

.chat-form input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #020617;
  color: #e5e7eb;
  outline: none;
  font-size: 0.95rem;
  transition: box-shadow 0.1s ease, border-color 0.1s ease, background 0.1s ease;
}

.chat-form input::placeholder {
  color: #6b7280;
}

.chat-form input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.5);
  background: #020617;
}

.chat-form button {
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.08s ease, box-shadow 0.12s ease;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.5);
  white-space: nowrap;
}

.chat-form button:hover {
  background: linear-gradient(135deg, #1d4ed8, #4338ca);
}

.chat-form button:active {
  transform: scale(0.97) translateY(1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.7);
}

/* ----- Modal pseudo ----- */
.modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,0.72);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 16px;
  z-index: 9999;
}

.modal{
  width: 100%;
  max-width: 420px;
  background: rgba(15,23,42,0.98);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  padding: 18px;
}

.modal h2{
  font-size: 1.1rem;
  margin-bottom: 6px;
}
.modal-sub{
  font-size: 0.85rem;
  color: #9ca3af;
  margin-bottom: 12px;
}

.modal-form{
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.modal-form input{
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #020617;
  color: #e5e7eb;
  outline: none;
  font-size: 0.95rem;
}
.modal-form input:focus{
  border-color:#3b82f6;
  box-shadow: 0 0 0 1px rgba(59,130,246,0.5);
}

.modal-actions{
  display:flex;
  gap: 10px;
  justify-content:flex-end;
}

.hidden{
  display:none;
}

@media (max-width: 600px) {
  body { padding: 0; }
  .chat-container {
    height: 100vh;
    max-width: 100%;
    border-radius: 0;
  }
}