:root {
  /* Primary colors - modern teal palette */
  --primary-color: #008080;
  --primary-color-rgb: 0, 128, 128;
  --primary-hover: #006666;
  --primary-hover-rgb: 0, 102, 102;
  --primary-light: #00a3a3;
  --primary-light-rgb: 0, 163, 163;

  /* Utility colors - teal variants */
  --secondary-color: #4db8b8;
  --success-color: #2d8c7a;
  --danger-color: #e57373;
  --warning-color: #ffb74d;
  --info-color: #4dd0e1;
  --accent-color: #26a69a;

  /* Neutral palette with cool undertones */
  --light-color: #f5faf9;
  --dark-color: #1a3c3b;
  --gray-100: #e0f2f1;
  --gray-200: #b2dfdb;
  --gray-300: #80cbc4;
  --gray-400: #4db6ac;

  /* Background & text */
  --bg-light: #ffffff;
  --bg-dark: #0d2b2a;
  --text-light: #e0f2f1;
  --text-dark: #1a3c3b;
  --text-muted: #4db8b8;
  --border-color: #b2dfdb;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 77, 77, 0.08);
  --shadow-md: 0 4px 6px rgba(0, 77, 77, 0.12);
  --shadow-lg: 0 10px 15px rgba(0, 77, 77, 0.16);
  --shadow-teal: 0 4px 14px rgba(0, 128, 128, 0.2);

  /* Accent colors */
  --accent-primary: #008080;
  --accent-secondary: #26a69a;
  --accent-tertiary: #4db8b8;
  --accent-light: #80cbc4;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--accent-secondary));
  --gradient-teal: linear-gradient(135deg, #008080, #26a69a);
  --gradient-dark: linear-gradient(135deg, var(--dark-color), #1a3c3b);
  --gradient-light: linear-gradient(135deg, var(--gray-100), #ffffff);
  --gradient-ocean: linear-gradient(135deg, #008080, #4dd0e1);
  
  /* Additional accents */
  --highlight-color: #e0f2f1;
  --focus-ring: 0 0 0 3px rgba(0, 128, 128, 0.3);
  --glass-teal: rgba(128, 203, 196, 0.15);
}

/* ========== Base Styles ========== */
body {
  background: var(--light-color);
  padding-top: 70px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
}

/* ========== Typography ========== */
h1 {
  color: var(--primary-color);
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.custom-heading {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  margin-top: 1.6rem;
}

/* ========== Navigation ========== */
.navbar {
  background: var(--gradient-primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 0.75rem;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-light) !important;
  letter-spacing: 0.5px;
  padding: 0.25rem 0;
}

.navbar-brand img {
  margin-right: 8px;
  transition: transform 0.3s ease;
}

.navbar-brand:hover img {
  transform: scale(1.05);
}

.orbitron-logo {
  font-family: 'Orbitron', Gadget, sans-serif;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: white;
  text-transform: uppercase;
}

.nav-link {
  color: #cccccc !important;
  font-weight: 500;
  text-decoration: none !important;
}

.nav-link:hover,
.nav-link:focus {
  color: #e0e7ff !important;
}

.nav-link.active,
.nav-link.active:hover {
  color: #ffffff !important;
  font-weight: 600;
}

/* ========== Buttons ========== */
.btn-primary {
  background: var(--primary-color);
  border-color: var(--primary-color);
  font-weight: 600;
}

.btn-primary:hover {
  background: #46a7c2;
  border-color: #46a7c2;
}

/* ========== Cards & Sections ========== */
.card,
.building-info-card {
  margin-bottom: 25px;
  border: 0;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  background: var(--primary-color);
  color: var(--text-light);
  font-weight: 600;
  border-radius: 10px 10px 0 0 !important;
}

.report-section {
  border-left: 4px solid var(--primary-color);
  padding-left: 15px;
  margin-bottom: 25px;
}

.report-section h4 {
  color: var(--dark-color);
}

.tool-card {
  transition: 0.3s ease;
  cursor: pointer;
  height: 100%;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.tool-card .card-body {
  display: flex;
  flex-direction: column;
}

.tool-card .icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.tool-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* Card Border Variants */
.card.border-secondary {
  border-color: #dee2e6 !important;
}

.card.border-secondary .card-header {
  border-bottom-color: #dee2e6;
}

.card.border-secondary .file-upload-label {
  border: 2px dashed #dee2e6;
}

.card.border-secondary .file-upload-label:hover {
  border-color: #adb5bd;
  background: rgba(108, 117, 125, 0.05);
}

.card.border-primary .file-upload-label {
  border: 2px dashed var(--primary-color);
}

.card.border-primary .file-upload-label:hover {
  border-color: #46a7c2;
  background: rgba(13, 110, 253, 0.05);
}

/* ========== Compliance Items ========== */
.compliance-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  animation: fadeIn 0.3s ease-out forwards;
}

.compliance-icon {
  margin-right: 10px;
  font-size: 1.2rem;
}

.compliance-check {
  color: var(--success-color);
}

.compliance-warning {
  color: var(--warning-color);
}

.compliance-error {
  color: var(--danger-color);
}

.action-item {
  padding: 10px;
  background: #fff8e1;
  border-radius: 5px;
  margin-bottom: 8px;
}

/* ========== Output & Status ========== */
#output {
  white-space: pre-wrap;
  background: #fff;
  padding: 20px;
  border: 1px solid #ced4da;
  border-radius: 5px;
  max-height: 500px;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.7;
}

.pass {
  color: var(--success-color);
  font-weight: bold;
}

.fail {
  color: var(--danger-color);
  font-weight: bold;
}

#loadingStatus {
  min-height: 24px;
  font-size: 0.9rem;
}

.nbc-load-indicator {
  display: inline-block;
  margin-left: 8px;
}

.nbc-loaded {
  color: var(--success-color);
}

.nbc-not-loaded {
  color: var(--secondary-color);
}

.required-field::after {
  content: " *";
  color: var(--danger-color);
}

/* ========== File Upload ========== */
.file-upload-container {
  position: relative;
  margin-bottom: 1rem;
}

.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border: 2px dashed #ced4da;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: 0.3s;
}

.file-upload-label:hover {
  border-color: var(--primary-color);
  background: rgba(13, 110, 253, 0.05);
}

.file-upload-label i {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.file-upload-label h5 {
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.file-upload-input {
  display: none;
}

.file-name {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--secondary-color);
}

.progress-container {
  display: none;
  margin-bottom: 1rem;
}

/* ========== Input Highlighting ========== */
#customOccupancyClassification {
  transition: 0.3s;
}

#customOccupancyClassification:not(.d-none) {
  background: #f8f9fa;
  border-left: 3px solid var(--primary-color);
  padding-left: 10px;
}

.fixture-highlight {
  border-left: 4px solid var(--primary-color);
  padding-left: 10px;
  margin-bottom: 15px;
  background: rgba(13, 110, 253, 0.05);
}

.is-invalid {
  border-color: var(--danger-color) !important;
}

.is-invalid:focus {
  box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* ========== Badges ========== */
.bg-success-light {
  background-color: rgba(16, 185, 129, 0.1);
  border-left: 4px solid var(--success-color);
}

.bg-warning-light {
  background-color: rgba(245, 158, 11, 0.1);
  border-left: 4px solid var(--warning-color);
}

.bg-danger-light {
  background-color: rgba(239, 68, 68, 0.1);
  border-left: 4px solid var(--danger-color);
}

/* ========== Tooltips ========== */
.tooltip-inner {
  max-width: 300px;
  padding: 0.5rem 1rem;
  background-color: var(--dark-color);
}

.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before,
.bs-tooltip-top .tooltip-arrow::before {
  border-top-color: var(--dark-color);
}

/* ========== Chatbot ========== */
.chatbot-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: rgba(var(--primary-color-rgb), 0.7);
  color: var(--text-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  transition: 0.3s ease;
}

.chatbot-btn:hover {
  transform: scale(1.1);
  background: rgba(var(--primary-hover-rgb), 0.8);
}

.chatbot-btn svg {
  width: 28px;
  height: 28px;
}

.chatbot-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 350px;
  max-width: 90%;
  height: 500px;
  background: #fff;
  border-radius: 15px;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  z-index: 1001;
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  transition: 0.3s ease;
}

.chatbot-container.active {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}

.chatbot-header {
  padding: 15px;
  background: var(--primary-color);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.header-subtext {
  margin: 0;
  font-size: 0.7rem;
  opacity: 0.8;
}

.chatbot-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
}

.chatbot-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  background: #f8f9fa;
}

.chatbot-message {
  margin-bottom: 15px;
  max-width: 80%;
  padding: 10px 15px;
  border-radius: 15px;
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
}

.chatbot-question {
  background: var(--primary-color);
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 5px;
}

.chatbot-response {
  background: #fff;
  color: var(--dark-color);
  margin-right: auto;
  border-bottom-left-radius: 5px;
  box-shadow: var(--shadow-sm);
}

.chatbot-input {
  display: flex;
  padding: 10px;
  border-top: 1px solid #eee;
  background: #fff;
}

#chatbotInput {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 10px 15px;
  resize: none;
  outline: none;
  font-size: 0.9rem;
  max-height: 100px;
  overflow-y: auto;
}

#chatbotSend {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 1.2rem;
  margin-left: 10px;
  cursor: pointer;
}

/* Chat messages */
#chat-messages {
  min-height: 300px;
  max-height: 500px;
  overflow-y: auto;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 15px;
}

/* ========== Typing Indicators ========== */
.typing-indicator {
  display: inline-flex;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin: 0 2px;
  background: var(--secondary-color);
  opacity: 0.4;
  animation: typing-animation 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

.typing {
  display: inline-block;
}

.typing-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #888;
  margin: 0 2px;
  opacity: 0;
  animation: typingAnimation 1.4s infinite ease-in-out;
}

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

/* ========== Install Prompt ========== */
.install-prompt {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  padding: 15px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 1050;
  display: none;
  max-width: 90%;
  text-align: center;
}

.install-prompt p {
  margin-bottom: 10px;
  font-weight: 500;
}

.install-prompt button {
  margin: 0 5px;
}

/* ========== Animations ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typing-animation {
  0%, 60%, 100% {
    opacity: 0.4;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-5px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes typingAnimation {
  0% { opacity: 0.2; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
  100% { opacity: 0.2; transform: translateY(0); }
}

.section-animate {
  animation: fadeInUp 0.5s ease-out forwards;
}

/* ========== Scrollbars ========== */
.chatbot-messages::-webkit-scrollbar {
  width: 8px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
}

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

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

/* ========== Responsive Styles ========== */
@media (max-width: 768px) {
  body {
    padding-top: 60px;
  }
  
  .navbar-brand {
    font-size: 1.2rem;
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  .chatbot-container {
    width: 90%;
    height: 70vh;
    right: 5%;
    bottom: 20px;
  }
  
  .chatbot-btn {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .chatbot-message {
    max-width: 90%;
  }
}

@media (max-width: 576px) {
  .chatbot-container {
    width: 95%;
    right: 2.5%;
  }
}

#inlineSearchResults {
  max-height: 300px;
  overflow-y: auto;
  position: absolute;
  top: 100%;
  right: 0;
  background-color: rgba(255, 255, 255, 0.9); /* semi-transparent white */
  font-size: 0.85rem;
  text-align: right;
  padding: 5px 10px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  width: 100%; /* Full width by default */
  z-index: 1000;
}

@media (min-width: 768px) {
  #inlineSearchResults {
    width: 30%;
  }
}
