/* ============================================
   GOOGLE FONTS IMPORT
   Using Barlow as a fallback similar to Bio Sans
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@600;700;800&display=swap');

/* ============================================
   BIO SANS BOLD FONT (Custom)
   Used for "Macomb County" branding text
   If you have the Bio Sans font files, place them in wwwroot/fonts/
   ============================================ */
@font-face {
    font-family: 'Bio Sans Bold';
    src: url('/fonts/BioSans-Bold.woff2') format('woff2'),
         url('/fonts/BioSans-Bold.woff') format('woff'),
         url('/fonts/BioSans-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

/* Font class - uses Bio Sans if available, falls back to Barlow (Google Font) */
.font-bio-sans {
    font-family: 'Bio Sans Bold', 'Barlow', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 700;
}

/* ============================================
   CARD STYLING
   ============================================ */

.card {
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.card-body {
  padding: 1.5rem;
}

.card-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* Hover card effect */
.hover-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: none;
}

.hover-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Clickable card */
.card-clickable {
  cursor: pointer;
}

.card-clickable:hover {
  border-color: var(--bs-primary);
  box-shadow: 0 0.25rem 0.5rem rgba(13, 110, 253, 0.1);
}

/* ============================================
   NAVBAR HORIZONTAL SCROLLING
   Makes nav tabs scrollable on narrow screens
   ============================================ */

/* Ensure navbar dropdowns appear above all content */
.navbar {
  z-index: 1030;
}

.navbar .dropdown-menu {
  z-index: 1031;
}

/* Mobile collapsed navbar - ensure it appears above all page content */
@media (max-width: 991.98px) {
  .navbar-collapse {
    position: relative;
    z-index: 1040;
    background-color: var(--bs-primary);
    margin: 0 -0.75rem; /* Extend to edges of container */
    padding: 0 0.75rem;
    max-height: calc(100vh - 120px); /* Account for navbar and alert banner */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem; /* Extra padding at bottom for last dropdown */
  }
  
  /* Ensure dropdown menus within collapsed navbar are visible */
  .navbar-collapse .dropdown-menu {
    position: static !important;
    float: none;
    background-color: #ffffff;
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
    border-radius: 0.375rem;
    margin: 0.25rem 0;
    padding: 0.5rem 0;
    max-height: none; /* Allow dropdown to expand fully */
  }
  
  .navbar-collapse .dropdown-menu .dropdown-item {
    color: #212529;
    padding: 0.5rem 1rem;
  }
  
  .navbar-collapse .dropdown-menu .dropdown-item:hover,
  .navbar-collapse .dropdown-menu .dropdown-item:focus {
    background-color: #f8f9fa;
    color: #0d6efd;
  }
  
  .navbar-collapse .dropdown-menu .dropdown-divider {
    border-color: #dee2e6;
  }
  
  .navbar-collapse .dropdown-menu.show {
    display: block;
  }
}

/* Wrapper for horizontal scrolling nav items */
.navbar-nav-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.3) transparent;
}

/* Webkit scrollbar styling */
.navbar-nav-scroll::-webkit-scrollbar {
  height: 4px;
}

.navbar-nav-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.navbar-nav-scroll::-webkit-scrollbar-thumb {
  background-color: rgba(255,255,255,0.3);
  border-radius: 4px;
}

.navbar-nav-scroll::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255,255,255,0.5);
}

/* Prevent nav items from wrapping */
.navbar-nav-scroll .navbar-nav {
  flex-wrap: nowrap;
}

.navbar-nav-scroll .nav-item {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Add fade effect on edges */
.navbar-scroll-container {
  position: relative;
  flex: 1;
  min-width: 0;
}

@media (min-width: 992px) {
  .navbar-scroll-container::before,
  .navbar-scroll-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s;
  }

  .navbar-scroll-container::before {
    left: 0;
    background: linear-gradient(to right, var(--bs-primary), transparent);
  }

  .navbar-scroll-container::after {
    right: 0;
    background: linear-gradient(to left, var(--bs-primary), transparent);
  }

  .navbar-scroll-container.has-scroll-left::before {
    opacity: 1;
  }

  .navbar-scroll-container.has-scroll-right::after {
    opacity: 1;
  }
}

/* Navigation Active State */
.navbar-dark .navbar-nav .nav-link.active {
  font-weight: 600;
  border-bottom: 2px solid rgba(255, 255, 255, 0.8);
}

/* ============================================
   HERO SECTION (with parallax background)
   ============================================ */

.hero-section {
  position: relative;
  overflow: visible;
  /* Remove any background from the section itself */
  background: transparent;
  --parallax-offset: 0px;
  z-index: 1; /* Ensure hero is below navbar */
}

/* Background image layer */
.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('/images/KC8KJO-ARPSC-Deployed.jpg');
  background-size: cover;
  background-position: center calc(0% + var(--parallax-offset));
  background-repeat: no-repeat;
  transform: translateZ(0);
  will-change: transform;
  z-index: 0;
}

/* Blue overlay layer - semi-transparent to let image show through */
.hero-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.60) 0%, rgba(10, 88, 202, 0.65) 100%);
  z-index: 1;
}

.hero-section > .container {
  position: relative;
  z-index: 2;
}

@media (max-width: 768px) {
  .hero-section::before {
    /* On mobile, adjust position for smaller screen */
    background-position: center calc(0% + var(--parallax-offset));
  }
  
  .hero-section::after {
    /* Slightly more opaque on mobile for text readability */
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.70) 0%, rgba(10, 88, 202, 0.75) 100%);
  }
}

/* ============================================
   FEATURE CARDS & ICONS
   ============================================ */

.feature-icon {
  font-size: 1.5rem;
  transition: transform 0.3s ease;
}

.hover-card:hover .feature-icon {
  transform: scale(1.1);
}

/* ============================================
   WEATHER ALERT COLORS (Custom NWS-style)
   Warning: #DC3545 (Bootstrap danger red)
   Watch: #FD7E14 (Bootstrap orange)  
   Advisory/HWO: #FFC107 (Bootstrap warning yellow - gold/amber)
   Clear: #198754 (Bootstrap success green)
   ============================================ */

/* Warning - Red */
.bg-nws-warning {
  background-color: #DC3545 !important;
  color: white !important;
}
.border-nws-warning {
  border-color: #DC3545 !important;
}
.text-nws-warning {
  color: #DC3545 !important;
}

/* Watch - Orange */
.bg-nws-watch {
  background-color: #FD7E14 !important;
  color: #000 !important;
}
.border-nws-watch {
  border-color: #FD7E14 !important;
}
.text-nws-watch {
  color: #FD7E14 !important;
}

/* Advisory - Bootstrap Warning Yellow (golden amber) */
.bg-nws-advisory {
  background-color: #FFC107 !important;
  color: #000 !important;
}
.border-nws-advisory {
  border-color: #FFC107 !important;
}
.text-nws-advisory {
  color: #997404 !important; /* Darker for text visibility */
}

/* HWO - Same as Advisory (Bootstrap Warning Yellow) */
.bg-nws-hwo {
  background-color: #FFC107 !important;
  color: #000 !important;
}
.border-nws-hwo {
  border-color: #FFC107 !important;
}
.text-nws-hwo {
  color: #997404 !important;
}

/* Statement - Blue (Bootstrap info) */
.bg-nws-statement {
  background-color: #0dcaf0 !important;
  color: #000 !important;
}
.border-nws-statement {
  border-color: #0dcaf0 !important;
}
.text-nws-statement {
  color: #0dcaf0 !important;
}

/* All Clear - Green (Bootstrap success) */
.bg-nws-clear {
  background-color: #198754 !important;
  color: white !important;
}
.border-nws-clear {
  border-color: #198754 !important;
}
.text-nws-clear {
  color: #198754 !important;
}

/* Other/Unknown - Gray */
.bg-nws-other {
  background-color: #6c757d !important;
  color: white !important;
}
.border-nws-other {
  border-color: #6c757d !important;
}
.text-nws-other {
  color: #6c757d !important;
}
/* ============================================
   WEATHER ALERT BANNER
   ============================================ */

.weather-alert-banner {
  position: relative;
  z-index: 1010; /* Below navbar (1030) and navbar dropdowns (1040+) */
}

.weather-alert-banner .badge {
  font-size: 0.75rem;
  padding: 0.35em 0.65em;
}

/* Popover styling for banner hover - ensure it doesn't cover navbar dropdowns */
.popover {
  z-index: 1015 !important; /* Above banner but below navbar dropdowns */
}

/* Ensure navbar dropdowns appear above the weather banner and its popover */
.navbar .dropdown-menu {
  z-index: 1050 !important; /* Above everything including navbar (1030) */
}

/* Popover content styling */
.nws-popover-content {
  font-size: 0.875rem;
}

.nws-popover-content a:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* ============================================
   MAIN CONTENT AREA - Z-INDEX
   Ensure main content doesn't overlap navbar dropdowns
   ============================================ */

main[role="main"] {
  position: relative;
  z-index: 1;
}

/* ============================================
   BOOTSTRAP MODAL FIXES
   Ensure modals display correctly above all content
   ============================================ */

/* Modal backdrop - ensure it covers everything */
.modal-backdrop {
  z-index: 1040 !important;
}

/* Modal dialog - ensure it appears above backdrop */
.modal {
  z-index: 1055 !important;
}

/* Fix for modals inside main content area with stacking context */
.modal.show {
  display: block !important;
}

.modal-dialog {
  z-index: 1056 !important;
  position: relative;
}

/* Ensure modal content is visible */
.modal-content {
  position: relative;
  z-index: 1057;
}

/* ============================================
   WEATHER PAGE CALLOUT BOXES
   ============================================ */

/* Instructions callout - emphasized */
.alert h6.alert-heading {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

/* Weather item anchor offset for fixed header */
[id^="item-"] {
  scroll-margin-top: 100px;
}

/* Details/summary styling for full text toggle */
details summary {
  cursor: pointer;
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details[open] summary .bi-chevron-down {
  transform: rotate(180deg);
}

details summary .bi-chevron-down {
  transition: transform 0.2s ease;
}

/* Pre-formatted text for raw NWS products */
.weather-raw-text {
  font-family: inherit;
  font-size: 0.875rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 0.375rem;
  max-height: 400px;
  overflow-y: auto;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Skip link for screen readers */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--bs-primary);
  color: white;
  padding: 8px;
  z-index: 100;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   PULSE ANIMATION (for "TONIGHT" badge etc.)
   ============================================ */

.pulse-animation {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(25, 135, 84, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(25, 135, 84, 0);
  }
}

/* ============================================
   FOOTER BUTTON STYLING
   ============================================ */

/* Custom footer button - no border, light text */
.btn-footer {
  background-color: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.btn-footer:hover,
.btn-footer:focus {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Style the Givebutter footer widget to match the Contact Us button */
.givebutter-footer-widget {
  display: inline-flex;
  align-items: center;
}

/* Override Givebutter widget button styling */
.givebutter-footer-widget givebutter-widget {
  --givebutter-button-bg: transparent !important;
  --givebutter-button-border: none !important;
  --givebutter-button-color: rgba(255, 255, 255, 0.85) !important;
}

/* Target the actual button rendered by Givebutter */
.givebutter-footer-widget button,
.givebutter-footer-widget .gb-widget-button,
.givebutter-footer-widget [class*="givebutter"] button {
  background-color: transparent !important;
  border: none !important;
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 0.875rem !important;
  padding: 0.375rem 0.75rem !important;
  border-radius: 0.25rem !important;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out !important;
}

.givebutter-footer-widget button:hover,
.givebutter-footer-widget .gb-widget-button:hover,
.givebutter-footer-widget [class*="givebutter"] button:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}
