/* ==========================================================================
   CHAT IA CRIATIVO — ESTILO CHATGPT / DIRETOR EDITORIAL JAMAL
   ========================================================================== */
.pulse-badge {
  animation: badge-pulse 2s infinite;
  background: linear-gradient(135deg, #2416FF 0%, #00D2FF 100%) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px;
}
@keyframes badge-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.6); }
  50% { transform: scale(1.05); box-shadow: 0 0 8px 3px rgba(0, 210, 255, 0.4); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 210, 255, 0); }
}

.chat-layout {
  display: flex;
  gap: 1.25rem;
  height: calc(100vh - 125px);
  min-height: 600px;
  max-width: 1600px;
  margin: 0 auto;
}

/* Sidebar */
.chat-sidebar {
  width: 320px;
  min-width: 280px;
  background: rgba(10, 15, 29, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  gap: 1.25rem;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.btn-new-chat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #2416FF 0%, #1E40AF 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(36, 22, 255, 0.35);
  transition: all 0.2s ease;
}
.btn-new-chat:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(36, 22, 255, 0.5);
  filter: brightness(1.1);
}

.chat-section-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.chat-persona-selector {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.persona-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}
.persona-btn:hover {
  background: rgba(36, 22, 255, 0.12);
  border-color: rgba(36, 22, 255, 0.3);
  color: #ffffff;
}
.persona-btn.active {
  background: linear-gradient(90deg, rgba(36, 22, 255, 0.25) 0%, rgba(11, 16, 36, 0.6) 100%);
  border-color: #3B82F6;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}
.persona-icon {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
}
.persona-info {
  display: flex;
  flex-direction: column;
}
.persona-info strong {
  font-size: 0.82rem;
  color: #f8fafc;
}
.persona-info small {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.select-chat-style {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: #f8fafc;
  font-size: 0.8rem;
  font-weight: 600;
}

.chat-slides-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
}
.slide-toggle-btn {
  flex: 1;
  padding: 0.45rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.slide-toggle-btn.active {
  background: #2416FF;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(36, 22, 255, 0.4);
}

.chat-history-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.chat-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.btn-text-subtle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.btn-text-subtle:hover {
  color: #ef4444;
}
.chat-history-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-right: 4px;
}
.chat-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-history-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}
.chat-history-item.active {
  background: rgba(36, 22, 255, 0.15);
  border-color: rgba(36, 22, 255, 0.35);
  color: #ffffff;
}
.chat-history-item span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chat Main Area */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(10, 15, 29, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Chat Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.6);
}
.chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.chat-assistant-avatar {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(36, 22, 255, 0.4);
  overflow: hidden;
  background: #000000;
  box-shadow: 0 0 12px rgba(36, 22, 255, 0.3);
}
.chat-assistant-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.online-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  background: #10B981;
  border: 2px solid #070B14;
  border-radius: 50%;
  box-shadow: 0 0 6px #10B981;
}
.chat-assistant-meta {
  display: flex;
  flex-direction: column;
}
.chat-assistant-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.chat-assistant-name strong {
  color: #f8fafc;
  font-size: 0.95rem;
}
.chat-assistant-status {
  font-size: 0.72rem;
  color: var(--emerald-400);
}
.chat-header-actions {
  display: flex;
  gap: 0.5rem;
}

/* Chat Viewport */
.chat-messages-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  scroll-behavior: smooth;
}
.chat-messages {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Welcome Hero */
.chat-welcome-hero {
  text-align: center;
  padding: 2.5rem 1.5rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.4s ease;
}
.welcome-avatar-large {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid #2416FF;
  overflow: hidden;
  background: #050505;
  margin-bottom: 1.25rem;
  box-shadow: 0 0 24px rgba(36, 22, 255, 0.4);
}
.welcome-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chat-welcome-hero h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}
.chat-welcome-hero p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.chat-quick-prompts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  width: 100%;
  max-width: 760px;
}
.quick-prompt-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.quick-prompt-card:hover {
  background: rgba(36, 22, 255, 0.15);
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(36, 22, 255, 0.2);
}
.quick-prompt-icon {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}
.quick-prompt-body strong {
  display: block;
  font-size: 0.85rem;
  color: #f8fafc;
  margin-bottom: 0.2rem;
}
.quick-prompt-body small {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Chat Message Bubbles */
.chat-message {
  display: flex;
  gap: 0.85rem;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-message.user {
  flex-direction: row-reverse;
}
.chat-bubble {
  max-width: 78%;
  padding: 0.95rem 1.25rem;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.55;
  position: relative;
}
.chat-message.user .chat-bubble {
  background: linear-gradient(135deg, #1E3A8A 0%, #172554 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.chat-message.assistant .chat-bubble {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}
.chat-bubble p {
  margin-bottom: 0.65rem;
}
.chat-bubble p:last-child {
  margin-bottom: 0;
}
.chat-bubble ul, .chat-bubble ol {
  margin: 0.5rem 0 0.5rem 1.25rem;
}
.chat-bubble li {
  margin-bottom: 0.3rem;
}
.chat-bubble strong {
  color: #FBBF24;
}

/* Interactive Carousel Card Inside Chat */
.chat-carousel-card {
  margin-top: 1rem;
  background: linear-gradient(180deg, rgba(13, 20, 36, 0.95) 0%, rgba(7, 11, 20, 0.98) 100%);
  border: 1px solid rgba(36, 22, 255, 0.35);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 0 20px rgba(36, 22, 255, 0.15);
}
.chat-carousel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.15rem;
  background: rgba(36, 22, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.carousel-card-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.carousel-card-title-group h3 {
  font-size: 0.9rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.3px;
}
.chat-slide-viewer {
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.3);
}
.chat-slide-card {
  background: #070B14;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.chat-slide-role-badge {
  align-self: flex-start;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  background: rgba(227, 6, 19, 0.2);
  border: 1px solid #E30613;
  color: #FCA5A5;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.chat-slide-headline {
  font-size: 1.15rem;
  font-weight: 900;
  color: #ffffff;
  background: #1E40AF;
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  line-height: 1.25;
  letter-spacing: 0.3px;
}
.chat-slide-headline.alert {
  background: #DC2626;
}
.chat-slide-subheadline {
  font-size: 0.85rem;
  font-weight: 700;
  color: #93C5FD;
}
.chat-slide-body {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #E2E8F0;
  white-space: pre-line;
}
.chat-slide-destaque {
  padding: 0.65rem 0.85rem;
  background: rgba(245, 158, 11, 0.12);
  border-left: 3px solid #F59E0B;
  border-radius: 0 6px 6px 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #FCD34D;
}
.chat-slide-scene {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

/* Slide Nav Controls */
.chat-slide-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: rgba(10, 15, 29, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.chat-slide-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chat-slide-btn:hover:not(:disabled) {
  background: rgba(36, 22, 255, 0.3);
  border-color: #3B82F6;
}
.chat-slide-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.chat-slide-dots {
  display: flex;
  gap: 6px;
}
.chat-slide-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
}
.chat-slide-dot.active {
  width: 22px;
  border-radius: 10px;
  background: #3B82F6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

/* Card Actions Footer */
.chat-carousel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  background: rgba(15, 23, 42, 0.75);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.btn-generate-ai {
  background: linear-gradient(135deg, #1E40AF 0%, #2563EB 50%, #00D2FF 100%) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}
.btn-generate-ai:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(37, 99, 235, 0.6);
  filter: brightness(1.1);
}

/* Typing Indicator */
.chat-typing-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  max-width: 480px;
  animation: fadeIn 0.2s ease;
}
.typing-dots {
  display: flex;
  gap: 4px;
}
.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3B82F6;
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-6px); opacity: 1; }
}
.typing-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* Chat Input Bar (Bottom) */
.chat-input-wrapper {
  padding: 0.85rem 1.5rem 1.25rem 1.5rem;
  background: linear-gradient(180deg, rgba(10, 15, 29, 0) 0%, rgba(10, 15, 29, 0.95) 40%, rgba(10, 15, 29, 1) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.chat-input-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.chat-chips-bar {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 4px;
}
.chat-chip {
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chat-chip:hover {
  background: rgba(36, 22, 255, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  color: #ffffff;
}
.chat-input-box {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 0.65rem 0.85rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.chat-input-box:focus-within {
  border-color: #3B82F6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25), 0 6px 24px rgba(0, 0, 0, 0.5);
}
.chat-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.45;
  resize: none;
  max-height: 180px;
  outline: none;
  padding: 4px 0;
}
.chat-textarea::placeholder {
  color: var(--text-muted);
}
.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2416FF 0%, #1D4ED8 100%);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(36, 22, 255, 0.4);
}
.chat-send-btn:hover:not(:disabled) {
  transform: scale(1.06);
  filter: brightness(1.15);
}
.chat-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-toggle-chat-sidebar {
  display: none;
}
.btn-sidebar-close-mobile {
  display: none;
}

/* Responsividade Mobile/Tablet */
@media (max-width: 980px) {
  .btn-toggle-chat-sidebar {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
    border-radius: var(--radius-md);
  }
  .btn-sidebar-close-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
  }
  .chat-sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .chat-layout {
    flex-direction: column;
    height: calc(100dvh - 205px);
    max-height: calc(100dvh - 205px);
    min-height: 460px;
    position: relative;
    gap: 0;
  }
  .chat-sidebar {
    display: none;
    width: 100%;
    min-width: 100%;
  }
  .chat-sidebar.mobile-open {
    display: flex !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    overflow-y: auto;
  }
  .chat-main {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .chat-messages-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
  }
  .chat-input-wrapper {
    position: sticky;
    bottom: 0;
    z-index: 20;
    padding: 0.5rem 0.65rem 0.75rem 0.65rem;
  }
  .chat-quick-prompts {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
  .chat-bubble {
    max-width: 95%;
  }
  .chat-slide-viewer {
    padding: 0.75rem;
  }
  .chat-carousel-actions {
    flex-direction: column;
  }
}

