:root {
  --bg: #0F1F2D;
  --card: #254666;
  --border: rgba(255, 255, 255, 0.1);
  --text: #626060;
  --primary: #0080FF;
  --shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
  --obs-bg-dark: #132D42;
  --obs-bg-darker: #0F1F2D;
  --obs-blue-primary: #0080FF;
  --obs-blue-light: #40BBFF;
  --obs-red-alert: #e03131;
  --text-dark: #25262b;
  --text-light: #C1C2C5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  padding: 24px;
}

.layout-mapa {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
  max-width: 1220px;
  margin: 0 auto;
}

.coluna-esquerda {
  display: grid;
  gap: 16px;
}

.coluna-direita {
  display: grid;
  gap: 10px;
  align-content: start;
}

.info-atualizacao {
  margin: 0;
  font-size: 13px;
  color: #c0c7d1;
  text-align: right;
  position: relative;
  z-index: 10;
  padding: 10px 0;
  background: transparent;
}

.box-mapa {
  padding: 0;
  background: transparent;
}

#map {
  width: 100%;
  height: 580px;
  display: block;
  background: transparent;
}

.shape {
  fill: #254666;
  stroke: #2d2318;
  stroke-width: 1.2;
  cursor: pointer;
  transition: all 0.3s ease;
  filter: url(#shadow-3d-map);
}

.state:hover .shape {
  filter: brightness(1.15) url(#shadow-3d-map);
  transform: translateY(-2px);
}

.state.active .shape {
  filter: brightness(1.25) url(#shadow-3d-map);
  stroke-width: 2.5;
}

.label_icon_state {
  font-size: 12px;
  fill: #fff;
  font-weight: 700;
  pointer-events: none;
}

.state[data-state="rj"]:hover~.rj-conexoes,
.rj-conexoes:hover {
  display: block !important;
}

.state[data-state="mg"]:hover~.mg-conexoes,
.mg-conexoes:hover {
  display: block !important;
}

.state--pa .shape,
.state--ba .shape {
  fill: #6f9303;
  stroke: #fff;
}

.state--pa:hover .shape,
.state--pa.active .shape,
.state--ba:hover .shape,
.state--ba.active .shape {
  fill: #5b7a02;
  stroke: #fff;
}

.fonte-ibge {
  margin: 8px 0 0;
  font-size: 12px;
  color: #e0e1e1;
}

.modal-estado {
  width: 380px;
  height: 600px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  overflow-y: auto;
  position: sticky;
  top: 24px;
  box-shadow: var(--shadow);
}

#seletory {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
  padding: 0 44px 0 14px;
  font-size: 16px;
  line-height: 1.3;
  color: #1f2937;
  background-color: #fff;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364758b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
}

label[for="seletory"] {
  color: #1f2937;
}

.estado {
  display: none;
  background: #0F1F2D;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.estado.active {
  display: block;
}

.estado h3,
.polos-estado h3 {
  margin: 0;
}

.sec-divider {
  height: 1px;
  width: 100%;
  background: var(--border);
  margin: 10px 0 12px;
}

.lista-bullets {
  margin: 0;
  padding-left: 20px;
  list-style: disc;
  display: grid;
  gap: 8px;
}

.lista-bullets li {
  display: list-item;
  line-height: 1.45;
}

.box-polos {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.box-polos h2 {
  display: inline-block;
  margin: 0 0 12px;
}

.box-polos h3 {
  display: inline-block;
  color: #40BBFF;
  font-weight: 800;
  margin: 0 0 12px 8px;
}

.polos-placeholder {
  margin: 0;
  display: none;
}

.polos-placeholder.active {
  display: block;
}

.polos-estado {
  display: none;
}

.polos-estado.active {
  display: contents;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 960px) {
  body {
    padding: 16px;
  }

  .layout-mapa {
    grid-template-columns: 1fr;
  }

  .box-mapa {
    display: none;
  }

  .coluna-esquerda {
    order: 2;
  }

  .coluna-direita {
    order: 1;
  }

  .modal-estado {
    order: 1;
    width: 100%;
    height: auto;
    max-height: none;
    position: static;
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
  }

  .estado {
    display: none !important;
  }

  .info-atualizacao {
    text-align: left;
  }
}

#shape_pa {
  fill: #6f9303 !important;
  stroke: #fff !important;
}

#shape_ba {
  fill: #009245 !important;
  stroke: #fff !important;
}

#shape_mg {
  fill: #f2923f !important;
  stroke: #fff !important;
}

#shape_sp {
  fill: #cd5be8 !important;
  stroke: #fff !important;
}

#shape_pr {
  fill: #48b4e1 !important;
  stroke: #fff !important;
}

#shape_sc {
  fill: #5498fe !important;
  stroke: #fff !important;
}

#shape_rs {
  fill: #04d7b6 !important;
  stroke: #fff !important;
}

#shape_rj {
  fill: #284984 !important;
  stroke: #fff !important;
}

#shape_es {
  fill: #ff514d !important;
  stroke: #fff !important;
}

#shape_go {
  fill: #88b6d9 !important;
  stroke: #fff !important;
}

#shape_ms {
  fill: #c8d400 !important;
  stroke: #fff !important;
}

#shape_mt {
  fill: #0770b7 !important;
  stroke: #fff !important;
}

#shape_rn {
  fill: #d5ac00 !important;
  stroke: #fff !important;
}


/* Logos */

.rj-link-line {
  stroke: #c5c5c5;
  stroke-width: 2;
  stroke-dasharray: 6;
}

.rj-card-group {
  width: 220px;
  height: 70px;
}

.rj-card-bg {
  width: 220px;
  height: 70px;
  fill: #fff;
  stroke: #d8deea;
  stroke-width: 1;
}

.rj-card-image {
  width: 220px;
  height: 70px;
}

:root {
  --primary-color: #0080FF;
  --secondary-color: #40BBFF;
  --text-primary: #ffffff;
  --text-secondary: #C1C2C5;
  --background-primary: #181717;
  --background-secondary: #132D42;
  --background-tertiary: rgba(255, 255, 255, 0.03);
  --ai-message-bg: rgba(255, 255, 255, 0.05);
  --user-message-bg: #0080FF;
  --user-message-text: #fff;
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.2);
  --animation-speed: 0.3s;
  --border-radius: 12px;
  --typing-indicator-color: var(--primary-color);
}

.dark-mode {
  --primary-color: #9d74ff;
  --secondary-color: #b388ff;
  --text-primary: #e0e0e0;
  --text-secondary: #aaaaaa;
  --background-primary: #1a1a1a;
  --background-secondary: #252525;
  --background-tertiary: #333333;
  --ai-message-bg: #2d2d3d;
  --user-message-bg: #9d74ff;
  --user-message-text: #fff;
  --border-color: #444;
  --shadow-color: rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  transition: background-color var(--animation-speed),
    color var(--animation-speed);
}

body {
  background-color: #0F1F2D;
  color: #ffffff;
}

.code-copy-container {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
}

.code-copy-button {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ddd;
  border: none;
  border-radius: 4px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.code-copy-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
}

.code-copy-button.copied {
  background-color: #4caf50;
  color: white;
}

.container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 20px;
}

.app-container {
  display: flex;
  width: 100%;
  max-width: 1200px;
  height: 85vh;
  background-color: var(--background-primary);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 30px var(--shadow-color);
  overflow: hidden;
  position: relative;
}

/* Sidebar Styles */
.sidebar {
  width: 260px;
  background-color: var(--background-tertiary);
  padding: 20px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
}

.logo {
  display: flex;
  align-items: center;
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 24px;
  color: var(--primary-color);
}

.logo i {
  margin-right: 10px;
  font-size: 24px;
}

.new-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 20px;
  transition: background-color 0.2s, transform 0.1s;
}

.new-chat-btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
}

.new-chat-btn i {
  margin-right: 8px;
}

.history-container {
  flex: 1;
  overflow-y: auto;
}

.history-container h3 {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding-left: 5px;
}

.chat-history-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--border-radius);
  margin-bottom: 5px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
  overflow: visible;
}

#chat-history span {
  white-space: nowrap;
  width: 16ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-history-item:hover {
  background-color: var(--background-secondary);
}

.chat-history-item.active {
  background-color: rgba(124, 77, 255, 0.1);
  font-weight: 500;
}

.chat-history-item i {
  margin-right: 10px;
  color: var(--text-secondary);
  font-size: 14px;
}

.settings {
  margin-top: 20px;
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
}

.settings button {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 10px 5px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-radius: var(--border-radius);
  font-size: 14px;
  transition: background-color 0.2s;
}

.settings button:hover {
  background-color: var(--background-secondary);
  color: var(--text-primary);
}

.settings button i {
  margin-right: 10px;
  width: 16px;
}

/* Chat Container Styles */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #254666;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  border-bottom: 1px solid var(--border-color);
}

.current-chat-title {
  font-weight: 600;
  font-size: 16px;
}

.header-actions button {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  padding: 5px;
  border-radius: 5px;
  transition: color 0.2s, background-color 0.2s;
}

.header-actions button:hover {
  color: var(--primary-color);
  background-color: var(--background-tertiary);
}

/* Added regenerate, stop, and export button styling */
.header-actions button#regenerate-response {
  margin-right: 5px;
}

/* Chat messages */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0;
}

.message {
  display: flex;
  margin: 25px;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-content {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: var(--border-radius);
  font-size: 15px;
  line-height: 1.5;
}

.message.ai {
  justify-content: flex-start;
}

.message.user {
  justify-content: flex-end;
}

.message.ai .message-content {
  background-color: var(--ai-message-bg);
  color: var(--text-primary);
  border-radius: var(--border-radius);
}

.message.user .message-content {
  background-color: var(--user-message-bg);
  color: var(--user-message-text);
  border-radius: var(--border-radius);
}

.message.ai .message-content h1 {
  font-size: 22px;
  margin: 16px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  color: var(--primary-color);
}

.message.ai .message-content h2 {
  font-size: 18px;
  margin: 14px 0 8px;
  color: var(--text-primary);
}

.message.ai .message-content h3 {
  font-size: 16px;
  margin: 12px 0 6px;
  color: var(--text-primary);
}

/* List styles for better readability */
.message.ai .message-content ul,
.message.ai .message-content ol {
  margin: 8px 0;
  padding-left: 25px;
}

.message.ai .message-content li {
  margin-bottom: 5px;
}

/* Block quote styling */
.message.ai .message-content blockquote {
  border-left: 4px solid var(--primary-color);
  padding: 0 0 0 15px;
  margin: 10px 0;
  color: var(--text-secondary);
}

/* Table styling */
.message.ai .message-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 15px 0;
}

.message.ai .message-content th,
.message.ai .message-content td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  text-align: left;
}

.message.ai .message-content th {
  background-color: var(--background-tertiary);
  font-weight: 600;
}

/* Links styling */
.message.ai .message-content a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

.message.ai .message-content a:hover {
  text-decoration: underline;
}

/* CTA "Acessar documento" button */
.cta-doc-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 10px 0 4px;
  padding: 9px 18px;
  background: linear-gradient(135deg, #0080FF 0%, #40BBFF 100%);
  color: #ffffff !important;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  border-radius: 8px;
  text-decoration: none !important;
  box-shadow: 0 3px 12px rgba(0,128,255,0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  cursor: pointer;
  line-height: 1;
}

.cta-doc-link::before {
  content: "\f15b"; /* fa-file */
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 12px;
  opacity: 0.9;
}

.cta-doc-link::after {
  content: "\f35d"; /* fa-external-link-alt */
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 11px;
  opacity: 0.75;
}

.cta-doc-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,128,255,0.5);
  filter: brightness(1.1);
  text-decoration: none !important;
}

.cta-doc-link:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0,128,255,0.3);
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-addition {
  color: #c792ea;
}

.hljs-number,
.hljs-string,
.hljs-doctag,
.hljs-regexp {
  color: #89ca78;
}

.hljs-title,
.hljs-section,
.hljs-built_in,
.hljs-name {
  color: #e2b93d;
}

.hljs-variable,
.hljs-template-variable,
.hljs-selector-id,
.hljs-class .hljs-title {
  color: #7fdbca;
}

.hljs-type,
.hljs-tag {
  color: #e06c75;
}

/* Language badge for code blocks */
pre::before {
  content: attr(class);
  position: absolute;
  top: 5px;
  left: 12px;
  font-size: 12px;
  color: #aaa;
  display: none;
}

/* Horizontal rule */
.message.ai .message-content hr {
  border: none;
  height: 1px;
  background-color: var(--border-color);
  margin: 15px 0;
}

.typing-indicator {
  display: flex;
  padding: 15px 25px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  margin: 0 2px;
  background-color: var(--typing-indicator-color);
  border-radius: 50%;
  opacity: 0.6;
  animation: typingAnimation 1.5s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingAnimation {
  0% {
    transform: translateY(0px);
  }

  25% {
    transform: translateY(-5px);
  }

  50% {
    transform: translateY(0px);
  }
}

.input-area {
  padding: 15px 25px 20px;
  border-top: 1px solid var(--border-color);
}

.input-container {
  display: flex;
  position: relative;
  background-color: var(--background-tertiary);
  border-radius: var(--border-radius);
  overflow: hidden;
}

/* Style for file upload button */
#file-upload-button {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  padding: 15px;
  cursor: pointer;
}

#file-upload-button:hover {
  color: var(--primary-color);
}

textarea {
  flex: 1;
  border: none;
  background: none;
  padding: 15px;
  font-size: 15px;
  resize: none;
  max-height: 150px;
  color: var(--text-primary);
  outline: none;
}

textarea::placeholder {
  color: var(--text-secondary);
}

#send-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  width: 40px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s;
}

#send-button:hover {
  background-color: var(--secondary-color);
}

.disclaimer {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 10px;
}

/* Pending file preview (for selected file before send) */
#pending-file-preview {
  display: none;
  margin: 10px 0;
}

/* Intro Message Styles */
.intro-message {
  text-align: center;
  max-width: 600px;
  margin: 40px auto;
  padding: 30px;
  background-color: var(--background-primary);
  border-radius: var(--border-radius);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  animation: fadeIn 0.5s ease-out;
}

.intro-message h1 {
  color: var(--primary-color);
  font-size: 28px;
  margin-bottom: 15px;
}

.intro-message p {
  color: var(--text-secondary);
  margin-bottom: 25px;
  font-size: 16px;
}

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.suggestion-chip {
  background-color: var(--background-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.suggestion-chip:hover {
  background-color: var(--background-secondary);
  color: var(--primary-color);
  transform: translateY(-2px);
}

/* Code block styling */
pre {
  position: relative;
  background-color: #282c34;
  border-radius: 8px;
  padding: 12px;
  padding-top: 35px;
  overflow-x: auto;
  margin: 10px 0;
  border: 1px solid #3e4451;
  color: #edf0f7;
}

code {
  font-family: "Fira Code", "Courier New", Courier, monospace;
  font-size: 14px;
}

pre code {
  white-space: pre;
  font-size: 14px;
  line-height: 1.5;
}

:not(pre)>code {
  background-color: rgba(125, 125, 125, 0.1);
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--primary-color);
}

/* New CSS for chat options button and menu */
.chat-options-button {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  padding: 5px;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.chat-options-menu {
  position: absolute;
  right: 10px;
  top: 100%;
  background-color: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 8px var(--shadow-color);
  z-index: 100;
}

.chat-options-item {
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.chat-options-item:hover {
  background-color: var(--background-secondary);
}
/* ===================================================================
   CHAT TEMPORARIAMENTE OCULTO
   Para reativar: remover ou comentar as linhas abaixo
   =================================================================== */
.container {
  display: none !important;
}

/* ===================================================================
   BOTÃO DOCUMENTOS POLO - Modal Estado
   =================================================================== */
.btn-documentos-polo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid #ffffff0d;
  border-left: 3px solid var(--obs-blue-primary, #0080FF);
  background: linear-gradient(145deg, #1c2d3f, #152231);
  box-shadow: 0 4px 6px -1px #0000004d;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  width: 100%;
  justify-content: center;
}

.btn-documentos-polo:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px -2px #0000006d;
  border-left-color: var(--obs-blue-light, #40BBFF);
  background: linear-gradient(145deg, #1f3448, #18273a);
}

.btn-documentos-polo:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px -1px #0000004d;
}

.btn-documentos-polo i {
  font-size: 16px;
  color: var(--obs-blue-light, #40BBFF);
}

.btn-documentos-polo span {
  letter-spacing: 0.3px;
}
