/* RESET BÁSICO */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #020617;
  color: #e5e7eb;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

/* AUTH PAGES */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 80px);
}

.auth-card {
  width: 100%;
  max-width: 420px;
}
.auth-card h1 {
  margin-bottom: 10px;
}
.auth-card p {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 10px;
}


/* LAYOUT GERAL: SIDEBAR + MAIN */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 260px;
  background: #020617;
  border-right: 1px solid rgba(15, 23, 42, 0.9);
  padding: 14px 14px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.sidebar-logo span {
  font-weight: 700;
  font-size: 18px;
}

.sidebar-logo small {
  font-size: 11px;
  opacity: 0.6;
}

.sidebar-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin: 14px 0 6px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-nav a,
.sidebar-nav button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav a:hover,
.sidebar-nav button:hover {
  background: rgba(31, 41, 55, 0.9);
}

.sidebar-nav .primary {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #022c22;
  font-weight: 600;
}

.sidebar-nav .primary:hover {
  filter: brightness(1.05);
}

.sidebar-search {
  margin: 10px 0 8px;
}

.sidebar-search input {
  width: 100%;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: #020617;
  color: #e5e7eb;
  font-size: 13px;
}

.sidebar-search input:focus {
  outline: none;
  border-color: #38bdf8;
}

.sidebar-recent {
  flex: 1;
  margin-top: 6px;
  overflow-y: auto;
}

.sidebar-recent-item {
  font-size: 13px;
  padding: 5px 4px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cbd5f5;
  text-decoration: none;
}

.sidebar-recent-item:hover {
  background: rgba(31, 41, 55, 0.9);
}

.sidebar-user {
  margin-top: 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.9);
  padding-top: 10px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-user strong {
  font-size: 13px;
}

/* MAIN */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top, #020617 0, #020617 40%, #000 100%);
}

.top-bar {
  padding: 14px 28px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar-left h1 {
  font-size: 18px;
  font-weight: 600;
}

.top-bar-left span {
  font-size: 12px;
  color: #9ca3af;
}

.top-bar-right {
  max-width: 360px;
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.search-box {
  width: 100%;
  max-width: 360px;
  background: #020617;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  display: flex;
  align-items: center;
  padding: 6px 10px;
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: #e5e7eb;
  font-size: 13px;
}

.search-box input:focus {
  outline: none;
}

.search-box span {
  font-size: 13px;
  color: #6b7280;
}

.app-container {
  padding: 0 24px 28px;
}

/* BOTÕES E ELEMENTOS GENÉRICOS */
.btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #0b1120;
}

.btn-warning {
  background: linear-gradient(135deg, #facc15, #f97316);
  color: #111827;
}

.btn-danger {
  background: #ef4444;
  color: #f9fafb;
}

.btn-light {
  background: rgba(148, 163, 184, 0.15);
  color: #e5e7eb;
}

/* CARDS */
.card {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 18px;
  padding: 16px 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(31, 41, 55, 0.95);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.7);
}

/* TAGS */
.tag {
  display: inline-flex;
  align-items: center;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  margin-right: 4px;
  margin-top: 4px;
  color: #e5e7eb;
}

/* AVATAR / CHARACTER CARDS */
.avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
  background: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #e5e7eb;
}

.character-tile {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 18px;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  max-width: 260px;
  border: 1px solid rgba(31, 41, 55, 1);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  cursor: pointer;
}

.character-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.9);
  border-color: rgba(56, 189, 248, 0.8);
}

.character-tile-header {
  display: flex;
  gap: 10px;
  margin-bottom: 6px;
}

.character-tile-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.character-tile-title a {
  color: #f9fafb;
  text-decoration: none;
}

.character-tile-title a:hover {
  text-decoration: underline;
}

.character-tile-desc {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 4px;
}

.character-tile-meta {
  font-size: 11px;
  color: #6b7280;
}

.character-tile-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  margin-top: 6px;
}

/* SEÇÕES DA HOME */
.feed-section {
  margin-bottom: 18px;
}

.feed-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.feed-section-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.feed-section-header span {
  font-size: 12px;
  color: #9ca3af;
}

.horizontal-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
  scroll-padding: 16px;
}

.horizontal-list > * {
  scroll-snap-align: start;
}

/* scrollbar mais discreta opcional */
.horizontal-list::-webkit-scrollbar {
  height: 6px;
}
.horizontal-list::-webkit-scrollbar-thumb {
  background: rgba(100,100,100,0.5);
  border-radius: 20px;
}


/* FORMULÁRIOS GENÉRICOS */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  background: rgba(15, 23, 42, 0.96);
  border-radius: 10px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  padding: 8px 10px;
  color: #e5e7eb;
  font-size: 14px;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #38bdf8;
}

/* CHAT */
.chat-wrapper {
  display: flex;
  gap: 14px;
}

.chat-main {
  flex: 3;
  display: flex;
  flex-direction: column;
  height: 70vh;
}

.chat-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  border-radius: 16px;
  background: #020617;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid rgba(31, 41, 55, 0.9);
}

.msg {
  max-width: 82%;
  padding: 8px 10px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 8px;
  white-space: pre-wrap;
}

.msg-user {
  margin-left: auto;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #020617;
  border-bottom-right-radius: 4px;
}

.msg-bot {
  margin-right: auto;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(55, 65, 81, 0.9);
  border-bottom-left-radius: 4px;
}

.msg-label {
  font-size: 11px;
  opacity: 0.75;
  margin-bottom: 2px;
}

.chat-sidebar {
  flex: 1.3;
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.show {
  display: flex;
}

/* TABELAS */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  padding: 6px 4px;
}

th {
  text-align: left;
  color: #9ca3af;
}

/* RESPONSIVO */
@media (max-width: 960px) {
  .app-sidebar {
    display: none;
  }
  .top-bar {
    padding: 10px 14px;
  }
  .app-container {
    padding: 0 14px 18px;
  }
}

@media (max-width: 768px) {
  /* cards maiores ocupando boa parte da tela */
  .big-character-card {
    width: 80vw;
    height: 72vw;
    border-radius: 22px;
  }

  .big-character-info {
    padding: 14px 16px;
  }

  .big-character-title {
    font-size: 18px;
  }

  .big-character-desc {
    font-size: 13px;
  }

  .big-character-meta {
    font-size: 12px;
  }

  .app-container {
    padding: 0 12px 20px;
  }

  .top-bar {
    padding: 12px 12px 8px;
  }

  .top-bar-left h1 {
    font-size: 20px !important;
  }

  .top-bar-left span {
    font-size: 13px !important;
  }
}


@media (max-width: 900px) {
  .chat-wrapper {
    flex-direction: column;
  }
  .chat-main {
    height: 60vh;
  }
  .chat-sidebar {
    order: -1;
  }
}

/* ==== NOVO ESTILO DE CARDS GRANDES ==== */

.big-character-card {
  position: relative;
  width: 260px;
  height: 360px;
  border-radius: 18px;
  overflow: hidden;
  background: #111827;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.big-character-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.6);
}

/* Imagem de capa */
.big-character-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Overlay escuro no rodapé */
.big-character-info {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 12px 14px;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.85),
    rgba(0,0,0,0.3),
    rgba(0,0,0,0)
  );
  color: #fff;
}

.big-character-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.big-character-desc {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 4px;
}

.big-character-meta {
  font-size: 12px;
  opacity: 0.7;
}

/* Favorito dentro do card */
.big-character-fav {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.55);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 14px;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}
.big-character-fav:hover {
  background: rgba(0,0,0,0.8);
}

/* Texto geral um pouco maior */
body, input, textarea, select {
  font-size: 15px;
}

h1, h2, h3 {
  font-size: 22px !important;
}

.sidebar-nav a,
.sidebar-nav button {
  font-size: 14px !important;
}

.top-bar-left h1 {
  font-size: 22px !important;
}

.top-bar-left span {
  font-size: 14px !important;
}

/* ==== ESTILO DO CHAT TIPO CHARACTER.AI ==== */

/* Container principal */
.chat-wrapper-modern {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  padding: 0 20px;
}

/* Header */
.chat-header-modern {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-info img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0,0,0,0.40);
}

.chat-header-name {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.chat-header-author {
  font-size: 13px;
  color: #9ca3af;
}

/* Ações (fav + donate) */
.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Área das mensagens */
.chat-messages-modern {
  flex: 1;
  overflow-y: auto;
  padding: 18px 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* bolhas */
.bubble {
  max-width: 70%;
  padding: 14px 16px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.45;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  white-space: pre-wrap;
}

.bubble-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #0f172a;
  border-bottom-right-radius: 6px;
}

.bubble-bot {
  align-self: flex-start;
  background: #1e293b;
  border-bottom-left-radius: 6px;
  color: #e2e8f0;
}

/* Enviar Mensagem */
.chat-input-modern {
  padding: 14px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.chat-input-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #111827;
  border: 1px solid rgba(255,255,255,0.10);
  padding: 12px 18px;
  border-radius: 999px;
}

.chat-textarea {
  flex: 1;
  background: transparent;
  color: #e5e7eb;
  border: none;
  font-size: 15px;
  resize: none;
}

.chat-textarea:focus {
  outline: none;
}

.chat-send-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
}

.chat-send-btn:hover {
  background: #1d4ed8;
}

/* Rodapé */
.chat-footer-text {
  text-align: center;
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.6;
}

