:root {
  --bg-primary: #0d0d0d;
  --bg-secondary: #171717;
  --bg-tertiary: #212121;
  --bg-hover: #2a2a2a;
  --text-primary: #ececec;
  --text-secondary: #a0a0a0;
  --text-muted: #6b6b6b;
  --accent: #10a37f;
  --accent-hover: #0d8c6d;
  --user-bubble: #2f2f2f;
  --admin-bubble: #1a1a1a;
  --border: #333;
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  --success: #10a37f;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --header-height: 56px;
  --input-max-height: 200px;
  --chat-gutter: 16px;
  --font-size-base: 16px;
  --font-size-sm: 14px;
  --font-size-xs: 12px;
  --font-size-lg: 18px;
  --font-size-xl: 24px;
  --avatar-size: 32px;
  --content-max: 100%;
}

@media (min-width: 640px) {
  :root {
    --header-height: 60px;
    --chat-gutter: 24px;
    --font-size-base: 17px;
    --font-size-sm: 15px;
    --font-size-xs: 13px;
    --font-size-lg: 20px;
    --font-size-xl: 28px;
    --avatar-size: 36px;
    --content-max: 900px;
  }
}

@media (min-width: 1024px) {
  :root {
    --header-height: 64px;
    --chat-gutter: 32px;
    --font-size-base: 18px;
    --font-size-sm: 16px;
    --font-size-xs: 14px;
    --font-size-lg: 22px;
    --font-size-xl: 32px;
    --avatar-size: 40px;
    --content-max: 1100px;
  }
}

@media (min-width: 1440px) {
  :root {
    --chat-gutter: 48px;
    --content-max: 1280px;
  }
}

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

html {
  font-size: var(--font-size-base);
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--text-secondary);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.hidden {
  display: none !important;
}

/* Loading screen */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 16px;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error banner */
.error-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--error-bg);
  color: var(--error);
  padding: 10px 16px;
  text-align: center;
  font-size: 14px;
  z-index: 1000;
  border-bottom: 1px solid var(--error);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

/* Connection status */
.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.connection-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
}

.connection-dot.online {
  background: var(--success);
}

.connection-dot.offline {
  background: var(--error);
}

.connection-dot.reconnecting {
  background: #f59e0b;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
