/* ============================================
   NVA - COOKIECONSENT THEME
   Light Blue Gradient, Glass Effect, Modern
   ============================================ */

/* Root scope - CookieConsent uses #cc-main */
#cc-main {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif !important;
}

/* CRITICAL: Hide modal completely on privacy page - ONLY #cc-main */
/* Note: We check URL in JavaScript, this is just a safety net */

/* Ensure page is scrollable when interaction is not disabled */
html:not(.disable--interaction) body,
body:not(.disable--interaction) {
  overflow: auto !important;
  pointer-events: auto !important;
}

/* When interaction is disabled, prevent scrolling */
html.disable--interaction body,
body.disable--interaction {
  overflow: hidden !important;
  pointer-events: none !important;
}

/* Ensure modals are always interactive even when page interaction is disabled */
#cc-main .cm,
#cc-main .pm,
#cc-main .cm-wrapper,
#cc-main .pm-overlay {
  pointer-events: auto !important;
}

/* ============================================
   OVERLAY - Backdrop
   ============================================ */
#cc-main .cm-wrapper:before,
#cc-main .pm-overlay {
  background: rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

/* ============================================
   MODAL - Centered, Glass Effect
   ============================================ */
#cc-main .cm-wrapper {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* FORCE modal to stay visible - ONLY when interaction is disabled (no consent) */
html.disable--interaction #cc-main .cm-wrapper {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Prevent modal from being hidden by any means - ONLY when no consent */
html.disable--interaction #cc-main .cm-wrapper[style*="display: none"],
html.disable--interaction #cc-main .cm-wrapper[style*="visibility: hidden"],
html.disable--interaction #cc-main .cm-wrapper[style*="opacity: 0"],
html.disable--interaction #cc-main .cm-wrapper[aria-hidden="true"] {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Force modal inner element visible - ONLY when no consent */
html.disable--interaction #cc-main .cm-wrapper .cm {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Override ANY inline styles that try to hide the modal - ONLY when no consent */
html.disable--interaction #cc-main .cm-wrapper[style] {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#cc-main .cm {
  background: linear-gradient(135deg, rgba(241, 248, 255, 0.95) 0%, rgba(230, 244, 255, 0.90) 100%) !important;
  border-radius: 16px !important;
  border: 1px solid rgba(99, 179, 237, 0.3) !important;
  box-shadow: 
    0 20px 60px rgba(12, 18, 28, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  max-width: 520px !important;
  width: calc(100% - 32px) !important;
  padding: 0 !important;
  overflow: hidden !important;
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  transform: translate(-50%, -50%) !important;
}

@media (max-width: 640px) {
  #cc-main .cm {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
  }
}

/* Hide consent modal when preferences modal is visible */
#cc-main:has(.pm-overlay:not([aria-hidden="true"])) .cm-wrapper {
  display: none !important;
}

/* Preferences Modal */
#cc-main .pm-overlay {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#cc-main .pm {
  background: linear-gradient(135deg, rgba(241, 248, 255, 0.95) 0%, rgba(230, 244, 255, 0.90) 100%) !important;
  border-radius: 16px !important;
  border: 1px solid rgba(99, 179, 237, 0.3) !important;
  box-shadow: 
    0 20px 60px rgba(12, 18, 28, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  max-width: 520px !important;
  width: calc(100% - 32px) !important;
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  transform: translate(-50%, -50%) !important;
}

@media (max-width: 640px) {
  /* Force correct positioning for preferences modal on mobile */
  #cc-main .pm {
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    position: fixed !important;
  }
  
  /* Ensure overlay is properly centered on mobile */
  #cc-main .pm-overlay {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    position: fixed !important;
  }
}

/* ============================================
   HEADER - Logo Only (via JavaScript injection)
   ============================================ */
/* Logo will be injected via JavaScript, hide CSS pseudo-element if JS logo exists */
#cc-main .cm__texts:has(.cc-logo)::before {
  display: none !important;
}

/* Hide title if empty */
#cc-main .cm__title:empty {
  display: none !important;
}

/* Logo styling */
#cc-main .cc-logo {
  width: 220px !important;
  height: 70px !important;
  margin: 0 auto 24px auto !important;
  background: url('/logos/nva-logo-primary.svg') no-repeat center center / contain !important;
  padding: 32px 0 0 0 !important;
}

/* ============================================
   BODY - Description Text
   ============================================ */
#cc-main .cm__desc {
  color: #4a4a4a !important;
  font-size: 15px !important;
  line-height: 1.6 !important;
  margin: 0 0 20px 0 !important;
  padding-bottom: 16px !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

#cc-main .cm__desc a,
#cc-main .cc__link {
  color: #007AFF !important;
  text-decoration: underline !important;
  font-weight: 500 !important;
}

#cc-main .cm__desc a:hover,
#cc-main .cc__link:hover {
  color: #0051D5 !important;
}

/* ============================================
   PURPOSE CARDS - Category Blocks
   ============================================ */
#cc-main .pm__section {
  background: rgba(255, 255, 255, 0.7) !important;
  border: 1px solid rgba(99, 179, 237, 0.25) !important;
  border-radius: 12px !important;
  padding: 16px !important;
  margin-bottom: 12px !important;
  transition: all 0.2s ease !important;
}

#cc-main .pm__section:hover {
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: rgba(99, 179, 237, 0.35) !important;
}

#cc-main .pm__section-title {
  font-weight: 600 !important;
  font-size: 15px !important;
  color: #1a1a1a !important;
  margin-bottom: 8px !important;
}

#cc-main .pm__section-desc {
  font-size: 13px !important;
  color: #6c757d !important;
  margin: 0 !important;
  line-height: 1.5 !important;
}

/* ============================================
   TOGGLE SWITCHES - Modern iOS Style
   ============================================ */
#cc-main .toggle__icon {
  background-color: #e0e0e0 !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#cc-main .toggle__icon-circle {
  background-color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

#cc-main .section__toggle:checked ~ .toggle__icon {
  background-color: #007AFF !important;
}

#cc-main .section__toggle:focus ~ .toggle__icon {
  outline: 2px solid rgba(0, 122, 255, 0.3) !important;
  outline-offset: 2px !important;
}

/* ============================================
   BUTTONS - Brand Blue Gradient Primary
   ============================================ */
#cc-main .cm__btn,
#cc-main .pm__btn {
  border-radius: 12px !important;
  padding: 12px 24px !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  min-height: 44px !important;
}

/* Accept All - Primary Brand Blue Gradient */
#cc-main .cm__btn[data-cc="accept-all"],
#cc-main .pm__btn[data-cc="accept-all"] {
  background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%) !important;
  color: #ffffff !important;
  flex: 1 1 auto !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  padding: 14px 28px !important;
  min-height: 50px !important;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.25) !important;
}

#cc-main .cm__btn[data-cc="accept-all"]:hover,
#cc-main .pm__btn[data-cc="accept-all"]:hover {
  background: linear-gradient(135deg, #0051D5 0%, #003d9e 100%) !important;
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 6px 20px rgba(0, 122, 255, 0.35) !important;
}

#cc-main .cm__btn[data-cc="accept-all"]:active,
#cc-main .pm__btn[data-cc="accept-all"]:active {
  transform: translateY(0) scale(0.98) !important;
}

/* Accept Selected - Secondary Neutral */
#cc-main .cm__btn[data-cc="show"],
#cc-main .pm__btn[data-cc="save"] {
  background: #f8f9fa !important;
  color: #1a1a1a !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

#cc-main .cm__btn[data-cc="show"]:hover,
#cc-main .pm__btn[data-cc="save"]:hover {
  background: #e9ecef !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
}

/* Decline - Quiet Text */
#cc-main .cm__btn[data-cc="accept-necessary"],
#cc-main .pm__btn[data-cc="necessary"] {
  background: transparent !important;
  color: #6c757d !important;
  padding: 12px 20px !important;
}

#cc-main .cm__btn[data-cc="accept-necessary"]:hover,
#cc-main .pm__btn[data-cc="necessary"]:hover {
  background: #f8f9fa !important;
  color: #495057 !important;
}

/* ============================================
   FOOTER - Button Container
   ============================================ */
#cc-main .cm__btns,
#cc-main .pm__footer {
  padding: 20px 24px 24px 24px !important;
  border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
  background: transparent !important;
  display: flex !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
  position: relative !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  #cc-main .cm,
  #cc-main .pm {
    width: calc(100% - 24px) !important;
    border-radius: 14px !important;
  }
  
  #cc-main .cm__texts::before {
    width: 180px !important;
    height: 60px !important;
    margin-bottom: 20px !important;
  }
  
  #cc-main .cm__desc {
    padding: 0 20px 16px 20px !important;
  }
  
  #cc-main .cm__btns,
  #cc-main .pm__footer {
    padding: 16px 20px 20px 20px !important;
    flex-direction: column !important;
  }
  
  #cc-main .cm__btn,
  #cc-main .pm__btn {
    width: 100% !important;
  }
}


