/* ===== IMPORT POPPINS FONT ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ===== GLOBAL STYLES ===== */
body {
  background: linear-gradient(to right, #f8f9fa, #e9ecef);
  /* Light Gray Gradient */
  color: #333;
  /* Dark Gray for better readability */
  font-family: 'Poppins', sans-serif;
  padding-top: 80px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}

/* ===== NAVBAR & HEADER ===== */
header {
  background: #ffffff;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  height: 70px;
  display: flex;
  align-items: center;
}

.navbar-brand img {
  width: 100px;
}

nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  padding-right: 2rem;
}

nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2rem;
}

nav li {
  display: flex;
  align-items: center;
}

nav a {
  color: #333;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease-in-out;
  padding: 0.5rem 1rem;
  border-radius: 4px;
}

nav a:hover {
  color: #6B73FF;
  background-color: rgba(107, 115, 255, 0.1);
}

nav a.active {
  color: #6B73FF;
  background-color: rgba(107, 115, 255, 0.1);
}

/* For the Workflows dropdown specifically */
.workflow-menu {
  position: relative;
  display: inline-block;
}

.workflow-menu .dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 200px;
  padding: 0.5rem 0;
  display: none;
  z-index: 1000;
}

.workflow-menu:hover .dropdown-menu {
  display: block;
}

.workflow-menu .dropdown-item {
  display: block;
  padding: 0.5rem 1rem;
  color: #333;
  text-decoration: none;
  transition: all 0.3s ease;
}

.workflow-menu .dropdown-item:hover {
  background-color: rgba(107, 115, 255, 0.1);
  color: #6B73FF;
}

/* ===== CONTENT SPACER ===== */
.spacer {
  height: 30px;
}

/* ===== CARDS & PANELS ===== */
.card,
.mantine-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.card:hover,
.mantine-card:hover {
  transform: translateY(-3px);
}

/* ===== BUTTONS ===== */
.btn-cta {
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 1rem;
  text-transform: uppercase;
  font-weight: 600;
  transition: all 0.3s ease-in-out;
}

.btn-cta-primary {
  background: #6B73FF;
  /* Updated main color */
  color: white;
  border: none;
}

.btn-cta-primary:hover {
  background: #575FEB;
  /* Darker variant */
  transform: scale(1.05);
}

.btn-cta-outline {
  border: 2px solid #6B73FF;
  /* Updated */
  color: #6B73FF;
  background: transparent;
}

.btn-cta-outline:hover {
  background: #6B73FF;
  color: white;
}

/* ===== FORM INPUTS ===== */
input,
select,
textarea {
  background: white;
  color: #333;
  border: 1px solid #ccc;
  padding: 10px;
  border-radius: 5px;
  width: 75%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #6B73FF;
  /* Updated */
  box-shadow: 0 0 10px rgba(107, 115, 255, 0.5);
  /* Using rgb for #6B73FF */
}

/* ===== GRID SYSTEM ===== */
.mantine-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  justify-content: center;
}

@media (max-width: 768px) {
  .mantine-grid {
    grid-template-columns: 1fr;
  }

  .button-group {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}

/* ===== TICKET DETAILS PAGE - CROSS-BROWSER FIXES ===== */
/* Fix for buttons in Edge, Chrome, and other browsers */
.card-header .btn,
.card-header .btn-group {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* Make Edit Details and Update Status buttons consistent across browsers */
.btn-primary,
.btn-success,
.btn-secondary {
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  display: inline-block;
  font-weight: 500;
  text-align: center;
  vertical-align: middle;
  user-select: none;
  margin: 2px;
}

/* Fix status badge appearance */
.badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.85em;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
}

/* Cross-browser fixes for ticket details change log */
#changeLogTable {
  width: 100%;
  border-collapse: collapse;
}

#changeLogTable th,
#changeLogTable td {
  border: 1px solid #dee2e6;
  padding: 8px;
  text-align: left;
}

#changeLogTable thead th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
}

/* Make Select2 dropdowns work consistently across browsers */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  min-height: 38px;
  padding: 0.375rem 0.75rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  padding: 2px 6px;
  margin-right: 5px;
}

/* Fix Quill editor in Edge */
.ql-editor {
  min-height: 200px;
  background-color: #fff;
}

/* Fix card appearance in Edge */
.card-body {
  padding: 1.25rem;
  display: block;
}

/* Fix related emails and attachments section */
.list-group-item {
  position: relative;
  display: block;
  padding: 0.75rem 1.25rem;
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.125);
}

/* Fix comment submission */
.comments-list {
  max-height: 512px;
  overflow-y: auto;
  padding-right: 8px;
  margin-top: 16px;
  border-radius: 4px;
  width: 100%;
}

/* ===== CHEVRON BUTTON ===== */
.chevron-button {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #6B73FF;
  /* Updated */
  transition: transform 0.3s ease-in-out;
  display: flex;
  align-items: center;
  padding: 5px 10px;
  margin-left: auto;
}

.chevron-button:hover {
  color: #575FEB;
  /* Darker variant */
  transform: scale(1.1);
}

/* ===== SEARCH BOX ===== */
.search-box {
  position: relative;
  width: 250px;
  margin-left: auto;
  margin-right: 20px;
}

.search-box input {
  width: 100%;
  padding: 8px 35px 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.search-box input:focus {
  border-color: #6B73FF;
  box-shadow: 0 0 0 2px rgba(107, 115, 255, 0.1);
  outline: none;
}

.search-box::after {
  content: "\f002";
  /* Font Awesome magnifying glass icon */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6B73FF;
  pointer-events: none;
}

/* Make search box responsive */
@media (max-width: 768px) {
  .search-box {
    width: 100%;
    margin: 10px 0;
  }
}

/* ===== HERO SECTION ===== */
.hero-section {
  position: relative;
  padding: 100px 0;
  background: linear-gradient(to bottom, #ffffff, #f8f9fa);
  color: #222;
  text-align: center;
  overflow: hidden;
}

.hero-section::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 100px;
  background: url('/images/wave.svg') no-repeat bottom center;
  background-size: cover;
}

.hero-section h1 {
  font-size: 3.5rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 15px;
  animation: fadeInUp 1s ease-in-out;
}

.hero-section p {
  font-size: 1.2rem;
  font-weight: 400;
  color: #555;
  max-width: 700px;
  margin: 0 auto 20px;
  animation: fadeInUp 1.2s ease-in-out;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
}

.hero-buttons .mantine-button {
  display: inline-block;
  padding: 16px 32px;
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 12px;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease-in-out;
  letter-spacing: 0.5px;
}

.hero-buttons .mantine-button-primary {
  background: #6B73FF;
  /* Updated */
  color: white;
  border: 2px solid transparent;
}

.hero-buttons .mantine-button-primary:hover {
  background: #575FEB;
  /* Darker variant */
  transform: scale(1.1);
  box-shadow: 0px 6px 18px rgba(107, 115, 255, 0.3);
}

.hero-buttons .mantine-button-outline {
  border: 2px solid #6B73FF;
  /* Updated */
  color: #6B73FF;
  background: white;
}

.hero-buttons .mantine-button-outline:hover {
  background: #6B73FF;
  color: white;
  transform: scale(1.05);
  box-shadow: 0px 6px 14px rgba(107, 115, 255, 0.25);
}

/* ===== FEATURES & HOW IT WORKS SECTION ===== */
.features-section,
.how-it-works-section {
  padding: 80px 0;
  background: #ffffff;
  text-align: center;
}

.features-section .mantine-card,
.how-it-works-section .mantine-card {
  background: #ffffff;
  padding: 30px;
  border-radius: 12px;
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.features-section .mantine-card:hover,
.how-it-works-section .mantine-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

.mantine-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  color: #6B73FF;
  /* Updated */
  transition: transform 0.3s ease-in-out;
}

.mantine-card:hover .mantine-icon {
  transform: scale(1.1);
}

.mantine-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
}

/* ===== CTA SECTION ===== */
.cta-section {
  padding: 80px 0;
  background: #6B73FF;
  /* Updated */
  color: white;
  text-align: center;
  position: relative;
}

.cta-section h2 {
  font-size: 2.5rem;
  font-weight: 700;
}

.cta-section p {
  font-size: 1.2rem;
  font-weight: 400;
}

.cta-section .mantine-button {
  margin-top: 20px;
  padding: 16px 32px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(107, 115, 255, 0.2);
  transition: all 0.3s ease-in-out;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.cta-section .mantine-button-primary {
  background: #6B73FF;
  /* Updated */
  color: white;
  border: 2px solid transparent;
  transition: all 0.3s ease-in-out;
}

.cta-section .mantine-button-primary:hover {
  background: #575FEB;
  /* Darker variant */
  transform: scale(1.1);
  box-shadow: 0 6px 18px rgba(107, 115, 255, 0.3);
}

.cta-section .mantine-button-outline {
  border: 2px solid #6B73FF;
  /* Updated */
  color: #6B73FF;
  background: white;
  transition: all 0.3s ease-in-out;
}

.cta-section .mantine-button-outline:hover {
  background: #6B73FF;
  color: white;
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(107, 115, 255, 0.25);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== DROPDOWN STYLES ===== */
.mantine-dropdown {
  position: relative;
  display: inline-block;
}

/* Dropdown Button Style */
.mantine-button-secondary {
  background: #6B73FF;
  /* Updated */
  color: white;
  border: 2px solid transparent;
  transition: all 0.3s ease-in-out;
  padding: 10px 16px;
  font-weight: 600;
  border-radius: 8px;
}

.mantine-button-secondary:hover {
  background: #575FEB;
  /* Darker variant */
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(107, 115, 255, 0.2);
}

/* Dropdown Menu */
.mantine-dropdown .dropdown-menu {
  z-index: 1055 !important;
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 10px 0;
}

.mantine-dropdown .dropdown-menu.show {
  display: block;
}

/* Dropdown Items */
.dropdown-menu .dropdown-item {
  color: #333;
  padding: 10px 16px;
  transition: all 0.3s ease-in-out;
}

.dropdown-menu .dropdown-item:hover {
  background: #f8f9fa;
  color: #6B73FF;
  /* Updated */
}

/* For dropdowns inside card bodies */
.mantine-card-body .dropdown-menu {
  position: absolute;
  z-index: 1055 !important;
}

/* ===== PAGINATION ===== */
.pagination-container {
  text-align: center;
  margin-top: 20px;
}

.mantine-pagination {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.mantine-pagination .mantine-button {
  background: #6B73FF;
  /* Updated */
  color: white;
  border: none;
  padding: 8px 16px;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.mantine-pagination .mantine-button:hover:not(:disabled) {
  background: #575FEB;
  /* Darker variant */
}

.mantine-pagination .mantine-button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.mantine-pagination #pageInfo {
  font-size: 1rem;
  color: #333;
}

.hidden {
  display: none;
}

.button-group {
  display: flex;
  gap: 10px;
  /* Adds spacing between buttons */
  margin-bottom: 15px;
  /* Adds some spacing below */
}

.btn {
  padding: 10px 15px;
  font-size: 16px;
  white-space: nowrap;
}

#saveMappingsButton {
  position: relative;
  z-index: 10;
  background-color: #6B73FF;
  /* Example blue - adjust as needed */
  border-color: #6B73FF;
  /* Match border colour */
  color: #fff;
  /* White text for contrast */
}

/* Ensure hover and active states reflect the change */
#saveMappingsButton:hover,
#saveMappingsButton:focus {
  background-color: #5c64e0;
  /* Slightly darker blue than #6B73FF*/
  border-color: #5c64e0;
}

#saveInstructionButton {
  position: relative;
  z-index: 10;
  background-color: #6B73FF;
  /* Example blue - adjust as needed */
  border-color: #6B73FF;
  /* Match border colour */
  color: #fff;
  /* White text for contrast */
}

/* Ensure hover and active states reflect the change */
#saveInstructionButton:hover,
#saveInstructionButton:focus {
  background-color: #5c64e0;
  /* Slightly darker blue than #6B73FF*/
  border-color: #5c64e0;
}

.scrollable-long-text {
  max-width: 400px;
  /* Fixed column width */
  overflow-x: auto;
  /* Enable horizontal scrolling */
  white-space: nowrap;
  /* Prevent text wrapping */
  padding: 0.25rem;
  /* Optional padding */
  border: 1px solid #ddd;
  /* Optional visual separation */
}

.workflow-details .d-flex {
  flex-wrap: wrap;
  gap: 10px;
  /* Optional: adds spacing between buttons */
}

/* Tour styles */
.tour-overlay {
  position: fixed;
  z-index: 9998;
  transition: all 0.3s ease;
  box-sizing: border-box;
  pointer-events: none;
}

.tour-tooltip {
  position: fixed;
  z-index: 9999;
  width: 320px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.tour-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  background-color: #f8f9fa;
  border-radius: 6px 6px 0 0;
}

.tour-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.tour-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #666;
}

.tour-body {
  padding: 16px;
}

.tour-text {
  margin: 0;
  line-height: 1.5;
}

.tour-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid #eee;
}

.tour-progress {
  color: #666;
  font-size: 14px;
}

.tour-nav-buttons {
  display: flex;
  gap: 8px;
}

.tour-btn {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.tour-btn-skip {
  color: #666;
}

.tour-btn-prev {
  color: #666;
}

.tour-btn-next {
  background: #0d6efd;
  color: white;
  border-color: #0d6efd;
}

.tour-btn:hover:not(:disabled) {
  opacity: 0.9;
}

.tour-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Tenant selector and management dropdown styles */
header nav .dropdown {
  display: inline-block;
  margin-right: 10px;
}

header nav .dropdown .btn-outline-secondary,
header nav .dropdown .nav-link.dropdown-toggle {
  color: #333;
  border-color: #ced4da;
  background-color: white;
  font-size: 14px;
  padding: 6px 12px;
  text-decoration: none;
  border-radius: 4px;
}

header nav .dropdown .btn-outline-secondary:hover,
header nav .dropdown .btn-outline-secondary:focus,
header nav .dropdown .nav-link.dropdown-toggle:hover,
header nav .dropdown .nav-link.dropdown-toggle:focus {
  background-color: #f8f9fa;
  box-shadow: none;
  color: #6B73FF;
}

header nav .dropdown .dropdown-menu {
  font-size: 14px;
  min-width: 200px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  border: 1px solid #ced4da;
}

header nav .dropdown .dropdown-item {
  padding: 8px 16px;
}

header nav .dropdown .dropdown-item.active {
  background-color: #f8f9fa;
  color: #333;
  font-weight: 600;
}

header nav .dropdown .dropdown-item:hover {
  background-color: #f8f9fa;
  color: #6B73FF;
}

/* Requirements overlay for I/O Specs */
.requirements-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 5px;
}

.requirements-overlay .overlay-content {
  background-color: white;
  padding: 20px;
  border-radius: 5px;
  text-align: center;
  max-width: 80%;
}

.requirements-overlay .overlay-content i {
  color: #f39c12;
  font-size: 24px;
  margin-bottom: 10px;
}

.requirements-overlay .overlay-content p {
  margin-bottom: 15px;
}

/* Format selection container needs to be positioned for the overlay */
.format-selection {
  position: relative;
  min-height: 200px;
}

/* Chat Interface Styles */
.chat-interface {
  display: flex;
  flex-direction: column;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  background-color: #f9f9f9;
  padding: 10px;
  margin-top: 15px;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  background-color: white;
  border-radius: 5px;
  border: 1px solid #e0e0e0;
}

.chat-message {
  padding: 10px;
  border-radius: 8px;
  max-width: 85%;
}

.chat-message.user {
  align-self: flex-end;
  background-color: #007bff;
  color: white;
  margin-left: auto;
}

.chat-message.assistant {
  align-self: flex-start;
  background-color: #f1f1f1;
  color: #333;
  margin-right: auto;
}

.chat-message-content {
  word-break: break-word;
}

.chat-message-content pre {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 10px;
  border-radius: 5px;
  overflow-x: auto;
  font-size: 0.9em;
}

.chat-message.user .chat-message-content pre {
  background-color: rgba(255, 255, 255, 0.1);
}

.chat-input-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-indicator span {
  height: 8px;
  width: 8px;
  border-radius: 50%;
  background-color: #777;
  display: inline-block;
  animation: bounce 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {

  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

/* Additional styles for ModularWorkflowStudio chat interface */
.ai-chat-box {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  max-height: 400px;
  overflow-y: auto;
  padding: 15px;
  background-color: #f9f9f9;
  margin-bottom: 15px;
}

.user-message,
.ai-message {
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 8px;
  max-width: 85%;
}

.user-message {
  background-color: #007bff;
  color: white;
  margin-left: auto;
  text-align: right;
}

.ai-message {
  background-color: #f1f1f1;
  color: #333;
  margin-right: auto;
}

.user-message p,
.ai-message p {
  margin-bottom: 0;
  word-break: break-word;
}

.ai-message pre {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 10px;
  border-radius: 5px;
  overflow-x: auto;
  font-size: 0.9em;
  max-width: 100%;
}

.user-message pre {
  background-color: rgba(255, 255, 255, 0.1);
}