/* =========================================
   Variáveis Globais - Tema Corporativo
   ========================================= */
:root {
  --bg-main: #f3f4f6;
  --bg-surface: #ffffff;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --accent-color: #0ea5e9; /* Azul Corporativo */
  --accent-hover: #0284c7;
  --danger-color: #ef4444;
  --border-color: #e5e7eb;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

/* =========================================
   Reset e Setup Base
   ========================================= */
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
}

/* =========================================
   Componentes Globais (Header)
   ========================================= */
.top-navbar {
  width: 100%;
  max-width: 100dvw;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 5%;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 10;
}

.top-navbar h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

.logout-link {
  color: var(--danger-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.logout-link:hover {
  background-color: #fef2f2;
}

/* =========================================
   Layout Principal e Botões
   ========================================= */
.app-container {
  width: 100%;
  max-width: 700px;
  padding: 32px 20px;
  box-sizing: border-box;
}

.new-chat-btn {
  display: block;
  width: 100%;
  background-color: var(--accent-color);
  color: #ffffff;
  text-align: center;
  padding: 14px 20px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 32px;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
  transition: all 0.2s ease-in-out;
  box-sizing: border-box;
}

.new-chat-btn:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.3);
}

/* =========================================
   Lista de Conversas (Cards)
   ========================================= */
.conversasContainer {
  background-color: var(--bg-surface);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.conversasContainer hr {
  border: none;
  border-bottom: 1px solid var(--border-color);
  margin: 0;
}

.conversasContainer hr:first-child,
.conversasContainer hr:last-child {
  display: none;
}

.conversa {
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: auto auto;
  column-gap: 16px;
  padding: 16px 20px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}

.conversa:hover {
  background-color: #f9fafb;
}

/* Avatar Falso */
.conversa::before {
  content: "";
  grid-row: 1 / 3;
  width: 48px;
  height: 48px;
  background-color: #e2e8f0;
  border-radius: 50%;
  align-self: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z'%3E%3C/path%3E%3C/svg%3E");
  background-size: 26px;
  background-position: center;
  background-repeat: no-repeat;
}

.conversa h3 {
  grid-column: 2;
  grid-row: 1;
  margin: 0 0 4px 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.conversa p {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}