/* Show/hide content based on sign-in state */
.nm-signatory { display: none; }
.nm-guest { display: none; }
body.nm-has-record .nm-signatory { display: block !important; }
body.nm-has-record .nm-guest { display: none !important; }
body:not(.nm-has-record) .nm-signatory { display: none !important; }
body:not(.nm-has-record) .nm-guest { display: block !important; }
/* Modal backdrop and content for nm.edit() */
.nm-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nm-modal-content {
  background: #fff;
  padding: 2em;
  border-radius: 16px;
  max-width: 90%;
  box-shadow: 0 2px 24px #0002;
  position: relative;
}
/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
  --primary: #001060;
  --secondary: #d32f2f;
  --white: #fff;
  --gray: #a6a6a6;
  --primary-highlight: #e3f2fd;
}

/* ==========================================================================
   Global Styles
   ========================================================================== */

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--primary);
  position: relative;
  overflow-x: hidden;
}

body.mobile-nav-active {
  overflow: hidden;
}

.muted, .text-muted {
  color: var(--gray) !important;
}

/* Typography */
h1, h2 {
  font-family: 'Mrs Saint Delafield', cursive
}

h1 { font-size: 3em }
h2 { font-size: 3em }
h3 { font-size: 1.75em }
h4 { font-size: 1em }
h5 { font-size: 0.75em }
h6 { font-size: .75em }

/* Links */
a, a:visited {
  color: var(--white);
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

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

/* Standardize link colors by section */
/* Leftbar links: always white */
.leftbar a,
.leftbar a:visited,
.leftbar a:hover,
.leftbar a:active {
  color: var(--white) !important;
  text-decoration: none;
  transition: color 0.2s;
}

/* Main section links: always secondary */
.main a,
.main a:visited,
.main a:hover,
.main a:active {
  color: var(--secondary) !important;
  text-decoration: underline;
  transition: color 0.2s;
}

/* ==========================================================================
   Background Video
   ========================================================================== */

.background-video-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
}

.background-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
}

.background-filter {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(1, 10, 43, 1);
  mix-blend-mode: hard-light;
  pointer-events: none;
}

/* ==========================================================================
   Header and Navigation
   ========================================================================== */

.site-header-nav {
  background-color: var(--primary);
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 12px rgba(0, 0, 3, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 10;
}

.site-nav {
  display: block;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.site-nav a {
  color: var(--white);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.site-nav a:hover {
  opacity: 1;
}

.site-nav .current-page a {
  font-weight: 700;
  opacity: 1;
}

.hamburger-menu {
  display: none;
  background: var(--white);
  border: none;
  padding: 0.5rem;
  border-radius: 5px;
  cursor: pointer;
}

.hamburger-menu i {
  font-size: 1.5rem;
  color: var(--primary);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.layout {
  display: flex;
  min-height: 100vh
}

.leftbar {
  background: transparent;
  color: var(--white);
  width: 24vw;
  min-width: 40%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1rem;
  text-align: center;
}

.main {
  flex: 1;
  padding: 2rem;
  background: var(--white);
}

.section-underline {
  width: 100%;
  height: 2px;
  background: var(--secondary);
  margin: -.5em auto 1em;
  border-radius: 2px
}

/* ==========================================================================
   Leftbar Content
   ========================================================================== */

#logo {
  max-width: 150px;
  margin-bottom: 2rem;
  filter: drop-shadow(5px 5px 5px rgba(0, 0, 0, 0.5));
}
/* Logo SVG link fix */
.logo-title a[href="/"], aside.leftbar a[href="/"] {
  display: block;
  width: fit-content;
  margin: 0 auto;
}
.logo-title a[href="/"] svg, aside.leftbar a[href="/"] svg {
  display: block;
  width: 120px;
  height: auto;
  margin: 0 auto;
}

.leftbar h1 {
  font-size: 2.5rem;
  margin-bottom: 0;
  letter-spacing: 2px;
  margin-top: -1.5rem
}

.movement-tagline {
  text-align: center;
  margin-bottom: .5em
}

.declaration-count {
  font-weight: 700
}

/* Principles List */
.principles-list {
  list-style: none;
  padding: 0 1.5rem;
  margin-top: 2rem;
  text-align: center;
}

.principles-list li {
  margin-bottom: 2rem
}

.principle-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  color: var(--primary);
  font-weight: 700;
  border-radius: 50%;
  width: 2em;
  height: 2em;
  line-height: 2em;
  font-size: 1.5em;
  margin-bottom: .8em;
  box-shadow: 0 2px 8px #00000014
}

.principle-text {
  font-size: 1.1em;
  font-weight: 500;
  text-align: center;
}

.principle-title {
  display: block;
  font-weight: 700;
  font-size: 1.15em;
  margin-bottom: 0;
  line-height: 4px
}

.principle-desc {
  display: block;
  font-size: .95em;
  font-weight: 400;
  color: #e0e0e0;
  margin-top: .5em
}

.principle-action {
  display: block;
  color: #1976d2;
  font-size: .95em;
  font-weight: 400;
  margin-top: .5em;
}

/* Manifest Statistics */
.stats-toggle {
  display: none;
}

.manifest-statistics {
  margin-top: 1.5rem;
}

.widget {
  margin-bottom: 1.5rem;
  text-align: center;
}

.widget-title,
.widget-statistic-label {
  font-family: 'Segoe UI', Arial, sans-serif;
  opacity: 0.8;
}

.widget-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.widget-row {
  display: flex;
  gap: 1rem;
}

.widget-col {
  flex: 1;
}

.widget-statistic-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}

.widget-statistic-label {
  font-size: 0.9rem;
  color: #e0e0e0;
}

.user-specific {
  display: none;
}

/* Widget Charts and Maps */
#map-container {
  position: relative;
  padding-bottom: 65%; /* Aspect ratio for the map */
  height: 0;
}

#map-container svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.datamaps-hoverover, .hoverinfo {
  background: var(--white);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 5px;
  padding: 5px;
  font-family: 'Segoe UI', Arial, sans-serif;
}

#signers-chart {
  max-height: 150px;
}

/* ==========================================================================
   Main Content Sections
   ========================================================================== */

#declare-section {
  margin-bottom: 20px;
}

/* Declare Form */
.declare-form {
  max-width: 400px;
  margin: auto;
  background: var(--white);
  border-radius: 1.25em;
  box-shadow: 0 2px 22px 0 #1f2a5d70;
  padding: 2em 2em 1.5em 2em;
  border: 1px solid #eee;
}

/* Override Bootstrap margin-bottom for form-labels */
.form-label {
  margin-bottom: 0 !important;
}

.btn-declare {
  background-color: var(--secondary) !important;
  border: none;
  color: var(--white) !important;
  font-size: 2em;
  font-family: 'Mrs Saint Delafield', cursive;
  padding-top: 0.3em;
  padding-bottom: 0em;
}

.btn-declare:hover, .btn-declare:focus {
  background-color: var(--primary) !important;
  color: var(--white) !important;
}

.declare-disclaimer {
  color: #888;
  font-size: .95em;
  text-align: center;
  margin-top: 1em;
  width: 80%;
  margin-left: auto;
  margin-right: auto;
}

/* Post Submission Section */
.whats-next-section {
  margin-top: 2.5em;
  margin-bottom: 2em;
}

.social-icons {
  display: flex;
  gap: 1.2em;
  justify-content: center;
  margin-bottom: 1.5em;
}

.social-icon {
  font-size: 48px;
  color: var(--primary);
  vertical-align: middle;
  transition: transform 0.2s;
}

.social-icon:hover {
  transform: scale(1.15);
  color: var(--secondary);
}

.about-section {
  margin-top: 2.5em
}

/* Why Sign Section */
.why-sign-highlight {
  background: var(--primary);
  background-image: url('/img/flag-background.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  color: #fff;
  border-radius: 1em;
  padding: 1.25em 1.5em;
  margin: 1.5em 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.why-sign-highlight .why-sign-list {
  margin-bottom: 0;
}

/* ==========================================================================
   Manifest Preview Table
   ========================================================================== */

.manifest-row-preview-outer {
  margin: 0;
  background: none;
}

.manifest-row-preview {
  background: none !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  clip-path: inset(15% 0 15% 0);
}

.manifest-preview-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--white);
  border-radius: 0;
  margin: 0;
  box-shadow: none;
  table-layout: auto;
}

.manifest-preview-table tr {
  height: 3.2em;
}

.manifest-preview-table td {
  border: none;
  padding: 0.5em 1em;
  vertical-align: middle;
  background: none;
  min-width: 0;
  overflow: hidden;
}

.manifest-preview-number {
  text-align: center;
  white-space: nowrap;
  width: 1%;
}

.manifest-preview-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2em;
  height: 2.2em;
  padding: 0 0.7em;
  border-radius: 1.1em;
  background: var(--secondary) !important;
  color: var(--white);
  border: none !important;
  font-weight: bold;
  font-size: 1.25em;
  box-shadow: 0 1px 4px rgba(0,0,30,0.08);
  background-clip: padding-box;
  transition: min-width 0.2s, padding 0.2s;
}

.manifest-preview-name {
  font-variant: small-caps;
  font-family: 'Georgia', 'Times New Roman', Times, serif;
  font-weight: 600;
  color: var(--primary);
  font-size: 1.13em;
  letter-spacing: 0.04em;
}

.manifest-preview-location {
  color: var(--secondary);
  font-size: 1em;
  font-weight: 500;
}

.manifest-preview-date {
  color: #555;
  font-size: 0.98em;
  font-weight: 500;
  white-space: nowrap;
}

.manifest-preview-date .fa-feather {
  color: var(--secondary);
  margin-right: 0.4em;
}

.manifest-preview-view {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}

.manifest-preview-row-faded td {
  background: #b3b6b9 !important;
  filter: grayscale(0.9) brightness(1.3) blur(1.4px);
  opacity: 0.75;
  pointer-events: none;
}

.manifest-preview-circle-faded {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2em;
  height: 2.2em;
  padding: 0 0.7em;
  border-radius: 1.1em;
  background: none !important;
  color: #8a8d94 !important;
  border: 2px solid transparent;
  font-weight: bold;
  font-size: 1.25em;
  box-shadow: none;
  transition: min-width 0.2s, padding 0.2s;
}

.btn-manifest-search,
.btn-manifest-edit {
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 0.5em;
  padding: 0.35em 0.8em;
  font-size: 1em;
  font-weight: 600;
  margin-right: 0.5em;
  margin-left: 0;
  transition: background 0.15s, color 0.15s;
}

.btn-manifest-search:last-child,
.btn-manifest-edit:last-child {
  margin-right: 0;
}

.btn-manifest-edit {
  margin-left: 0.1em;
}

.btn-manifest-search:hover,
.btn-manifest-edit:hover {
  background: var(--secondary);
  color: var(--white);
}

/* ==========================================================================
   Manifest Viewer Styles (for manifest.html)
   ========================================================================== */

.manifest-viewer-section {
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
}

.manifest-title {
  color: var(--primary);
}

.manifest-divider {
  border: none;
  border-top: 2px solid var(--primary);
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

.manifest-search-form .form-control {
  border-radius: 4px;
}

.manifest-btn {
  background: var(--primary) !important;
  color: var(--white) !important;
  border: none !important;
  border-radius: 4px !important;
  transition: background 0.2s;
}

.manifest-btn:hover, .manifest-btn:focus {
  background: #001060 !important;
  color: var(--white) !important;
}

.manifest-table {
  border-radius: 6px;
  overflow: hidden;
  --bs-table-bg: none;
}

.manifest-table thead tr {
  background: var(--primary) !important;
}

.manifest-table th.manifest-th {
  color: var(--white) !important;
  font-weight: 600;
  border: none !important;
}

.manifest-table td {
  vertical-align: middle;
  border: none !important;
}

.manifest-table td.manifest-id {
  color: var(--secondary) !important;
  font-weight: 600;
}

.manifest-table .manifest-name {
  font-variant: small-caps;
  font-family: 'Georgia', 'Times New Roman', Times, serif;
  font-weight: 600;
  color: var(--primary) !important;
}

.manifest-table tbody tr:nth-child(even) {
  background: #f5f5f5 !important;
}

.manifest-table tbody tr:nth-child(odd) {
  background: #e9e9e9 !important;
}

.manifest-table-container {
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.manifest-pagination-nav .pagination .page-link.manifest-btn {
  min-width: 36px;
  text-align: center;
  padding: 6px 12px;
}

.manifest-pagination-nav .form-select {
  min-width: 60px;
  display: inline-block;
  vertical-align: middle;
}

/* Manifest table: anonymous row styling */
tr.anonymous .manifest-name {
  color: #888 !important;
  font-style: italic;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  text-align: center;
  margin-top: 2em;
  padding: 2em 0 1em 0;
  background: none;
  border-top: 1px solid #eee;
}

.footer-smallcaps {
  font-variant: small-caps;
  font-size: 1.05em;
  letter-spacing: 0.04em;
  margin-bottom: 0.5em;
}

.footer-icon {
  font-size: 1.5em;
  color: --var(gray);
}

.footer-kansas {
  visibility: hidden;
  font-family: serif;
  font-size: 0.9em;
  color: --var(gray);
  margin-top: -7px;
  margin-bottom: 0.2em;
  padding: 0;
}

/* ==========================================================================
   Interactive Elements & Animations
   ========================================================================== */

/* Info Icons and Tooltips */
.info-icon {
  color: #bbb !important;
  font-size: 1em;
  cursor: pointer;
  margin-left: 0.3em;
  vertical-align: middle;
}

/* Bootstrap tooltip custom styling */
.tooltip-inner {
  color: --var(--white);
  background-color: var(--primary);
  font-size: 1.08em;
  padding: 0.7em 1em;
  border-radius: 0.4em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.bs-tooltip-auto[x-placement^=top] .arrow::before, .bs-tooltip-top .arrow::before {
  border-top-color: #fff !important;
}

/* Feather Icon Animation */
.btn-declare .fa-feather {
display: inline-block;
position: relative;
animation: feather-rock 2.2s ease-in-out infinite;
transform-origin: 15% 95%;
margin: -6px;
top: -6px;
font-size: 0.7em;
}

@keyframes feather-rock {
  0% { transform: rotate(-15deg); }
  10% { transform: rotate(-10deg); }
  20% { transform: rotate(-5deg); }
  30% { transform: rotate(0deg); }
  40% { transform: rotate(5deg); }
  50% { transform: rotate(15deg); }
  60% { transform: rotate(5deg); }
  70% { transform: rotate(0deg); }
  80% { transform: rotate(-5deg); }
  90% { transform: rotate(-10deg); }
  100% { transform: rotate(-15deg); }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 900px) {
  .site-header-nav {
    justify-content: flex-end;
    padding: 0;
  }
  
  .site-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    z-index: 1000;
    padding-top: 60px;
  }
  
  .site-nav.active {
    display: block;
  }
  
  .site-nav ul {
    flex-direction: column;
    gap: 0;
  }
  
  .site-nav li {
    border-bottom: 1px solid var(--primary);
  }
  
  .site-nav a {
    display: block;
    padding: 15px 20px;
    color: var(--primary);
    font-size: 1.2rem;
    text-decoration: none;
  }
  
  .site-nav .current-page a {
    color: var(--secondary);
    position: relative;
  }
  
  .site-nav .current-page a::before {
    content: '>';
    position: absolute;
    left: -15px;
    font-weight: 700;
  }
  
  .hamburger-menu {
    display: block;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1001;
  }
  
  .stats-toggle {
    display: block;
    color: var(--white);
    text-decoration: none;
    margin-top: 1rem;
    font-weight: 700;
  }
  
  .manifest-statistics {
    display: none;
  }
  
  .manifest-statistics.expanded {
    display: block;
  }
  
  .layout {
    flex-direction: column;
  }
  
  .leftbar {
    width: 100%;
    min-width: unset;
    align-items: center;
    padding: 2rem 1rem;
  }
  
  .main {
    padding: 1rem;
  }
}

#nm-edit-id {
  color: var(--secondary)
}

@media (max-width: 700px) {
  .manifest-preview-table td {
    padding: 0.4em 0.5em;
    font-size: 0.98em;
  }
  .manifest-preview-view {
    width: 2.5em;
  }
}
