@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Admin Button */
.admin-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 14px;
  cursor: pointer;
  z-index: 100;
}

.admin-btn:hover {
  background: rgba(255,255,255,0.25);
}

/* Chat Interface */
.chat-wrapper {
  width: 100%;
  max-width: 420px;
  height: 85vh;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header {
  background: #1e40af;
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.robot-avatar {
  width: 48px;
  height: 48px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.message {
  max-width: 80%;
  padding: 13px 17px;
  border-radius: 18px;
  line-height: 1.45;
  word-wrap: break-word;
  white-space: pre-line;
}

.bot-message {
  align-self: flex-start;
  background: #f1f5f9;
  color: #1e2937;
  border-bottom-left-radius: 5px;
}

.user-message {
  align-self: flex-end;
  background: #3b82f6;
  color: white;
  border-bottom-right-radius: 5px;
}

.input-area {
  padding: 15px;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
}

#user-input {
  flex: 1;
  padding: 14px 18px;
  border: 1px solid #cbd5e1;
  border-radius: 30px;
  font-size: 16px;
  outline: none;
}

.send-btn {
  min-width: 72px;
  height: 52px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  padding: 0 16px;
}

.send-btn:hover {
  background: #2563eb;
}

/* Login Modal */
#login-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15,23,42,0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 20px;
}

.modal-content {
  background: #1e2937;
  color: white;
  padding: 40px;
  border-radius: 16px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.modal-content h2 {
  margin-bottom: 15px;
}

.modal-content input {
  width: 100%;
  padding: 14px;
  margin: 8px 0;
  border-radius: 8px;
  border: none;
  outline: none;
  font-size: 15px;
}

.modal-content button {
  width: 100%;
  padding: 14px;
  margin-top: 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 15px;
}

.primary-btn {
  background: #3b82f6;
  color: white;
}

.primary-btn:hover {
  background: #2563eb;
}

.secondary-btn {
  background: #475569;
  color: white;
}

.secondary-btn:hover {
  background: #334155;
}

.cancel-btn {
  background: #334155;
  color: white;
}

.auth-message {
  margin-top: 15px;
  font-size: 14px;
  color: #fbbf24;
  min-height: 20px;
  line-height: 1.4;
}

/* Admin Dashboard */
#admin-dashboard {
  display: none;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  background: #0f172a;
  color: white;
}

.admin-header {
  background: #1e2937;
  padding: 20px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 15px;
}

.admin-header h2 {
  font-size: 20px;
}

.logout-btn {
  padding: 10px 20px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.logout-btn:hover {
  background: #dc2626;
}

.admin-content {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.admin-content h3 {
  margin: 18px 0 8px;
}

.admin-content input,
.admin-content textarea,
.admin-content select {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  margin: 8px 0;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
}

.admin-content button {
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: white;
  font-size: 15px;
}

.blue-btn {
  background: #3b82f6;
}

.blue-btn:hover {
  background: #2563eb;
}

.red-btn {
  background: #ef4444;
}

.red-btn:hover {
  background: #dc2626;
}

.green-btn {
  background: #10b981;
}

.green-btn:hover {
  background: #059669;
}

#current-scripts {
  background: #1e2937;
  padding: 15px;
  border-radius: 8px;
  min-height: 180px;
  margin-top: 10px;
}

.script-item {
  margin: 10px 0;
  padding: 10px;
  background: #334155;
  border-radius: 6px;
  line-height: 1.5;
}

.small-note {
  color: #cbd5e1;
  font-size: 13px;
  margin-top: 5px;
  line-height: 1.5;
}

@media (max-width: 520px) {
  .chat-wrapper {
    max-width: 94%;
    height: 82vh;
  }

  .modal-content {
    padding: 28px;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .logout-btn {
    width: auto;
  }

  .send-btn {
    min-width: 68px;
    padding: 0 14px;
    font-size: 14px;
  }
}