/* ============================================
   FIX NOTIFICATION HEADER BUTTONS - Fix all issues
   Issues found:
   1. Excessive z-index (99999)
   2. Negative margin causing overlap (-1.125px space)
   3. Inconsistent padding between buttons
   4. Border bottom missing (0px)
   5. Overlapping elements
   ============================================ */

/* Remove excessive z-index from buttons - MAXIMUM SPECIFICITY */
#notification-panel #notif-note-btn,
#notification-panel #notif-history-link,
#notification-panel .border-bottom #notif-note-btn,
#notification-panel .border-bottom #notif-history-link,
#notification-panel .d-flex #notif-note-btn,
#notification-panel .d-flex #notif-history-link,
#notification-panel .border-bottom.d-flex #notif-note-btn,
#notification-panel .border-bottom.d-flex #notif-history-link {
  z-index: auto !important;
  position: static !important;
}

/* Override any inline styles - use attribute selector with !important */
#notification-panel #notif-note-btn[style],
#notification-panel #notif-history-link[style] {
  z-index: auto !important;
  position: static !important;
}

/* Fix negative margin causing overlap - remove it */
#notification-panel .border-bottom > div:last-child.d-flex {
  margin-left: 0 !important; /* Remove negative margin */
  margin-right: 0 !important;
}

/* Ensure proper spacing between Statuses and Buttons */
#notification-panel .border-bottom {
  gap: 8px !important; /* Proper gap instead of negative margin */
}

/* Make button padding consistent - both buttons same padding */
#notification-panel #notif-note-btn,
#notification-panel #notif-history-link {
  padding: 8px 20px !important; /* Consistent padding for both buttons */
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
}

/* Remove inconsistent padding adjustments */
#notification-panel #notif-history-link {
  padding-top: 8px !important; /* Remove 8.5px */
  padding-bottom: 8px !important; /* Remove 7.5px */
  text-indent: 0 !important; /* Remove text-indent adjustment */
}

/* Fix border - ensure all sides have consistent border, especially bottom */
#notification-panel #notif-note-btn,
#notification-panel #notif-history-link {
  border: 1px solid #c9d2e3 !important; /* Consistent border all around */
  border-top: 1px solid #c9d2e3 !important;
  border-right: 1px solid #c9d2e3 !important;
  border-bottom: 1px solid #c9d2e3 !important; /* CRITICAL: Ensure bottom border is visible */
  border-left: 1px solid #c9d2e3 !important;
  border-width: 1px !important; /* Ensure all borders have width */
  border-style: solid !important; /* Ensure borders are solid */
  border-color: #c9d2e3 !important; /* Ensure border color is set */
  box-shadow: none !important; /* Remove any shadows that might hide border */
  outline: none !important; /* Remove outline that might interfere */
}

/* Force bottom border to be visible - override any rules that might remove it */
#notification-panel #notif-note-btn,
#notification-panel #notif-history-link,
#notification-panel .border-bottom #notif-note-btn,
#notification-panel .border-bottom #notif-history-link,
#notification-panel .d-flex #notif-note-btn,
#notification-panel .d-flex #notif-history-link {
  border-bottom-width: 1px !important;
  border-bottom-style: solid !important;
  border-bottom-color: #c9d2e3 !important;
  border-bottom: 1px solid #c9d2e3 !important; /* Explicit bottom border */
}

/* Ensure no rules are removing the bottom border */
#notification-panel #notif-note-btn[style],
#notification-panel #notif-history-link[style] {
  border-bottom: 1px solid #c9d2e3 !important;
}

/* Ensure buttons have same height */
#notification-panel #notif-note-btn,
#notification-panel #notif-history-link {
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Remove any inline styles that might interfere */
#notification-panel #notif-note-btn[style*="z-index"],
#notification-panel #notif-history-link[style*="z-index"],
#notification-panel #notif-note-btn[style*="position"],
#notification-panel #notif-history-link[style*="position"] {
  z-index: auto !important;
  position: static !important;
}

/* Ensure buttons container doesn't overlap */
#notification-panel .border-bottom > div:last-child.d-flex {
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  min-width: fit-content !important;
}

/* ============================================
   FIX HOVER EFFECT - Remove light blue, use subtle gray
   ============================================ */

/* Fix hover effect - use subtle gray instead of light blue */
#notification-panel #notif-note-btn:hover,
#notification-panel #notif-note-btn:focus,
#notification-panel #notif-history-link:hover,
#notification-panel #notif-history-link:focus,
#notification-panel .border-bottom #notif-note-btn:hover,
#notification-panel .border-bottom #notif-note-btn:focus,
#notification-panel .border-bottom #notif-history-link:hover,
#notification-panel .border-bottom #notif-history-link:focus {
  background: #f3f4f6 !important; /* Subtle gray instead of light blue */
  border-color: #d1d5db !important; /* Darker gray border */
  color: #202938 !important;
  transform: scale(1.02) !important; /* Subtle scale instead of 1.05 */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important; /* Subtle shadow */
  text-decoration: none !important;
}

/* Remove any light blue hover effects */
#notification-panel #notif-note-btn:hover,
#notification-panel #notif-history-link:hover {
  background-color: #f3f4f6 !important; /* Override any #e5ebf7 (light blue) */
}

/* ============================================
   FIX TEXT CENTERING - Ensure History button text is perfectly centered
   ============================================ */

/* Perfect text centering for both buttons using flexbox */
#notification-panel #notif-note-btn,
#notification-panel #notif-history-link {
  display: inline-flex !important;
  align-items: center !important; /* Vertical centering */
  justify-content: center !important; /* Horizontal centering */
  text-align: center !important;
  vertical-align: middle !important;
  line-height: 1 !important;
  padding: 8px 20px !important; /* Consistent padding */
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  box-sizing: border-box !important;
}

/* Ensure text inside buttons is centered - remove any offsets */
#notification-panel #notif-note-btn,
#notification-panel #notif-history-link {
  text-indent: 0 !important;
  letter-spacing: normal !important;
  margin: 0 !important;
}

/* ============================================
   AGGRESSIVE FIX FOR HISTORY BUTTON TEXT CENTERING
   History is an <a> tag, not <button>, so needs extra specificity
   ============================================ */

/* Maximum specificity for History button - override everything */
#notification-panel #notif-history-link,
#notification-panel .border-bottom #notif-history-link,
#notification-panel .d-flex #notif-history-link,
#notification-panel .border-bottom.d-flex #notif-history-link,
#notification-panel .border-bottom > div:last-child #notif-history-link,
#notification-panel .border-bottom > div:last-child.d-flex #notif-history-link,
a#notif-history-link.btn.btn-light.btn-sm {
  display: inline-flex !important;
  align-items: center !important; /* CRITICAL: Vertical centering */
  justify-content: center !important; /* CRITICAL: Horizontal centering */
  text-align: center !important;
  line-height: 1 !important;
  padding: 8px 20px !important; /* Consistent padding - flexbox will center text */
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  text-indent: 0 !important;
  letter-spacing: normal !important;
  text-decoration: none !important;
}

/* Force the text content to be centered - target the text node */
#notification-panel #notif-history-link {
  text-rendering: optimizeLegibility !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  font-kerning: normal !important;
}

/* Remove any pseudo-elements that might offset text */
#notification-panel #notif-history-link::before,
#notification-panel #notif-history-link::after {
  content: none !important;
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Ensure flexbox centering works - override any conflicting display */
#notification-panel #notif-history-link.btn,
#notification-panel #notif-history-link.btn-light,
#notification-panel #notif-history-link.btn-sm {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Override any link-specific styles that might affect centering */
#notification-panel #notif-history-link[href],
a#notif-history-link,
a#notif-history-link.btn,
a#notif-history-link.btn-light,
a#notif-history-link.btn-sm {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  vertical-align: middle !important;
}

/* NUCLEAR OPTION: Force text centering by wrapping text in a span if needed */
#notification-panel #notif-history-link {
  position: relative !important;
}

/* Ensure the actual text content is centered - target all possible text nodes */
#notification-panel #notif-history-link * {
  display: inline !important;
  vertical-align: middle !important;
}

/* Force the button to use flexbox and center everything */
#notification-panel .border-bottom > div:last-child #notif-history-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
}
