:root {
  --saulto-primary: #0A5232;
  --saulto-secondary: #096C3A;
  --saulto-light: #E8F5EE;
  --saulto-accent: #117844;
  --saulto-dark: #02321D;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* Navbar styling */
.navbar {
  background-color: var(--saulto-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
}

.nav-logo {
  height: 40px;
}

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.85);
  padding: 0.75rem 1rem;
  transition: all 0.2s ease-in-out;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
  color: #fff;
  background-color: var(--saulto-accent);
  border-radius: 4px;
}

/* Chatbot styling */
.chatbot-panel {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 700px;
  max-height: 700px;
  position: relative;
  transition: all 0.3s ease;
}

.chatbot-panel.expanded {
  min-height: 90vh;
  max-height: 90vh;
}



.chatbot-resize-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--saulto-primary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  z-index: 10;
}

.chatbot-resize-btn:hover {
  background: rgba(10, 82, 50, 0.1);
}

.chatbot-header {
  padding: 1rem 3rem 1rem 1rem; /* Extra right padding to avoid resize button */
  border-bottom: 1px solid #e0e0e0;
  background: var(--saulto-light);
}

.chatbot-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  display: flex;
  align-items: flex-start;
}

.bot-message {
  justify-content: flex-start;
}

.user-message {
  justify-content: flex-end;
}

.message-content {
  max-width: 90%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.bot-message .message-content {
  background: var(--saulto-light);
  border-bottom-left-radius: 0.25rem;
}

.user-message .message-content {
  background: var(--saulto-primary);
  color: white;
  border-bottom-right-radius: 0.25rem;
}

.chatbot-input {
  padding: 1rem;
  border-top: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.chatbot-input .input-group {
  margin-bottom: 0.5rem;
}

.chatbot-input textarea {
  resize: vertical !important;
  min-height: 38px;
  max-height: 120px;
  overflow-y: auto;
}

.chatbot-input .input-group textarea {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.chat-attachments {
  padding: 0.5rem 0;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 0.5rem;
}

.attachment-preview {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.attachment-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: #e9ecef;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  border: 1px solid #ced4da;
}

.attachment-item .remove-attachment {
  color: #dc3545;
  cursor: pointer;
  margin-left: 0.25rem;
  font-size: 0.75rem;
}

.attachment-item .remove-attachment:hover {
  color: #c82333;
}

.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.typing-indicator {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--saulto-light);
  border-radius: 1rem;
  border-bottom-left-radius: 0.25rem;
  max-width: 85%;
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--saulto-primary);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* AI Response formatting */
.ai-response {
  line-height: 1.6;
}

.ai-response h4, .ai-response h5, .ai-response h6 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.ai-response ul {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.ai-response li {
  margin-bottom: 0.25rem;
}

.ai-response pre {
  margin: 1rem 0;
  border: 1px solid #e0e0e0;
}

.ai-response code {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.85em;
  background: #f8f9fa;
  padding: 2px 4px;
  border-radius: 3px;
}

.ai-response pre code {
  background: none;
  padding: 0;
}

/* Improved code blocks in chatbot */
.message-content pre {
  background: #f8f9fa;
  padding: 0.75rem;
  border-radius: 6px;
  border-left: 3px solid var(--saulto-primary);
  margin: 0.5rem 0;
  overflow-x: auto;
  font-size: 0.9rem;
}

.message-content p {
  margin-bottom: 0.75rem;
}

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

/* Card styling */
.card {
  border: none;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
  background-color: var(--saulto-light);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--saulto-primary);
}

/* Button styling */
.btn-primary {
  background-color: var(--saulto-primary);
  border-color: var(--saulto-primary);
}

.btn-primary:hover {
  background-color: var(--saulto-accent);
  border-color: var(--saulto-accent);
}

.btn-outline-primary {
  color: var(--saulto-primary);
  border-color: var(--saulto-primary);
}

.btn-outline-primary:hover {
  background-color: var(--saulto-primary);
  border-color: var(--saulto-primary);
}

.btn-success {
  background-color: var(--saulto-accent);
  border-color: var(--saulto-accent);
}

.btn-success:hover {
  background-color: var(--saulto-secondary);
  border-color: var(--saulto-secondary);
}

/* Dropzone styling */
.dropzone {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: #f9f9f9;
  margin-bottom: 1rem;
}

.dropzone:hover {
  border-color: var(--saulto-primary);
  background-color: #f0f9f5;
}

.dropzone.active {
  border-color: var(--saulto-primary);
  background-color: #e8f5ee;
}

.dropzone.has-file {
  border-color: var(--saulto-primary);
  background-color: #e8f5ee;
}

.file-info {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Container styling */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.content-container {
  flex: 1;
  padding: 20px 0;
}

/* Loading spinner */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

/* Admin styling */
.editor-container {
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.CodeMirror {
  height: 400px !important;
  font-family: 'Fira Code', monospace;
  font-size: 14px;
}

/* Table styling */
.table th {
  background-color: var(--saulto-light);
  color: var(--saulto-primary);
  font-weight: 600;
}

.table-hover tbody tr:hover {
  background-color: rgba(10, 82, 50, 0.05);
}

/* Modal styling */
.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-header {
  background-color: var(--saulto-light);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--saulto-primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .card-title {
    font-size: 1.25rem;
  }

  .dropzone {
    padding: 1.5rem;
  }

  .chatbot-panel {
    min-height: 400px;
    max-height: 400px;
  }

  .chatbot-panel.expanded {
    min-height: 80vh;
    max-height: 80vh;
  }



  .message-content {
    font-size: 0.9rem;
  }
}

@media (max-width: 992px) {
  .chatbot-panel {
    margin-bottom: 2rem;
  }
}

/* Identifiers Page Styles */
.identifiers-manager {
    margin-top: 20px;
}

.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.identifier-count {
    color: #666;
    font-size: 14px;
}

.add-form {
    margin-bottom: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.add-form h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.identifiers-table {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.identifiers-table table {
    width: 100%;
    border-collapse: collapse;
}

.identifiers-table th,
.identifiers-table td {
    text-align: left;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.identifiers-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.identifiers-table tr:hover {
    background: #f8f9fa;
}

.identifiers-table tr.editing {
    background: #fff3cd;
}

.identifiers-table tr.editing:hover {
    background: #fff3cd;
}

.identifiers-table code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.identifiers-table input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.identifiers-table input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
    margin-right: 5px;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state p {
    margin: 0;
    font-size: 16px;
}

/* Script Editor Styles */