/* ========================================
   DASHBOARD RESET & NEW LAYOUT
   This file overrides all existing styles
   ======================================== */

/* Dashboard body styling */
body {
    background: #ffffff !important;
}

/* Company Profile Display Fix - ONLY affects company profile modals */
#linkhubuk-view-profile .linkhubuk-modal,
.linkhubuk-modal[data-module="view-profile"] {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0,0,0,0.5) !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

#linkhubuk-view-profile .linkhubuk-modal-content,
.linkhubuk-modal[data-module="view-profile"] .linkhubuk-modal-content {
    background: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3) !important;
    max-width: 90vw !important;
    width: 900px !important;
    max-height: 98vh !important;
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    position: relative !important;
    padding: 30px !important;
    margin: 20px !important;
}

/* Ensure profile content is fully visible - ONLY for company profile modals */
#linkhubuk-view-profile .linkhubuk-profile-content,
.linkhubuk-modal[data-module="view-profile"] .linkhubuk-profile-content {
    min-height: 400px !important;
    padding-bottom: 100px !important;
}

/* Ensure gallery section has proper spacing */
#linkhubuk-view-profile .linkhubuk-profile-content > div:last-child,
.linkhubuk-modal[data-module="view-profile"] .linkhubuk-profile-content > div:last-child {
    margin-bottom: 40px !important;
    padding-bottom: 20px !important;
}

/* Ensure gallery images are fully visible with proper spacing */
#linkhubuk-view-profile .linkhubuk-profile-content div[style*="display:grid"][style*="grid-template-columns"],
.linkhubuk-modal[data-module="view-profile"] .linkhubuk-profile-content div[style*="display:grid"][style*="grid-template-columns"] {
    margin-bottom: 40px !important;
    padding-bottom: 20px !important;
}

/* Ensure the profile modal content container has proper height */
#linkhubuk-profile-content {
    min-height: calc(100vh - 200px) !important;
    padding-bottom: 80px !important;
}

/* Override social media links in referral section to use gold background */
#linkhubuk-share-link a[href*="linkedin"],
#linkhubuk-share-link a[href*="facebook"],
#linkhubuk-share-link a[href*="instagram"],
#linkhubuk-share-link a[href*="twitter"],
#linkhubuk-share-link a[href*="tiktok"] {
    background: #c5a658 !important;
    color: #111 !important;
}

/* Ensure close/back buttons are always visible - ONLY for company profile modals */
#linkhubuk-view-profile .linkhubuk-profile-close,
#linkhubuk-view-profile .linkhubuk-modal-close,
.linkhubuk-modal[data-module="view-profile"] .linkhubuk-profile-close,
.linkhubuk-modal[data-module="view-profile"] .linkhubuk-modal-close {
    position: sticky !important;
    bottom: 20px !important;
    z-index: 1000 !important;
    background: #c5a85b !important;
    color: #111 !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 12px 24px !important;
    font-size: 1em !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin-top: 20px !important;
    display: block !important;
    width: 100% !important;
}

/* Reset only specific properties, not everything */
.linkhubuk-dashboard-wrapper,
.linkhubuk-dashboard-aside,
.linkhubuk-dashboard-main,
.linkhubuk-dashboard-rightbar {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Override any parent container constraints - MORE AGGRESSIVE */
body,
html,
#content,
.entry-content,
.post-content,
.page-content,
.container,
.wrapper,
.main-content,
#main,
#primary,
.site-content,
.content-area,
.page,
.post,
article,
div[class*="container"],
div[class*="wrapper"],
div[class*="content"] {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: visible !important;
}

/* Force the dashboard to break out of containers */
.linkhubuk-dashboard-wrapper,
body .linkhubuk-dashboard-wrapper,
.linkhubuk-dashboard .linkhubuk-dashboard-wrapper {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  background: #222222 !important;
  background-color: #222222 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: hidden !important;
  z-index: 9999 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* CRITICAL: Prevent page-level overflow */
html, body {
  overflow: hidden !important;
  height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Hide any page-level scrollbars */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
}

html {
  scrollbar-width: none !important;
}

body {
  scrollbar-width: none !important;
}

/* Left sidebar - positioned left */
.linkhubuk-dashboard-aside {
  width: 245px;
  background: #222222 !important;
  padding: 30px 25px 32px 25px;
  height: 100vh;
  position: fixed !important;
  left: 0;
  top: 0;
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #c5a658 #222222;
  z-index: 1000;
  max-height: 100vh;
}

/* Ensure sidebar content fits properly - no infinite scroll */
.linkhubuk-dashboard-aside .linkhubuk-dashboard-section {
  margin-bottom: 8px;
}

.linkhubuk-dashboard-aside .linkhubuk-dashboard-section:last-child {
  margin-bottom: 0;
  padding-bottom: 20px; /* Add some bottom padding to ensure last button is visible */
}

/* Responsive sidebar scrolling - disable scroll on larger screens */
@media (min-height: 1000px) {
  .linkhubuk-dashboard-aside {
    overflow-y: visible !important;
    height: auto !important;
    max-height: 100vh !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
  }
}

/* Alternative approach - use both height and width breakpoints */
@media (min-height: 900px) and (min-width: 1400px) {
  .linkhubuk-dashboard-aside {
    overflow-y: visible !important;
    height: auto !important;
    max-height: 100vh !important;
  }
}

/* Ensure proper spacing on larger screens */
@media (min-height: 1000px) {
  .linkhubuk-dashboard-aside .linkhubuk-dashboard-section {
    margin-bottom: 8px;
  }
  
  .linkhubuk-dashboard-aside .linkhubuk-dashboard-section:last-child {
    margin-bottom: 0;
  }
}

/* Main content - fills remaining space */
.linkhubuk-dashboard-main {
  background: #fff;
  padding: 30px;
  border-left: 1px solid #eee;
  border-right: 1px solid #eee;
  position: fixed !important;
  left: 245px !important;
  right: 260px !important;
  top: 210px !important;
  bottom: 0 !important; /* allow full height; bottom ads are no longer fixed */
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  height: calc(100vh - 210px) !important;
  max-height: calc(100vh - 210px) !important;
  width: calc(100vw - 505px);
  scrollbar-width: thin;
  scrollbar-color: #c5a658 #222222;
  z-index: 100;
  pointer-events: auto;
}

/* Ensure main content doesn't interfere with sidebars */
.linkhubuk-dashboard-main * {
  pointer-events: auto;
}

/* Force sidebars to be above main content */
.linkhubuk-dashboard-aside,
.linkhubuk-dashboard-rightbar {
  z-index: 10000 !important;
  pointer-events: auto;
}

/* Ensure section labels are always clickable */
.linkhubuk-dashboard-label,
.linkhubuk-section-toggle {
  z-index: 10001 !important;
  pointer-events: auto !important;
  position: relative !important;
}

/* CRITICAL: Ensure any content loaded into main area cannot block sidebars */
.linkhubuk-dashboard-main,
.linkhubuk-dashboard-main *,
.linkhubuk-dashboard-main > *,
.linkhubuk-dashboard-main > * > * {
  z-index: auto !important;
}

/* Force sidebars to always be on top */
.linkhubuk-dashboard-aside,
.linkhubuk-dashboard-rightbar,
.linkhubuk-dashboard-aside *,
.linkhubuk-dashboard-rightbar * {
  z-index: 10000 !important;
  pointer-events: auto !important;
}

/* Ensure dropdown buttons stay above everything */
.linkhubuk-section-buttons,
.linkhubuk-section-buttons * {
  z-index: 10002 !important;
  pointer-events: auto !important;
}

/* Advertising rows */
/* Top advertising row - fixed beneath header */
.linkhubuk-advertising-row--top {
  position: fixed !important;
  left: 245px;
  right: 260px;
  top: 80px; /* Increased from 55px to give header more space */
  height: 150px;
  background: #f0f0f0;
  display: flex;
  gap: 30px;
  padding: 15px 15px 10px 15px; /* Reduced bottom padding */
  box-sizing: border-box;
  z-index: 1000;
  margin-bottom: 0; /* Ensure no bottom margin */
}

/* New top advertising bar (replacement for old area) */
.linkhubuk-adbars--top {
  position: fixed !important;
  left: 245px;
  right: 260px;
  top: 80px; /* Increased from 55px to give header more space */
  height: 150px;
  background: #222222;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding: 15px 15px 10px 15px; /* Reduced bottom padding */
  box-sizing: border-box;
  z-index: 1000;
  margin-bottom: 0; /* Ensure no bottom margin */
}

/* Bottom advertising row - fixed at bottom of viewport */
.linkhubuk-advertising-row--bottom {
  position: relative !important;
  height: 150px;
  background: #fff;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 15px;
  box-sizing: border-box;
  /* Ensure it stays beneath other content layers in search modules */
  z-index: 0 !important;
  margin: 16px 0 0 0;
  float: none !important;
  clear: both !important;
  order: 9999;
}

/* Ensure search modules always sit above bottom ads if overlapping occurs */
#linkhubuk-search-all-companies,
#linkhubuk-search-all-quotes {
  position: relative !important;
  z-index: 2 !important;
}

/* Override aggressive z-index on all main descendants for bottom ads specifically */
.linkhubuk-dashboard-main .linkhubuk-advertising-row--bottom,
.linkhubuk-dashboard-main .linkhubuk-advertising-row--bottom * {
  z-index: 0 !important;
}

/* ========================================
   HEADER POSITIONING FIXES
   ======================================== */

/* Ensure header is at the very top */
.linkhubuk-header,
#linkhubuk-header,
.header,
#header {
  position: relative !important;
  top: 0 !important;
  z-index: 10000 !important; /* Higher than ads */
}

/* ========================================
   EDIT PROFILE MODULE POSITIONING FIXES
   ======================================== */

/* Fix for edit profile module - ensure proper spacing above bottom ads */
#linkhubuk-edit-profile.linkhubuk-dashboard-module {
  margin-bottom: 200px !important; /* Add space for bottom advertising row */
  position: relative !important;
  z-index: 2 !important;
  min-height: auto !important; /* Override inline min-height if needed */
  padding-bottom: 40px !important; /* Ensure content has breathing room */
}

/* Ensure the form inside edit profile has proper spacing */
#linkhubuk-edit-profile #linkhubuk-edit-profile-form {
  margin-bottom: 30px !important;
}

/* Override conflicting styles for edit profile + bottom ads */
#linkhubuk-edit-profile + .linkhubuk-advertising-row--bottom {
  z-index: 1 !important;
  order: unset !important;
  position: relative !important;
  margin-top: 20px !important;
}

/* Enhanced positioning for bottom advertising row when after edit profile */
#linkhubuk-edit-profile ~ .linkhubuk-advertising-row--bottom {
  position: relative !important;
  z-index: 1 !important;
  order: unset !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 16px !important;
  padding: 15px !important;
  box-sizing: border-box !important;
  margin: 16px 0 0 0 !important;
  float: none !important;
  clear: both !important;
}

/* Banner hiding removed - restoring original functionality */

/* ========================================
   BANNER UPLOAD HIDING - CSS ONLY
   ======================================== */

/* Hide banner upload input field */
input[name="banner_upload"] {
  display: none !important;
}

/* Hide banner preview div */
#linkhubuk-banner-preview {
  display: none !important;
}

/* Hide banner upload URL hidden input */
input[name="banner_upload_url"] {
  display: none !important;
}

/* Hide banner image display if it exists */
img[alt="Current Banner"] {
  display: none !important;
}

/* Hide remove banner button */
.remove-banner-btn {
  display: none !important;
}

/* Individual ad spaces */
.linkhubuk-ad-space {
  background: #e0e0e0;
  flex: 1;
  height: 120px;
  border: 2px dashed #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #666;
  font-weight: bold;
}

/* Only pull the top ads upward; don't affect bottom ads */
.linkhubuk-adbars--top .linkhubuk-ad-space {
  margin-top: -32px;
}

/* Right sidebar - positioned right */
.linkhubuk-dashboard-rightbar {
  width: 260px;
  background: #222222 !important;
  padding: 30px 25px 32px 25px;
  height: 100vh;
  position: fixed !important;
  right: 0;
  top: 0;
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #c5a658 #222222;
}

/* ========================================
   BASIC STYLING FOR CONTENT
   ======================================== */

/* Logo styling */
.linkhubuk-sidebar-logo,
.linkhubuk-rightbar-logo {
  text-align: center;
  margin-bottom: 24px;
  display: block;
}

.linkhubuk-sidebar-logo img,
.linkhubuk-rightbar-logo img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Right sidebar logo: 192px width, 60px height (all !important to override other CSS) */
.linkhubuk-dashboard-rightbar .linkhubuk-rightbar-logo img {
  width: 192px !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 60px !important;
  min-height: 60px !important;
  background: transparent !important;
  border: none !important;
  display: block !important;
  margin: 0 auto 0 auto !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  background-color: transparent !important;
}

/* Ensure right sidebar logo container */
.linkhubuk-dashboard-rightbar .linkhubuk-rightbar-logo {
  background: #222222 !important;
  border: none !important;
  padding: 0 !important;
  margin-bottom: 24px !important;
  margin-top: 50px !important;
}

/* Force right sidebar logo size with maximum specificity */
body .linkhubuk-dashboard-wrapper .linkhubuk-dashboard-rightbar .linkhubuk-rightbar-logo img {
  width: 192px !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 60px !important;
  min-height: 60px !important;
  background: transparent !important;
  border: none !important;
  display: block !important;
  margin: 0 auto 0 auto !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  background-color: transparent !important;
}

/* Force remove any white background from right sidebar logo container */
.linkhubuk-dashboard-rightbar .linkhubuk-rightbar-logo,
.linkhubuk-dashboard-rightbar .linkhubuk-rightbar-logo * {
  background: #222222 !important;
  background-color: #222222 !important;
}

/* ========================================
   SIDEBAR BUTTON STYLING
   ======================================== */

/* Section labels (gold background) */
.linkhubuk-dashboard-label {
  background: #c5a658;
  color: #111;
  font-weight: bold;
  padding: 12px 24px;
  margin: 0 0 8px 0;
  border-radius: 20px 0 0 20px;
  font-size: 1.05em;
  letter-spacing: 0.5px;
  display: block;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  border: none;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 100;
  pointer-events: auto;
}

.linkhubuk-dashboard-label:hover {
  background: #bfa14a;
}

/* Section toggle (dropdown headers) */
.linkhubuk-section-toggle {
  background: #c5a658;
  color: #111;
  font-weight: bold;
  padding: 12px 24px;
  margin: 0 0 8px 0;
  border-radius: 20px 0 0 20px;
  font-size: 1.05em;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  border: none;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 100;
  pointer-events: auto;
}

.linkhubuk-section-toggle:hover {
  background: #bfa14a;
}

/* Section arrow */
.linkhubuk-section-arrow {
  font-size: 0.8em;
  transition: transform 0.3s ease;
}

.linkhubuk-section-toggle.active .linkhubuk-section-arrow {
  transform: rotate(180deg);
}

/* Right sidebar specific arrow alignment */
.linkhubuk-dashboard-rightbar .linkhubuk-section-toggle {
  justify-content: flex-start;
  position: relative;
  margin-bottom: 16px !important;
}

.linkhubuk-dashboard-rightbar .linkhubuk-section-arrow {
  position: absolute;
  left: 24px;
}

/* Right sidebar button spacing - override general rule */
.linkhubuk-dashboard-rightbar .linkhubuk-dashboard-btn,
.linkhubuk-dashboard-rightbar .linkhubuk-section-buttons .linkhubuk-dashboard-btn {
  margin-bottom: 16px !important;
}

/* Force 16px spacing with maximum specificity */
body .linkhubuk-dashboard-wrapper .linkhubuk-dashboard-rightbar .linkhubuk-dashboard-btn,
body .linkhubuk-dashboard-wrapper .linkhubuk-dashboard-rightbar .linkhubuk-section-buttons .linkhubuk-dashboard-btn,
body .linkhubuk-dashboard-wrapper .linkhubuk-dashboard-rightbar .linkhubuk-section-toggle {
  margin-bottom: 16px !important;
}

/* Override User Guide button inline styles with maximum specificity */
.linkhubuk-dashboard-wrapper .linkhubuk-dashboard-rightbar .linkhubuk-dashboard-section .linkhubuk-dashboard-label {
  text-align: right !important;
  justify-content: flex-start !important;
  border-radius: 20px 0 0 20px !important;
  font-size: 1.05em !important;
  letter-spacing: 0.5px !important;
  padding: 12px 24px !important;
  margin: 0 0 0 0 !important;
  background: #c5a658 !important;
  color: #111 !important;
  font-weight: bold !important;
  display: block !important;
  cursor: pointer !important;
  transition: background 0.2s, color 0.2s !important;
  border: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Add spacing after User Guide button - target first section toggle */
.linkhubuk-dashboard-rightbar .linkhubuk-dashboard-section:first-of-type .linkhubuk-section-toggle {
  margin-top: 6px !important;
}

/* Target specific first section button with 14px margin-top for right aside only */
.linkhubuk-dashboard-rightbar div#first-section-button {
  margin-top: 14px !important;
}

/* Reduce spacing for desktop screens */
@media (min-width: 1200px) and (max-width: 1600px) {
  .linkhubuk-dashboard-rightbar div#first-section-button {
    margin-top: 14px !important;
  }
}

.linkhubuk-dashboard-wrapper .linkhubuk-dashboard-rightbar .linkhubuk-dashboard-section .linkhubuk-dashboard-label:hover {
  background: #bfa14a !important;
}

/* Dropdown buttons (dark background) */
.linkhubuk-dashboard-btn {
  background: #111;
  color: #c5a658;
  border: none;
  border-radius: 20px 0 0 20px;
  padding: 12px 24px;
  margin: 0 0 16px 0;
  font-size: 1em;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  width: 100%;
  display: block;
  transition: background 0.2s, color 0.2s;
  box-sizing: border-box;
}

/* Right sidebar buttons - align text to the right */
.linkhubuk-dashboard-rightbar .linkhubuk-dashboard-btn {
  text-align: right !important;
}

.linkhubuk-dashboard-btn:hover {
  background: #c5a658;
  color: #111;
}

/* Section containers */
.linkhubuk-dashboard-section {
  margin-bottom: 8px;
  display: block;
  position: relative;
}

/* Dropdown content */
.linkhubuk-section-buttons {
  overflow: visible;
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  margin-left: 12px;
  max-height: 0;
  opacity: 0;
  display: block;
  position: relative;
  z-index: 10000;
}

.linkhubuk-section-buttons.show {
  max-height: 1200px;
  opacity: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #c5a658 #222222;
  position: relative;
  z-index: 10000;
}

.linkhubuk-section-buttons .linkhubuk-dashboard-btn {
  transition: all 0.6s ease;
  opacity: 0;
  transform: translateY(-5px);
}

.linkhubuk-section-buttons.show .linkhubuk-dashboard-btn {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger the button animations */
.linkhubuk-section-buttons.show .linkhubuk-dashboard-btn:nth-child(1) { transition-delay: 0.2s; }
.linkhubuk-section-buttons.show .linkhubuk-dashboard-btn:nth-child(2) { transition-delay: 0.3s; }
.linkhubuk-section-buttons.show .linkhubuk-dashboard-btn:nth-child(3) { transition-delay: 0.4s; }
.linkhubuk-section-buttons.show .linkhubuk-dashboard-btn:nth-child(4) { transition-delay: 0.5s; }
.linkhubuk-section-buttons.show .linkhubuk-dashboard-btn:nth-child(5) { transition-delay: 0.6s; }

/* ========================================
   SCROLLBAR STYLING
   ======================================== */

/* Custom scrollbar for webkit browsers */
.linkhubuk-dashboard-aside::-webkit-scrollbar,
.linkhubuk-dashboard-rightbar::-webkit-scrollbar,
.linkhubuk-dashboard-main::-webkit-scrollbar,
.linkhubuk-section-buttons.show::-webkit-scrollbar {
  width: 8px;
}

.linkhubuk-dashboard-aside::-webkit-scrollbar-track,
.linkhubuk-dashboard-rightbar::-webkit-scrollbar-track,
.linkhubuk-dashboard-main::-webkit-scrollbar-track,
.linkhubuk-section-buttons.show::-webkit-scrollbar-track {
  background: #222222;
}

.linkhubuk-dashboard-aside::-webkit-scrollbar-thumb,
.linkhubuk-dashboard-rightbar::-webkit-scrollbar-thumb,
.linkhubuk-dashboard-main::-webkit-scrollbar-thumb,
.linkhubuk-section-buttons.show::-webkit-scrollbar-thumb {
  background: #c5a658;
  border-radius: 4px;
}

.linkhubuk-dashboard-aside::-webkit-scrollbar-thumb:hover,
.linkhubuk-dashboard-rightbar::-webkit-scrollbar-thumb:hover,
.linkhubuk-dashboard-main::-webkit-scrollbar-thumb:hover,
.linkhubuk-section-buttons.show::-webkit-scrollbar-thumb:hover {
  background: #bfa14a;
}

/* ========================================
   MAIN CONTENT SCROLLING
   ======================================== */

/* Ensure main content area content can scroll properly */
.linkhubuk-dashboard-main > div {
  height: auto;
  overflow: visible;
}

/* Ensure main content has proper height and content flows naturally */
.linkhubuk-dashboard-main {
  min-height: calc(100vh - 210px) !important;
  position: relative;
}

/* Ensure all content flows naturally to the bottom */
.linkhubuk-dashboard-main > * {
  width: 100%;
  box-sizing: border-box;
}

/* Force content to expand and push pagination to bottom */
.linkhubuk-dashboard-main .linkhubuk-content-area,
.linkhubuk-dashboard-main .linkhubuk-module-content {
  min-height: calc(100vh - 300px);
  display: flex;
  flex-direction: column;
}

/* Ensure grid containers have proper height */
.linkhubuk-dashboard-main .linkhubuk-company-grid,
.linkhubuk-dashboard-main .linkhubuk-quote-grid,
.linkhubuk-dashboard-main .linkhubuk-results-container {
  flex: 1;
  min-height: 0;
}

/* Ensure pagination and bottom elements stick to bottom */
.linkhubuk-dashboard-main .pagination,
.linkhubuk-dashboard-main .linkhubuk-pagination,
.linkhubuk-dashboard-main .linkhubuk-bottom-actions,
.linkhubuk-dashboard-main .pager,
.linkhubuk-dashboard-main .nav-links,
.linkhubuk-dashboard-main .page-numbers {
  margin-top: auto !important;
  padding-top: 20px;
}

/* Target pagination divs with specific inline styles - STICKY POSITIONING REMOVED */
.linkhubuk-dashboard-main div[style*="margin-top:32px"] {
  margin-top: auto !important;
  /* position: sticky !important; REMOVED - was causing image section to float above form fields */
  /* bottom: 0 !important; REMOVED */
  background: transparent !important;
  /* z-index: 10 !important; REMOVED */
  width: 100% !important;
  justify-content: flex-end !important;
}

/* Simple pagination bar positioning */
#linkhubuk-pagination-bar {
  float: right !important;
  clear: both !important;
  margin-top: auto !important;
  position: sticky !important;
  bottom: 0 !important;
  background: transparent !important;
  z-index: 10 !important;
  justify-content: flex-end !important;
  padding-right: 20px !important;
}

/* Fix pricing card positioning - exclude from sticky positioning */
.linkhubuk-dashboard-main .pricing-section,
.linkhubuk-dashboard-main .pricing-card {
  position: static !important;
  bottom: auto !important;
  margin-top: 0 !important;
  justify-content: center !important;
}

/* Fix additional services scrolling - ensure full content is accessible */
#linkhubuk-additional-services {
  min-height: calc(100vh - 250px) !important;
  max-height: none !important;
  overflow-y: visible !important;
  padding-bottom: 100px !important; /* Add extra space at bottom */
}

/* Ensure additional services content can expand fully */
#linkhubuk-additional-services .linkhubuk-services-content,
#linkhubuk-additional-services form {
  min-height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* ================================
   Additional Services: Scrolling Fix
   ================================ */
/* Override main dashboard height constraints when additional services is active */
.linkhubuk-dashboard-main:has(#linkhubuk-additional-services:not([style*="display:none"])) {
  height: auto !important;
  max-height: none !important;
  min-height: calc(100vh - 210px) !important;
  overflow-y: visible !important;
}

/* Fallback for browsers that don't support :has() */
body.additional-services-active .linkhubuk-dashboard-main {
  height: auto !important;
  max-height: none !important;
  min-height: calc(100vh - 210px) !important;
  overflow-y: visible !important;
}

/* More specific override for the main dashboard area */
body.additional-services-active .linkhubuk-dashboard-wrapper .linkhubuk-dashboard-main {
  height: auto !important;
  max-height: none !important;
  min-height: calc(100vh - 210px) !important;
  overflow-y: visible !important;
}

/* Ensure the Additional Services module can expand fully */
#linkhubuk-additional-services {
  min-height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding-bottom: 100px !important;
  margin-bottom: 50px !important;
}

/* Allow inner content to render beyond viewport without clipping */
#linkhubuk-services-content,
#linkhubuk-additional-services #linkhubuk-services-content,
#linkhubuk-additional-services *[id^="linkhubuk-services-"] {
  overflow: visible !important;
  max-height: none !important;
}

/* Override content area height constraints when additional services is active */
body.additional-services-active .linkhubuk-dashboard-main .linkhubuk-content-area,
body.additional-services-active .linkhubuk-dashboard-main .linkhubuk-module-content {
  min-height: auto !important;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
}

/* Most specific override - target the exact height constraint causing the issue */
body.additional-services-active .linkhubuk-dashboard-wrapper .linkhubuk-dashboard-main[style*="height: calc(100vh - 210px)"] {
  height: auto !important;
  max-height: none !important;
  min-height: calc(100vh - 210px) !important;
  overflow-y: visible !important;
}

/* Nuclear option - override ALL possible height constraints */
body.additional-services-active .linkhubuk-dashboard-main {
  height: auto !important;
  max-height: none !important;
  min-height: auto !important;
  overflow-y: visible !important;
}

/* Override any inline styles */
body.additional-services-active .linkhubuk-dashboard-main[style] {
  height: auto !important;
  max-height: none !important;
  min-height: auto !important;
  overflow-y: visible !important;
}

/* Make pagination buttons 30% smaller and change text color */
.linkhubuk-dashboard-main div[style*="margin-top:32px"] a,
.linkhubuk-dashboard-main div[style*="display:flex"][style*="justify-content:center"] a {
  transform: scale(0.7) !important;
  transform-origin: center !important;
  color: #C82218 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  display: inline-block !important;
}

/* Force main content area to be scrollable - REMOVED DUPLICATE RULE */

/* Ensure company grid content is scrollable - REMOVED TO PREVENT EXTRA SCROLLBAR */

/* Specific styling for company search results */
.linkhubuk-company-grid,
.linkhubuk-company-grid *,
.linkhubuk-company-grid .company-item,
.linkhubuk-company-grid .company-card {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* Ensure company grid stays within viewport bounds - REMOVED TO PREVENT EXTRA SCROLLBAR */

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 900px) {
  .linkhubuk-dashboard-wrapper {
    width: 100vw;
    max-width: 100vw;
  }
  
  .linkhubuk-dashboard-aside,
  .linkhubuk-dashboard-main,
  .linkhubuk-dashboard-rightbar {
    position: relative;
    width: 100%;
    left: auto;
    right: auto;
    top: auto;
  }
  
  .linkhubuk-dashboard-main {
    border-left: none;
    border-right: none;
    border-top: 1px solid #eee;
  }
} 

/* ========================================
   FORCE LEFT SIDEBAR SCROLLBAR ALWAYS VISIBLE
   ======================================== */

/* Force left sidebar scrollbar to always be visible */
.linkhubuk-dashboard-aside {
  overflow-y: scroll !important;
  scrollbar-width: thin !important;
  scrollbar-color: #c5a658 #222222 !important;
}

/* WebKit scrollbar always visible */
.linkhubuk-dashboard-aside::-webkit-scrollbar {
  width: 8px !important;
  display: block !important;
  visibility: visible !important;
}

.linkhubuk-dashboard-aside::-webkit-scrollbar-track {
  background: #222222 !important;
  display: block !important;
  visibility: visible !important;
}

.linkhubuk-dashboard-aside::-webkit-scrollbar-thumb {
  background: #c5a658 !important;
  border-radius: 4px !important;
  display: block !important;
  visibility: visible !important;
}

.linkhubuk-dashboard-aside::-webkit-scrollbar-thumb:hover {
  background: #bfa14a !important;
}

/* Hide unwanted scrollbar arrow buttons */
.linkhubuk-dashboard-aside::-webkit-scrollbar-button {
  display: none !important;
  height: 0 !important;
  width: 0 !important;
  background: transparent !important;
}

/* Hide scrollbar arrow buttons with maximum specificity */
html body .linkhubuk-dashboard-wrapper .linkhubuk-dashboard-aside::-webkit-scrollbar-button {
  display: none !important;
  height: 0 !important;
  width: 0 !important;
  background: transparent !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Target specific arrow buttons (up/down) */
.linkhubuk-dashboard-aside::-webkit-scrollbar-button:start:decrement,
.linkhubuk-dashboard-aside::-webkit-scrollbar-button:end:increment {
  display: none !important;
  height: 0 !important;
  width: 0 !important;
  background: transparent !important;
}

/* Force hide all scrollbar buttons */
.linkhubuk-dashboard-aside::-webkit-scrollbar-button:vertical:start:decrement,
.linkhubuk-dashboard-aside::-webkit-scrollbar-button:vertical:end:increment,
.linkhubuk-dashboard-aside::-webkit-scrollbar-button:horizontal:start:decrement,
.linkhubuk-dashboard-aside::-webkit-scrollbar-button:horizontal:end:increment {
  display: none !important;
  height: 0 !important;
  width: 0 !important;
  background: transparent !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Ensure scrollbar is visible on all screen sizes */
@media (min-width: 901px) {
  .linkhubuk-dashboard-aside {
    overflow-y: scroll !important;
    scrollbar-width: thin !important;
    scrollbar-color: #c5a658 #222222 !important;
  }
}

/* For smaller screens - ensure proper scrolling behavior */
@media (max-height: 800px) {
  .linkhubuk-dashboard-aside {
    overflow-y: auto !important;
    max-height: 100vh !important;
  }
}

/* For very small screens - force scroll to be visible */
@media (max-height: 600px) {
  .linkhubuk-dashboard-aside {
    overflow-y: scroll !important;
    scrollbar-width: thin !important;
    scrollbar-color: #c5a658 #222222 !important;
  }
} 

/* ========================================
   AGGRESSIVE SCROLLBAR FORCING
   ======================================== */

/* Force left sidebar scrollbar with maximum specificity */
html body .linkhubuk-dashboard-wrapper .linkhubuk-dashboard-aside {
  overflow-y: scroll !important;
  scrollbar-width: thin !important;
  scrollbar-color: #c5a658 #222222 !important;
}

/* Removed problematic ::after pseudo-element that was causing infinite scroll */

/* Additional WebKit scrollbar forcing */
html body .linkhubuk-dashboard-wrapper .linkhubuk-dashboard-aside::-webkit-scrollbar {
  width: 8px !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

html body .linkhubuk-dashboard-wrapper .linkhubuk-dashboard-aside::-webkit-scrollbar-track {
  background: #222222 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

html body .linkhubuk-dashboard-wrapper .linkhubuk-dashboard-aside::-webkit-scrollbar-thumb {
  background: #c5a658 !important;
  border-radius: 4px !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Force scrollbar on all screen sizes with maximum specificity */
@media (min-width: 901px) {
  html body .linkhubuk-dashboard-wrapper .linkhubuk-dashboard-aside {
    overflow-y: scroll !important;
    scrollbar-width: thin !important;
    scrollbar-color: #c5a658 #222222 !important;
  }
} 

/* ========================================
   COMPANY PROFILE DISPLAY FIX - COMPANY HUB
   ======================================== */

/* Only target company profile modals, not all modals */
#linkhubuk-view-profile .linkhubuk-modal,
.linkhubuk-modal[data-module="view-profile"] {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0,0,0,0.5) !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    /* TEST: Bright red border to verify CSS is loading */
    border: 10px solid #ff0000 !important;
}

#linkhubuk-view-profile .linkhubuk-modal-content,
.linkhubuk-modal[data-module="view-profile"] .linkhubuk-modal-content {
    background: #ffff00 !important; /* TEST: Bright yellow background */
    border-radius: 12px !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3) !important;
    max-width: 90vw !important;
    width: 900px !important;
    max-height: 95vh !important;
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    position: relative !important;
    padding: 30px !important;
    margin: 20px !important;
    /* TEST: Bright green border to verify CSS is loading */
    border: 5px solid #00ff00 !important;
}

/* Custom scrollbar for modal content */
#linkhubuk-view-profile .linkhubuk-modal-content::-webkit-scrollbar,
.linkhubuk-modal[data-module="view-profile"] .linkhubuk-modal-content::-webkit-scrollbar {
    width: 8px !important;
}

#linkhubuk-view-profile .linkhubuk-modal-content::-webkit-scrollbar-track,
.linkhubuk-modal[data-module="view-profile"] .linkhubuk-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 4px !important;
}

#linkhubuk-view-profile .linkhubuk-modal-content::-webkit-scrollbar-thumb,
.linkhubuk-modal[data-module="view-profile"] .linkhubuk-modal-content::-webkit-scrollbar-thumb {
    background: #c5a85b !important;
    border-radius: 4px !important;
}

#linkhubuk-view-profile .linkhubuk-modal-content::-webkit-scrollbar-thumb:hover,
.linkhubuk-modal[data-module="view-profile"] .linkhubuk-modal-content::-webkit-scrollbar-thumb:hover {
    background: #b89a4a !important;
}

/* Ensure profile content is fully visible */
#linkhubuk-view-profile .linkhubuk-profile-content,
.linkhubuk-modal[data-module="view-profile"] .linkhubuk-profile-content {
    min-height: 400px !important;
    padding-bottom: 60px !important; /* Extra space for buttons */
}

/* Fix for company profile sections */
#linkhubuk-view-profile .linkhubuk-profile-section,
.linkhubuk-modal[data-module="view-profile"] .linkhubuk-profile-section {
    margin-bottom: 28px !important;
    padding-bottom: 20px !important;
}

/* Ensure close/back buttons are always visible */
#linkhubuk-view-profile .linkhubuk-profile-close,
#linkhubuk-view-profile .linkhubuk-modal-close,
.linkhubuk-modal[data-module="view-profile"] .linkhubuk-profile-close,
.linkhubuk-modal[data-module="view-profile"] .linkhubuk-modal-close {
    position: sticky !important;
    bottom: 20px !important;
    z-index: 1000 !important;
    background: #c5a85b !important;
    color: #111 !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 12px 24px !important;
    font-size: 1em !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin-top: 20px !important;
    display: block !important;
    width: 100% !important;
    text-align: center !important;
}

#linkhubuk-view-profile .linkhubuk-profile-close:hover,
#linkhubuk-view-profile .linkhubuk-modal-close:hover,
.linkhubuk-modal[data-module="view-profile"] .linkhubuk-profile-close:hover,
.linkhubuk-modal[data-module="view-profile"] .linkhubuk-modal-close:hover {
    background: #b89a4a !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(197, 168, 91, 0.3) !important;
}

/* Responsive fixes */
@media (max-width: 1200px) {
    #linkhubuk-view-profile .linkhubuk-modal-content,
    .linkhubuk-modal[data-module="view-profile"] .linkhubuk-modal-content {
        width: 95vw !important;
        max-width: 95vw !important;
        padding: 30px !important;
    }
}

@media (max-width: 768px) {
    #linkhubuk-view-profile .linkhubuk-modal-content,
    .linkhubuk-modal[data-module="view-profile"] .linkhubuk-modal-content {
        width: 98vw !important;
        max-width: 98vw !important;
        padding: 20px !important;
        margin: 10px !important;
    }
    
    #linkhubuk-view-profile .linkhubuk-profile-close,
    #linkhubuk-view-profile .linkhubuk-modal-close,
    .linkhubuk-modal[data-module="view-profile"] .linkhubuk-profile-close,
    .linkhubuk-modal[data-module="view-profile"] .linkhubuk-modal-close {
        padding: 10px 20px !important;
        font-size: 0.9em !important;
    }
}

/* Ensure profile sections don't get cut off */
#linkhubuk-view-profile .linkhubuk-profile-section:last-child,
.linkhubuk-modal[data-module="view-profile"] .linkhubuk-profile-section:last-child {
    margin-bottom: 60px !important; /* Extra space for buttons */
}

/* Fix for any floating elements that might be hiding content */
#linkhubuk-view-profile .linkhubuk-profile-content::after,
.linkhubuk-modal[data-module="view-profile"] .linkhubuk-profile-content::after {
    content: "";
    display: block;
    height: 60px;
    clear: both;
}

/* Ensure modal backdrop doesn't interfere with scrolling */
#linkhubuk-view-profile .linkhubuk-modal,
.linkhubuk-modal[data-module="view-profile"] {
    overflow-y: auto !important;
}

/* Fix for any existing modal styles that might conflict */
#linkhubuk-view-profile .linkhubuk-modal *,
.linkhubuk-modal[data-module="view-profile"] * {
    box-sizing: border-box !important;
}