/*
 * GDGPS Custom Styles
 * Modern redesign following JPL guidelines
 * Based on Bootstrap 5.3.2
 */

/* ===================================
   CSS VARIABLES
   =================================== */
:root {
  /* JPL Color Palette */
  --jpl-blue: #1F4798;
  --nasa-blue: #0B3D91;
  --light-blue: #DAE3F5;
  --success-green: #277F14;
  --text-gray: #333333;
  --link-blue: #003399;
  --border-gray: #CCCCCC;

  /* Spacing */
  --section-spacing: 3rem;
  --content-spacing: 1.5rem;

  /* Typography */
  --base-font-size: 16px;
  --heading-font-weight: 700;
  --body-font-weight: 400;
}

/* ===================================
   GLOBAL RESETS & BASE STYLES
   =================================== */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji",
               "Segoe UI Emoji", "Segoe UI Symbol";
  font-size: var(--base-font-size);
  font-weight: var(--body-font-weight);
  line-height: 1.6;
  color: var(--text-gray);
  background-color: #ffffff;
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
}

/* ===================================
   TYPOGRAPHY
   =================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--heading-font-weight);
  color: var(--jpl-blue);
  line-height: 1.2;
  margin-top: 0;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5, h6 {
  font-size: 1rem;
}

p {
  margin-bottom: 1rem;
}

.lead {
  font-size: 1.125rem;
  font-weight: 300;
}

a {
  color: var(--link-blue);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

a:hover {
  color: var(--nasa-blue);
  text-decoration: underline;
}

a:focus {
  outline: 2px solid var(--jpl-blue);
  outline-offset: 2px;
}

/* ===================================
   JPL TOP BAR (Black Navigation - JPL Style)
   =================================== */
#jpl-topbar {
  background-color: #000000;
  padding: 0;
  font-size: 0.875rem;
  position: relative;
  z-index: 50;
}

#jpl-topbar .container-fluid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
}

#jpl-topbar .nasa-logo {
  height: 45px;
  width: auto;
}

#jpl-topbar .jpl-links {
  display: flex;
  align-items: center;
  gap: 0;
}

#jpl-topbar .jpl-links a {
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

#jpl-topbar .jpl-links a:hover {
  color: #ffffff;
  border-bottom-color: #D32F2F;
  text-decoration: none;
}

#jpl-topbar .jpl-links a.active {
  border-bottom-color: #D32F2F;
}

#jpl-topbar .nasa-portal-link {
  font-weight: 500;
}

/* ===================================
   GDGPS BRAND HEADER
   =================================== */
#gdgps-header {
  background-color: #ffffff;
  padding: 1rem 0;
  border-bottom: 2px solid var(--border-gray);
}

#gdgps-header .container-fluid {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gdgps-logo {
  height: 60px;
  width: auto;
}

.gdgps-title {
  color: var(--jpl-blue);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

/* ===================================
   BOOTSTRAP NAVBAR CUSTOMIZATION
   =================================== */
#main-navbar {
  background-color: var(--jpl-blue) !important;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  transition: background-color 0.2s, color 0.2s;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.navbar-dark .navbar-nav .nav-link.active {
  color: #ffffff;
  font-weight: 600;
}

.navbar-dark .navbar-nav .dropdown-menu {
  background-color: var(--light-blue);
  border: 1px solid var(--jpl-blue);
}

.navbar-dark .navbar-nav .dropdown-item {
  color: var(--text-gray);
  padding: 0.5rem 1.5rem;
  transition: background-color 0.2s;
}

.navbar-dark .navbar-nav .dropdown-item:hover {
  background-color: var(--jpl-blue);
  color: #ffffff;
}

.navbar-toggler {
  border-color: rgba(255, 255, 255, 0.3);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

/* ===================================
   HERO BANNER SECTION
   =================================== */
.hero-banner {
  width: 100%;
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
}

.hero-banner img {
  width: 100%;
  height: auto;
  display: block;
}

/* Full bleed hero - no container padding */
.hero-banner-container {
  padding: 0;
  margin: 0;
  max-width: 100%;
}

/* ===================================
   MAIN CONTENT AREA
   =================================== */
#main-content {
  padding-top: 2rem;
  padding-bottom: 2rem;
  min-height: 60vh;
}

.content-section {
  margin-bottom: var(--section-spacing);
}

.section-title {
  color: var(--jpl-blue);
  font-size: 1.75rem;
  font-weight: 700;
  border-bottom: 3px solid var(--jpl-blue);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.subsection-title {
  color: var(--nasa-blue);
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

/* ===================================
   PRODUCTS SIDEBAR (Desktop)
   =================================== */
.products-sidebar {
  position: sticky;
  top: 80px;
}

.products-card {
  background-color: var(--light-blue);
  border: 1px solid var(--jpl-blue);
  border-radius: 0.375rem;
  overflow: hidden;
}

.products-card-header {
  background-color: var(--jpl-blue);
  color: #ffffff;
  padding: 1rem;
}

.products-card-header h5 {
  color: #000000;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.4;
}

.products-card-header .text-success-green {
  color: #000000;
  font-weight: 700;
}

.products-card-body {
  padding: 1rem;
  max-height: 800px;
  overflow-y: auto;
}

.products-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.products-list li {
  margin-bottom: 0.75rem;
  position: relative;
  padding-left: 1rem;
}

.products-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--jpl-blue);
  font-weight: bold;
}

.products-list a {
  color: var(--link-blue);
  font-size: 0.9rem;
  line-height: 1.4;
}

.products-list a:hover {
  color: var(--nasa-blue);
  text-decoration: underline;
}

/* ===================================
   PRODUCTS ACCORDION (Mobile)
   =================================== */
.products-accordion {
  margin-top: 2rem;
}

.products-accordion .accordion-button {
  background-color: var(--jpl-blue);
  color: #ffffff;
  font-weight: 600;
}

.products-accordion .accordion-button:not(.collapsed) {
  background-color: var(--nasa-blue);
  color: #ffffff;
}

.products-accordion .accordion-button:focus {
  box-shadow: 0 0 0 0.25rem rgba(31, 71, 152, 0.25);
  border-color: var(--jpl-blue);
}

.products-accordion .accordion-body {
  background-color: var(--light-blue);
}

/* ===================================
   GLOBAL MAP SECTION
   =================================== */
.map-section {
  background-color: #f8f9fa;
  margin: var(--section-spacing) 0;
  padding: 0;
}

.map-title {
  background-color: #000000;
  color: #ffffff;
  text-align: center;
  padding: 0.75rem 1rem;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.map-container {
  padding: 2rem 1rem;
  text-align: center;
}

.map-image {
  width: 100%;
  height: auto;
  max-width: 800px;
  border: 1px solid var(--border-gray);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  cursor: pointer;
}

.map-image:hover {
  transform: scale(1.02);
}

.map-caption {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: #6c757d;
}

/* ===================================
   CARDS & COMPONENTS
   =================================== */
.card {
  border: 1px solid var(--border-gray);
  border-radius: 0.375rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card-header {
  background-color: var(--light-blue);
  border-bottom: 2px solid var(--jpl-blue);
  font-weight: 600;
  color: var(--jpl-blue);
}

/* ===================================
   BUTTONS
   =================================== */
.btn-primary {
  background-color: var(--jpl-blue);
  border-color: var(--jpl-blue);
  color: #ffffff;
  font-weight: 500;
  padding: 0.5rem 1.5rem;
  transition: background-color 0.2s, border-color 0.2s;
}

.btn-primary:hover {
  background-color: var(--nasa-blue);
  border-color: var(--nasa-blue);
}

.btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
}

.btn-outline-primary {
  color: var(--jpl-blue);
  border-color: var(--jpl-blue);
}

.btn-outline-primary:hover {
  background-color: var(--jpl-blue);
  border-color: var(--jpl-blue);
  color: #ffffff;
}

/* ===================================
   FOOTER (JPL Style - Complete)
   =================================== */
#gdgps-footer {
  margin-top: 4rem;
  background-color: #1a1a1a;
  color: #ffffff;
}

/* Footer Navigation Section */
.footer-navigation {
  background-color: #2c2c2c;
  border-top: 3px solid var(--jpl-blue);
}

.footer-nav-nasa-logo {
  filter: brightness(0) invert(1);
  margin-bottom: 1rem;
}

.footer-column-title {
  color: #5b9bd5;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.25rem 0;
  display: inline-block;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.footer-links a:hover {
  color: #5b9bd5;
  padding-left: 0.5rem;
  text-decoration: underline;
}

/* Footer Bottom Bar */
.footer-bottom-bar {
  background-color: #1a1a1a;
  border-top: 1px solid #333333;
  font-size: 0.875rem;
}

.footer-nasa-logo {
  filter: brightness(0) invert(1);
}

.footer-bottom-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: flex-start;
}

.footer-bottom-nav a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.footer-bottom-nav a:hover {
  color: #5b9bd5;
  text-decoration: underline;
}

.footer-site-info {
  color: #cccccc;
  font-size: 0.8rem;
}

.footer-site-info a {
  color: #ffffff;
  text-decoration: none;
}

.footer-site-info a:hover {
  color: #5b9bd5;
  text-decoration: underline;
}

.footer-site-info strong {
  color: #999999;
  font-weight: 600;
}

/* ===================================
   UTILITY CLASSES
   =================================== */
.text-jpl-blue {
  color: var(--jpl-blue);
}

.text-success-green {
  color: var(--success-green);
}

.bg-jpl-blue {
  background-color: var(--jpl-blue);
}

.bg-light-blue {
  background-color: var(--light-blue);
}

.border-jpl-blue {
  border-color: var(--jpl-blue);
}

.sticky-top-adjusted {
  position: sticky;
  top: 80px;
}

/* ===================================
   ACCESSIBILITY
   =================================== */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--jpl-blue);
  color: #ffffff;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

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

/* ===================================
   PRINT STYLES
   =================================== */
@media print {
  #jpl-topbar,
  #main-navbar,
  .products-sidebar,
  .products-accordion,
  #gdgps-footer {
    display: none;
  }

  body {
    font-size: 12pt;
    color: #000000;
  }

  a {
    text-decoration: underline;
    color: #000000;
  }

  h1, h2, h3, h4, h5, h6 {
    color: #000000;
    page-break-after: avoid;
  }

  img {
    max-width: 100%;
    page-break-inside: avoid;
  }
}
