/* Custom CSS overrides for Duck UI */

/* Force light mode permanently */
:root {
  color-scheme: light !important;
}

* {
  color-scheme: light !important;
}

/* Override any dark mode styles */
body,
html,
#root {
  background-color: white !important;
  color: black !important;
}

/* Hide the original Duck UI header, but not our custom one */
#root > header,
#root > div > header {
  display: none !important;
}

/* Hide the main TopBar navigation (h-14), but keep the breadcrumb banner (h-10) visible */
[class*="flex"][class*="items-center"][class*="justify-between"][class*="h-14"][class*="border-b"]:not([class*="h-10"]) {
  display: none !important;
}

/* Custom header styles */
.custom-duck-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 20px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
}

.custom-duck-header .logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.custom-duck-header .breadcrumb {
  font-size: 14px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-duck-header .breadcrumb a {
  color: #6230f7;
  text-decoration: none;
  transition: color 0.2s ease;
}

.custom-duck-header .breadcrumb a:hover {
  color: #4f1fd4;
  text-decoration: underline;
}

.custom-duck-header .breadcrumb .separator {
  color: #9ca3af;
}

.custom-duck-header .breadcrumb .current {
  color: #374151;
  font-weight: 500;
}

/* Adjust the main content area */
main {
  min-height: calc(100vh - 65px);
  height: auto;
}

/* Allow breadcrumb navigation to show by not hiding nav elements with aria-label="breadcrumb" */
nav[class*="fixed"]:not([aria-label="breadcrumb"]),
nav[class*="sticky"]:not([aria-label="breadcrumb"]) {
  display: none !important;
}

/* Adjust root to account for custom header */
#root {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Hide ATTACH DATABASE queries from recent queries */
[class*="query"] [class*="text"]:has(span:first-child) {
  display: none;
}

/* Alternative: hide any query containing ATTACH */
[title*="ATTACH"],
[title*="attach"] {
  display: none !important;
}

/* Fix scrolling issue - constrain the table container and all flex parents */
.flex-1.rounded-md.bg-card.relative.overflow-hidden.border.border-border {
  min-height: 0 !important;
  height: 0 !important;
  flex: 1 1 0 !important;
}

.overflow-auto.h-full.w-full {
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
}
