/* style.css
 * Dark, minimal aesthetic for l9zqvx anonymous chat. The design takes
 * inspiration from hacker culture while remaining approachable and
 * accessible. Variables are used for easy theming.
 */

:root {
  --bg: #050608;
  --card-bg: rgba(255, 255, 255, 0.04);
  --panel-bg: rgba(255, 255, 255, 0.02);
  --border: rgba(255, 255, 255, 0.15);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.58);
  --muted2: rgba(255, 255, 255, 0.38);
  --accent: #00b7ff;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background:
    radial-gradient(800px 400px at 50% -200px, rgba(255, 255, 255, 0.07), transparent 70%),
    radial-gradient(600px 300px at 10% 120%, rgba(255, 255, 255, 0.05), transparent 70%),
    var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#app {
  width: min(960px, 100%);
  max-height: 95vh;
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Splash view */
.view {
  display: none;
  flex: 1;
}
.view.active {
  display: flex;
}

.center {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

button {
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--mono);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  user-select: none;
}
button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
}
button:active {
  transform: translateY(1px);
}

input, textarea {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-family: var(--mono);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
input:focus, textarea:focus {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.38);
}

/* Header bar */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}
.bar-title {
  font-family: var(--mono);
  letter-spacing: 4px;
  font-size: 14px;
}
.bar-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}
.bar-nav button {
  padding: 6px 12px;
  font-size: 12px;
}

/* Chat area */
.chat-area {
  flex: 1;
  display: flex;
  position: relative;
}

/* Sidebar for DM contacts */
.sidebar {
  width: 160px;
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  display: none;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar.active {
  display: flex;
}
.sidebar h3 {
  margin: 10px 14px;
  font-size: 13px;
  font-family: var(--mono);
  color: var(--muted);
}
.contact {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.contact:hover {
  background: rgba(255, 255, 255, 0.06);
}
.contact.active {
  background: rgba(255, 255, 255, 0.08);
}
.contact span {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Conversation (main content) */
.conversation {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 80%;
}
.message.me {
  margin-left: auto;
  flex-direction: row-reverse;
}
.bubble {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}
.message.me .bubble {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}
.bubble.system {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  color: var(--muted);
  font-style: italic;
  max-width: 100%;
}
.bubble.dm {
  background: rgba(0, 187, 144, 0.12);
  border-color: rgba(0, 187, 144, 0.3);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar svg {
  width: 100%;
  height: 100%;
}

/* Input area */
.input-area {
  border-top: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.input-area input {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.send-btn {
  width: 48px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 16px;
}

/* Reply preview */
.reply-preview {
  font-size: 11px;
  margin-bottom: 6px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-left: 2px solid var(--accent);
  color: var(--muted);
  border-radius: var(--radius-sm);
}

/* Modal for terms */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}
.modal {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 80vw;
  max-width: 700px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px;
  position: relative;
}
.modal h2 {
  margin-top: 0;
  font-family: var(--mono);
  font-size: 18px;
}
.modal .close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
}
@media (max-width: 768px) {
  .sidebar { display: none !important; }
}