/* Anonimat - Modern Minimal Light Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e5e7eb;
  --input-bg: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface);
}

/* Header */
.header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-title {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.header-location {
  font-size: 0.75rem;
  color: var(--text-muted);
}

#locationBtn {
  cursor: pointer;
  padding: 6px 12px;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

#locationBtn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Messages */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: 100px;
  background: var(--bg);
}

.empty-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--text-muted);
  text-align: center;
  padding: 40px;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p { margin: 8px 0; }
.hint { font-size: 0.75rem; color: #9ca3af; }

.message {
  margin: 16px 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.message:hover {
  box-shadow: var(--shadow-lg);
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 0.75rem;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.message-username { flex-basis: 100%; display: block; 
  font-weight: 700;
  color: var(--text);
}

.message-location {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.message-location .loc-name {
  color: var(--accent);
}

.message-location .dist {
  color: #9ca3af;
  font-weight: 400;
}

.message-content {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text);
  word-wrap: break-word;
}

/* Input Area */
.input-area {
  padding: 16px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
}

.user-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.username { font-weight: 700; color: var(--text); }
.location-name { color: var(--accent); }

.message-form { display: flex; gap: 12px; align-items: flex-end; }

.message-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9375rem;
  background: var(--input-bg);
  color: var(--text);
  outline: none;
  min-height: 48px;
  max-height: 120px;
  resize: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.message-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.send-btn {
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9375rem;
  transition: all 0.2s;
}

.send-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.send-btn:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  transform: none;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.98);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal-overlay.hidden { display: none; }

.modal {
  max-width: 420px;
  width: 100%;
  text-align: center;
  padding: 40px 32px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

.modal-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.modal-content {
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 24px;
  color: var(--text-muted);
}

.modal-content p {
  margin: 12px 0;
}

.modal-disclaimer {
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin: 12px 0;
}

.modal-btn {
  width: 100%;
  padding: 14px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.modal-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.modal-btn:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  transform: none;
}

.modal-error {
  margin-top: 16px;
  color: #dc2626;
  font-size: 0.8125rem;
}

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

.message {
  animation: fadeIn 0.3s ease-out;
}

/* Scrollbar */
.messages-container::-webkit-scrollbar {
  width: 6px;
}

.messages-container::-webkit-scrollbar-track {
  background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}