/* ===== Reset & Base ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #9df1ff; /* app background */
  overscroll-behavior: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  height: 100vh;
  margin: 0;
}

/* ===== Native‑style selection prevention ===== */
#app, header, .message, button, .clickable, label, h1, h2, h3, select {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* Allow copy in messages and inputs */
#messageContainer, #messageContainer *,
input, textarea {
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  -webkit-touch-callout: default !important;
}

button, .clickable {
  cursor: default;
  touch-action: manipulation;
}

/* ===== App container ===== */
#app {
  background: #ffffff; /* inner card */
  border-radius: 0;    /* full screen on mobile, optional */
}

/* ===== Header ===== */
header {
  background: #ce79a9; /* theme color */
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}
#statusBadge {
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 20px;
  background: #34d399; /* green */
  color: white;
}
#statusBadge.offline {
  background: #9ca3af;
}

/* ===== Login card ===== */
#loginSection {
  background: white;
  border-radius: 24px;
  padding: 32px 24px;
  margin: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
#loginSection label {
  color: #374151;
  font-weight: 500;
}
#loginSection select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size: 1rem;
  background: white;
}
#loginSection select:focus {
  outline: 2px solid #ce79a9;
  outline-offset: 2px;
}
#connectBtn {
  background: #ce79a9;
  color: white;
  font-weight: 600;
  padding: 14px;
  border-radius: 12px;
  border: none;
  width: 100%;
  transition: background 0.2s;
}
#connectBtn:hover {
  background: #b85c8e;
}
#connectBtn:active {
  transform: scale(0.97);
}

/* ===== Chat ===== */
#messageContainer {
  background: #f9fafb;
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
}
/* Bubbles */
.message {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 18px;
  word-wrap: break-word;
  animation: fadeIn 0.2s ease;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.message-sent {
  background: #ce79a9;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.message-received {
  background: white;
  color: #1f2937;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid #e5e7eb;
}
.message .timestamp {
  font-size: 0.6rem;
  opacity: 0.7;
  margin-top: 4px;
  text-align: right;
}

/* Input bar */
#chatSection > div:last-child {
  background: white;
  border-top: 1px solid #e5e7eb;
  padding: 12px 16px;
  display: flex;
  gap: 8px;
}
#inputText {
  flex: 1;
  padding: 12px 18px;
  border: 1px solid #d1d5db;
  border-radius: 30px;
  font-size: 1rem;
  outline: none;
  background: #f3f4f6;
}
#inputText:focus {
  border-color: #ce79a9;
  box-shadow: 0 0 0 3px rgba(206,121,169,0.2);
}
#submitButton {
  background: #ce79a9;
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
#submitButton:hover {
  background: #b85c8e;
}
#submitButton:active {
  transform: scale(0.93);
}
#submitButton svg {
  width: 24px;
  height: 24px;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Scrollbar ===== */
#messageContainer::-webkit-scrollbar {
  width: 4px;
}
#messageContainer::-webkit-scrollbar-thumb {
  background: #ce79a9;
  border-radius: 4px;
}

/* ===== Responsive safe areas ===== */
#app {
  padding-bottom: env(safe-area-inset-bottom);
}
/* Glass blur navigation */
.glass-nav {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Smooth view transitions */
.fade-enter-active, .fade-leave-active {
  transition: opacity 0.2s ease;
}
.fade-enter-from, .fade-leave-to {
  opacity: 0;
}

/* Modal animations */
.modal-enter-active {
  animation: modalIn 0.2s ease;
}
.modal-enter-from {
  opacity: 0;
  transform: scale(0.9);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* Prevent tap highlight on mobile */
button {
  -webkit-tap-highlight-color: transparent;
}

/* Scrollbar hiding for clean look */
::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

html, body {
  overscroll-behavior-y: contain;
  overscroll-behavior-x: none;
}