/* Header Buttons Style - Projects UI Minimalist Theme */
/* Override LibreChat default button styles to match Projects UI design */

/* CSS Variables for brand colors */
:root {
  --brand-dark: #16213f;
  --brand-medium: #25408f;
  --brand-light: #7dd2ef;
}

/* Greeting text color - "בוקר טוב", "לילה טוב" etc */
p.split-parent.text-text-primary,
p.split-parent.text-text-primary span {
  color: #25408f !important;
}

/* Remove borders from collapsed sidebar buttons (left panel) */
[data-collapsed="true"] button.inline-flex,
[data-collapsed="true"] button {
  border: none !important;
  background: transparent !important;
}

[data-collapsed="true"] button.inline-flex:hover,
[data-collapsed="true"] button:hover {
  border: none !important;
  background: rgba(37, 64, 143, 0.1) !important;
}

/* Send button - change background from black to blue */
#send-button,
button[data-testid="send-button"] {
  background-color: #25408f !important;
}

#send-button:hover:not(:disabled),
button[data-testid="send-button"]:hover:not(:disabled) {
  background-color: #16213f !important; /* Darker blue on hover */
}

#send-button:disabled,
button[data-testid="send-button"]:disabled {
  background-color: rgba(37, 64, 143, 0.5) !important; /* Medium blue when disabled - 50% opacity */
}

/* CheckboxButton - עיצוב נגטיבי כשמסומן (חיפוש ברשת, חיפוש בקבצים וכו') */
button[role="checkbox"][aria-checked="true"],
button[role="checkbox"][data-active="true"] {
  background: #25408f !important;
  background-color: #25408f !important;
  color: white !important;
  border-color: #25408f !important;
}

button[role="checkbox"][aria-checked="true"]:hover,
button[role="checkbox"][data-active="true"]:hover {
  background: #16213f !important;
  background-color: #16213f !important;
  color: white !important;
  border-color: #16213f !important;
}

/* אייקונים בכפתורים מסומנים */
button[role="checkbox"][aria-checked="true"] svg,
button[role="checkbox"][data-active="true"] svg {
  color: white !important;
  stroke: white !important;
}

/* טקסט בכפתורים מסומנים */
button[role="checkbox"][aria-checked="true"] span,
button[role="checkbox"][data-active="true"] span {
  color: white !important;
}

/* Target all header buttons with maximum specificity */
/* Use multiple class combinations to override Tailwind CSS */

/* Main button styles - LibreChat native buttons */
header button.cursor-pointer.inline-flex,
header button.inline-flex.size-10,
header button.inline-flex.flex-shrink-0,
header button.inline-flex.items-center,
header [role="button"].cursor-pointer.inline-flex,
header [role="button"].inline-flex.size-10,
/* Custom buttons */
.site-switcher .site-switcher__tab,
button.project-management-button,
button.cost-display-button,
button.maintenance-button {
  background: transparent !important;
  background-color: transparent !important;
  color: #25408f !important;
  border: 1.5px solid #25408f !important;
  border-color: #25408f !important;
  border-radius: 0.5rem !important;
  padding: 0.625rem !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.25s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  white-space: nowrap !important;
  box-shadow: none !important;
  min-height: 40px !important;
  min-width: 40px !important;
}

/* Hover state - fill with brand color */
header button.cursor-pointer.inline-flex:hover:not(:disabled),
header button.inline-flex.size-10:hover:not(:disabled),
header button.inline-flex.flex-shrink-0:hover:not(:disabled),
header button.inline-flex.items-center:hover:not(:disabled),
header [role="button"].cursor-pointer.inline-flex:hover:not(:disabled),
header [role="button"].inline-flex.size-10:hover:not(:disabled),
.site-switcher .site-switcher__tab:hover,
button.project-management-button:hover,
button.cost-display-button:hover,
button.maintenance-button:hover {
  background: #25408f !important;
  background-color: #25408f !important;
  color: white !important;
  border-color: #25408f !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(37, 64, 143, 0.2) !important;
}

/* Active/pressed state */
header button.cursor-pointer.inline-flex:active:not(:disabled),
header button.inline-flex.size-10:active:not(:disabled),
header button.inline-flex.flex-shrink-0:active:not(:disabled),
header button.inline-flex.items-center:active:not(:disabled),
header [role="button"].cursor-pointer.inline-flex:active:not(:disabled),
header [role="button"].inline-flex.size-10:active:not(:disabled),
.site-switcher .site-switcher__tab:active,
button.project-management-button:active,
button.cost-display-button:active,
button.maintenance-button:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 6px rgba(37, 64, 143, 0.15) !important;
}

/* Disabled state */
header button.cursor-pointer.inline-flex:disabled,
header button.inline-flex:disabled,
header [role="button"].inline-flex:disabled {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* Icon colors inside buttons */
header button.inline-flex svg,
header [role="button"].inline-flex svg,
.site-switcher__tab svg,
.project-management-button svg,
.cost-display-button svg,
.maintenance-button svg {
  color: inherit !important;
  stroke: currentColor !important;
}

/* Override specific Tailwind classes that LibreChat uses */
header button.border-border-light {
  border-color: #25408f !important;
}

header button.bg-transparent.border-border-light {
  background: transparent !important;
  border-color: #25408f !important;
}

header button.text-text-primary.inline-flex {
  color: #25408f !important;
}

header button.shadow-sm.inline-flex {
  box-shadow: none !important;
}

header button.rounded-xl.inline-flex {
  border-radius: 0.5rem !important;
}

/* Hover overrides for specific Tailwind classes */
header button.hover\:bg-surface-hover:hover,
header button.hover\:bg-surface-tertiary:hover {
  background: #25408f !important;
  color: white !important;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  header button.cursor-pointer.inline-flex,
  header button.inline-flex.size-10,
  header [role="button"].inline-flex,
  .site-switcher .site-switcher__tab,
  button.project-management-button,
  button.cost-display-button,
  button.maintenance-button {
    background: transparent !important;
    color: #7dd2ef !important;
    border-color: #7dd2ef !important;
  }
  
  header button.cursor-pointer.inline-flex:hover:not(:disabled),
  header button.inline-flex:hover:not(:disabled),
  header [role="button"].inline-flex:hover:not(:disabled),
  .site-switcher .site-switcher__tab:hover,
  button.project-management-button:hover,
  button.cost-display-button:hover,
  button.maintenance-button:hover {
    background: #7dd2ef !important;
    color: #16213f !important;
    border-color: #7dd2ef !important;
    box-shadow: 0 4px 12px rgba(125, 210, 239, 0.3) !important;
  }
  
  /* CheckboxButton checked state in dark mode */
  button[role="checkbox"][aria-checked="true"],
  button[role="checkbox"][data-active="true"] {
    background: #7dd2ef !important;
    background-color: #7dd2ef !important;
    color: #16213f !important;
    border-color: #7dd2ef !important;
  }
  
  button[role="checkbox"][aria-checked="true"]:hover,
  button[role="checkbox"][data-active="true"]:hover {
    background: #a8e6f7 !important;
    background-color: #a8e6f7 !important;
    color: #16213f !important;
    border-color: #a8e6f7 !important;
  }
  
  button[role="checkbox"][aria-checked="true"] svg,
  button[role="checkbox"][data-active="true"] svg {
    color: #16213f !important;
    stroke: #16213f !important;
  }
  
  button[role="checkbox"][aria-checked="true"] span,
  button[role="checkbox"][data-active="true"] span {
    color: #16213f !important;
  }
}

/* Dark mode using data-theme attribute (LibreChat style) */
html[data-theme="dark"] header button.inline-flex,
html[data-theme="dark"] header [role="button"].inline-flex,
html[data-theme="dark"] .site-switcher__tab,
html[data-theme="dark"] .project-management-button,
html[data-theme="dark"] .cost-display-button,
html[data-theme="dark"] .maintenance-button {
  background: transparent !important;
  color: #7dd2ef !important;
  border-color: #7dd2ef !important;
}

html[data-theme="dark"] header button.inline-flex:hover:not(:disabled),
html[data-theme="dark"] header [role="button"].inline-flex:hover:not(:disabled),
html[data-theme="dark"] .site-switcher__tab:hover,
html[data-theme="dark"] .project-management-button:hover,
html[data-theme="dark"] .cost-display-button:hover,
html[data-theme="dark"] .maintenance-button:hover {
  background: #7dd2ef !important;
  color: #16213f !important;
  border-color: #7dd2ef !important;
  box-shadow: 0 4px 12px rgba(125, 210, 239, 0.3) !important;
}

/* CheckboxButton checked state in dark mode with data-theme */
html[data-theme="dark"] button[role="checkbox"][aria-checked="true"],
html[data-theme="dark"] button[role="checkbox"][data-active="true"] {
  background: #7dd2ef !important;
  background-color: #7dd2ef !important;
  color: #16213f !important;
  border-color: #7dd2ef !important;
}

html[data-theme="dark"] button[role="checkbox"][aria-checked="true"]:hover,
html[data-theme="dark"] button[role="checkbox"][data-active="true"]:hover {
  background: #a8e6f7 !important;
  background-color: #a8e6f7 !important;
  color: #16213f !important;
  border-color: #a8e6f7 !important;
}

html[data-theme="dark"] button[role="checkbox"][aria-checked="true"] svg,
html[data-theme="dark"] button[role="checkbox"][data-active="true"] svg {
  color: #16213f !important;
  stroke: #16213f !important;
}

html[data-theme="dark"] button[role="checkbox"][aria-checked="true"] span,
html[data-theme="dark"] button[role="checkbox"][data-active="true"] span {
  color: #16213f !important;
}

/* Mobile responsiveness */
@media (max-width: 640px) {
  header button.inline-flex,
  header [role="button"].inline-flex,
  .site-switcher__tab,
  .project-management-button,
  .cost-display-button,
  .maintenance-button {
    padding: 0.5rem !important;
    font-size: 0.8rem !important;
    min-height: 36px !important;
    min-width: 36px !important;
  }
}

/* RTL support */
html[data-rtl="true"] header button,
html[dir="rtl"] header button {
  direction: rtl !important;
}

/* Exclude dropdown menu items and nested buttons */
[role="menu"] button,
[role="menuitem"],
button[aria-haspopup="menu"] + * button {
  background: revert !important;
  color: revert !important;
  border: revert !important;
  border-radius: revert !important;
  padding: revert !important;
  box-shadow: revert !important;
  transform: none !important;
}
