/* main.css - Core styling for the Data-Driven Decision Support Tool */

:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --info-color: #0dcaf0;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --body-bg: #f5f7f9;
  --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--body-bg);
  color: var(--dark-color);
  line-height: 1.6;
}

.container {
  max-width: 1140px;
  padding: 0 15px;
}

/* Header styling */
header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

header h1 {
  font-weight: 600;
  color: var(--primary-color);
}

/* Card styling */
.card {
  border: none;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
  background-color: white;
}

.card-header {
  background-color: white;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

/* Section styling */
.section-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--dark-color);
  border-bottom: 2px solid var(--primary-color);
  display: inline-block;
  padding-bottom: 5px;
}

/* Alert styling */
#alert-container {
  position: relative;
  z-index: 1000;
}

.alert {
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Button styling */
.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

/* Footer styling */
footer {
  font-size: 0.9rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--secondary-color);
}

/* Utilities */
.text-muted {
  color: var(--secondary-color) !important;
}

.bg-light-subtle {
  background-color: rgba(248, 249, 250, 0.5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container {
    padding: 0 10px;
  }

  .card {
    margin-bottom: 15px;
  }
}

/* Query tooltips styling */
.query-tooltip {
  position: relative;
  display: inline-block;
  margin-left: 8px;
  cursor: pointer;
}

.query-tooltip .tooltip-icon {
  color: #6c757d;
  font-size: 1rem;
}

.query-tooltip .tooltip-content {
  visibility: hidden;
  width: 500px;
  max-width: 90vw;
  background-color: #f8f9fa;
  color: #212529;
  text-align: left;
  border-radius: 6px;
  padding: 15px;
  position: absolute;
  z-index: 1000;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transition: opacity 0.3s;
  border: 1px solid #dee2e6;
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
}

.query-tooltip:hover .tooltip-content {
  visibility: visible;
  opacity: 1;
}

/* Add a small arrow below the tooltip */
.query-tooltip .tooltip-content::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #f8f9fa transparent transparent transparent;
}

/* Style for the code inside the tooltip */
.query-tooltip pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.9rem;
}

/* Make tooltip right-aligned if close to the right edge */
.query-tooltip.tooltip-right .tooltip-content {
  left: auto;
  right: 0;
  transform: none;
}

.query-tooltip.tooltip-right .tooltip-content::after {
  left: auto;
  right: 10px;
}