/*
Theme Name: LuzzIA
Theme URI: https://luzzia.com.br
Author: Daniel Luzz
Author URI: https://luzzia.com.br
Description: Tema WordPress inspirado no ChatGPT, com agentes de IA e histórico de conversas.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: luzzia
Tags: chat, ai, minimal, black-white, notion
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --cor-fundo: #ffffff;
  --cor-texto: #232324;
  --cor-borda: #ececec;
  --cor-hover: #f4f4f6;
  --cor-ia: #f4f4f6;
  --cor-user: #232324;
  --cor-user-texto: #ffffff;
  --cor-acento: #6b6bff;
  --cor-secundaria: #888;
  --cor-avatar: #ececec;
  --cor-star: #6b6bff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--cor-fundo);
  color: var(--cor-texto);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header global */
#header {
  width: 100%;
  background: var(--cor-fundo);
  border-bottom: 1px solid var(--cor-borda);
  padding: 12px 0px;
  display: flex;
  flex-direction: row;
  align-items: center;
  box-sizing: border-box;
  min-height: 40px;
  margin-bottom: 0;
  flex-shrink: 0;
}

#headerimg {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 32px;
}

#headerimg h1 {
  font-family: 'Inter', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--cor-texto);
  margin: 0;
  display: flex;
  align-items: center;
}

#headerimg h1 a {
  color: var(--cor-texto);
  text-decoration: none;
}

#headerimg .luzzia-logo-star {
  margin-left: 6px;
  font-size: 1.1em;
  animation: luzzia-fade-star 2.5s infinite linear alternate;
  content: "✸";
}

#headerimg .description {
  font-size: 0.8rem;
  color: var(--cor-secundaria);
  font-weight: 400;
  margin-left: 10px;
  white-space: nowrap;
}

@keyframes luzzia-fade-star {
  0% { color: var(--cor-star); }
  25% { color: #ff6bc1; }
  50% { color: #ffd36b; }
  75% { color: #6bffb7; }
  100% { color: var(--cor-star); }
}

/* Layout principal ajustado para ocupar toda a altura do browser */
.luzzia-app-layout {
  display: flex;
  height: 90vh;
  background: #fafafa;
  margin-top: 0;
  border-top: none;
  width: 100vw;
  max-width: 100vw;
  overflow: hidden;
  position: relative;
}

/* Transições das barras laterais */
.luzzia-sidebar-agents, .luzzia-sidebar-history {
  transition: width 0.2s, min-width 0.2s, max-width 0.2s, padding 0.2s;
}

/* Barra lateral de agentes */
.luzzia-sidebar-agents {
  width: 260px;
  background: var(--cor-fundo);
  border-right: 1px solid var(--cor-borda);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0;
  margin-top: 0;
  flex-shrink: 0;
}

.luzzia-agents-header {
  padding: 28px 0px 25px 30px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--cor-secundaria);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--cor-borda);
}

.luzzia-agents-list {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  margin-top: 0;
}

.luzzia-agent {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0 14px 24px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.85rem;
  color: var(--cor-texto);
}

.luzzia-agent.selected, .luzzia-agent:hover {
  background: #dedede;
  font-weight: 600;
  border-radius: 0;
  padding-left: 24px;
}

.luzzia-agent-avatar {
  width: 28px;
  height: 28px;
  color: var(--cor-texto);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}

.luzzia-agent-avatar img {
  width: 16px !important;
  height: 16px !important;
  border-radius: 0 !important;
}

.luzzia-agent-avatar {
  font-size: 1rem; /* Para emoji ou letra, ajuste aqui */
}

.luzzia-agent-avatar > * {
  font-size: 1rem; /* Para emoji ou letra, ajuste aqui */
  line-height: 1;
}

.luzzia-sidebar-footer {
  padding: 10px 0 10px 32px;
  font-size: 0.75rem;
  color: #aaa;
  border-top: 1px solid var(--cor-borda);
  flex-shrink: 0;
}

.luzzia-user-info {
  font-size: 0.7rem;
  color: #aaa;
}

/* Chat principal */
.luzzia-main-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(180deg,rgba(250, 250, 250, 1) 0%, rgba(250, 250, 250, 1) 50%, rgba(255, 255, 255, 1) 100%);
  min-width: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  position: relative;
}

.luzzia-chat-header {
  width: 100%;
  min-width: 320px;
  padding: 12px 100px 10px 100px;
  border-bottom: 1px solid var(--cor-borda);
  background-color: var(--cor-fundo);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0px 15px 25px #f1f1f1;
  z-index: 999;
}

.luzzia-chat-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--cor-texto);
  margin: 0 0 5px 0;
  letter-spacing: -0.01em;
  line-height: 24px;
}

.luzzia-chat-agent {
  font-size: 0.65rem;
  color: var(--cor-secundaria);
  margin-top: 2px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.luzzia-chat-messages {
  flex: 1;
  width: 100%;
  min-width: 320px;
  padding: 16px 100px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  line-height: 1.5;
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0 auto;
  padding-bottom: 80px; /* Espaço para o campo de digitação */
}

.luzzia-chat-bubble {
  display: inline-block;
  padding: 10px 24px 14px 24px;
  border-radius: 18px;
  max-width: 80%;
  word-break: break-word;
  margin-bottom: 2px;
  position: relative;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 28px;
}

.luzzia-bubble-user {
  background: #cbe7ef;
  color: black;
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  margin-left: 20%;
}

.luzzia-bubble-ia {
  background: var(--cor-ia);
  color: var(--cor-texto);
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  margin-right: 20%;
}

.luzzia-bubble-copy {
  position: absolute;
  right: 10px;
  bottom: 6px;
  font-size: 1.1em;
  color: var(--cor-secundaria);
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 2px 4px;
}

.luzzia-bubble-copy:hover {
  opacity: 1;
  color: var(--cor-texto);
}

.luzzia-chat-input {
  width: 100%;
  min-width: 320px;
  padding: 0px 100px;
  display: flex;
  gap: 8px;
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 10;
  margin: 0 auto;
  flex-shrink: 0;
}

.luzzia-chat-input textarea {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid #e0e0e2;
  background: var(--cor-fundo);
  color: var(--cor-texto);
  font-size: 0.95rem;
  font-family: inherit;
  box-shadow: 0px -15px 25px 10px #ffffff;
  resize: none;
  overflow-y: auto;
  min-height: 44px;
  max-height: 132px; /* 6 linhas aproximadamente */
  line-height: 1.4;
  transition: height 0.2s ease;
}

.luzzia-chat-input textarea:focus {
  outline: none;
  border-color: var(--cor-acento);
}

.luzzia-chat-input button {
  background: var(--cor-texto);
  color: var(--cor-fundo);
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.95rem;
  font-family: inherit;
}

.luzzia-chat-input button:hover {
  background: #000;
}

/* Barra lateral de histórico */
.luzzia-sidebar-history {
  width: 320px;
  background: var(--cor-fundo);
  border-left: 1px solid var(--cor-borda);
  display: flex;
  flex-direction: column;
  padding: 0;
  margin-top: 0;
  flex-shrink: 0;
}

.luzzia-history-header {
  padding: 28px 0px 25px 32px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--cor-secundaria);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--cor-borda);
}

.luzzia-history-list {
  flex: 1;
  overflow-y: auto;
}

.luzzia-history-item {
  position: relative;
  padding: 18px 32px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  color: var(--cor-texto);
  display: flex;
  align-items: center;
  gap: 10px;
}

.luzzia-history-item.selected, .luzzia-history-item:hover {
  background: #dedede;
  border-radius: 0;
}

.luzzia-history-title {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--cor-texto);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.luzzia-history-dots {
  display: none;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--cor-secundaria);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.luzzia-history-item:hover .luzzia-history-dots {
  display: block;
}

.luzzia-history-item.menu-open .luzzia-history-menu {
  display: block;
}

.luzzia-history-menu {
  display: none;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--cor-fundo);
  border: 1px solid #e0e0e2;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  z-index: 1000;
  min-width: 120px;
}

.luzzia-history-menu button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 8px 12px;
  text-align: left;
  color: var(--cor-texto);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}

.luzzia-history-menu button:hover {
  background: var(--cor-hover);
}

/* Animação IA pensando */
.luzzia-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 8px 0 0 0;
  height: 24px;
}

.luzzia-typing-dot {
  width: 4px;
  height: 4px;
  background: #bbb;
  display: inline-block;
  animation: luzzia-bounce 1.2s infinite both;
}

.luzzia-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.luzzia-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes luzzia-bounce {
  0%, 80%, 100% { transform: scale(1); }
  40% { transform: scale(1.5); }
}

/* Remover footer completamente */
.site-info, #footer, footer {
  display: none !important;
}

.site-info a, #footer a, footer a {
  display: none !important;
}

.site-info a:hover, #footer a:hover, footer a:hover {
  display: none !important;
}

/* Responsividade */
@media (max-width: 900px) {
  .luzzia-sidebar-history {
    display: none;
  }
  
  .luzzia-sidebar-agents {
    width: 200px;
  }
  
  .luzzia-agents-header, .luzzia-history-header {
    padding: 20px 0px 15px 20px;
  }
  
  .luzzia-agent span {
    font-size: 0.8rem;
  }
  
  .luzzia-main-chat, .luzzia-chat-messages, .luzzia-chat-input {
    padding-left: 0px;
    padding-right: 0px;
  }
  
  .luzzia-chat-header {
    padding: 20px 100px 15px 100px;
  }
}

@media (max-width: 600px) {
  .luzzia-sidebar-agents {
    width: 180px;
  }
  
  .luzzia-sidebar-history {
    width: 180px;
  }
  
  .luzzia-main-chat {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .luzzia-app-layout {
    height: 90vh;
  }
  
  .luzzia-chat-messages, .luzzia-chat-input {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .luzzia-chat-header {
    padding: 15px 15px 10px 15px;
  }
} 

.luzzia-user-link {
  color: #aaa;
  text-decoration: none;
  transition: color 0.2s ease;
  cursor: pointer;
}

.luzzia-user-link:hover {
  color: var(--cor-acento);
  text-decoration: underline;
}

/* Título da pasta de agentes */
.luzzia-agent-folder-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cor-secundaria);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 18px 0 4px 32px;
  padding: 0;
  pointer-events: none;
}

/* Tooltip customizado para descrição do agente */
.luzzia-agent[data-tooltip] {
  position: relative;
}

.luzzia-agent[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 110%;
  top: 50%;
  transform: translateY(-50%);
  background: #232324;
  color: #fff;
  padding: 8px 14px;
  border-radius: 7px;
  white-space: pre-line;
  z-index: 100;
  font-size: 0.95em;
  min-width: 120px;
  max-width: 260px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.13);
  pointer-events: none;
  opacity: 0.97;
}

.luzzia-folder {
    margin-bottom: 1px;
}

.luzzia-folder-header { 
    cursor: pointer;
    padding: 12px 30px;
    font-weight: 500;
    background: #f7f7f7;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
}

.luzzia-folder-toggle {
    margin-left: auto;
}

.luzzia-folder-agents {
    padding: 0px;
}



/* Estilos para mensagens formatadas */
.luzzia-msg-rich {
  line-height: 1.6;
}

.luzzia-msg-rich p {
  margin: 0 0 16px 0; /* Espaçamento duplo entre parágrafos */
}

.luzzia-msg-rich p:last-child {
  margin-bottom: 0;
}

.luzzia-msg-rich strong {
  font-weight: 600;
}

.luzzia-msg-rich em {
  font-style: italic;
}

.luzzia-msg-rich ul {
  margin: 12px 0;
  padding-left: 20px;
}

.luzzia-msg-rich li {
  margin-bottom: 6px;
}

.luzzia-msg-rich li:last-child {
  margin-bottom: 0;
}

/* Estilos para o prompt do sistema */
.luzzia-system-prompt {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  margin: 16px 0;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  border-left: 4px solid #4c63d2;
}

.luzzia-prompt-header {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  opacity: 0.9;
}

.luzzia-prompt-content {
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.95;
}

.luzzia-prompt-content p {
  margin: 0 0 8px 0;
}

.luzzia-prompt-content p:last-child {
  margin-bottom: 0;
}

.luzzia-prompt-content strong {
  font-weight: 600;
}

.luzzia-prompt-content em {
  font-style: italic;
}