/* =======================================================
   GLOBAL BASE STYLES
   ======================================================= */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Cantarell, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #ffffff;
  color: #111827;
  overflow-x: hidden;
  overflow-y: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* =======================================================
   HEADER (FIXED)
   ======================================================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: #ffffff;
  border-bottom: 1px solid #d1d5db;
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.site-header h1 {
  font-family: poppins, montserrat, sans-serif;
  margin: 0;
  display: flex;
  align-items: center;
}

.logo-a {
  width: 270px;
  height: auto;
  position: relative;
}

@media (min-width: 769px) {
  .site-header {
    justify-content: flex-start;
    padding-left: 1rem;
  }
}

/* =======================================================
   LAYOUT WRAPPER & MAIN CONTENT AREA
   ======================================================= */
.layout {
  display: flex;
  width: 100%;
  margin-top: 80px;
  height: calc(100vh - 80px);
}

.main-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

#main {
  flex: 1;
  padding: 16px;
  min-width: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  margin-right: -265px;
  padding-right: 275px;
}

/* =======================================================
   SIDE NAVIGATION AREAS
   ======================================================= */
.sidenav,
.rightnav {
  overflow-y: auto;
  height: 100%;
  background-color: #ffffff;
  color: #111827;
  display: flex;
  flex-direction: column;
  padding: 1rem 0 1rem 2rem;
  box-sizing: border-box;
  scrollbar-width: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.sidenav { width: 275px; gap: 12px; }
.rightnav { width: 265px; gap: 10px; position: relative; left: -16px; }

.sidenav:hover,
.rightnav:hover { scrollbar-width: thin; }

.sidenav a,
.rightnav a {
  display: flex;
  align-items: center;
  font-size: 15px;
  text-decoration: none;
  color: inherit;
  width: 100%;
  border-radius: 6px;
  padding: 6px 8px;
  gap: 14px !important;
}

.sidenav a img,
.rightnav a img {
  width: 24px;
  height: 24px;
}

.dodo-icon {
  width: 32px !important;
  height: 32px !important;
  margin-right: -4px;
  margin-left: -4px;
}

.sidenav a:hover,
.rightnav a:hover {
  background-color: #e5e7eb;
}

.sidenav hr {
  border: none;
  border-top: 1px solid #d1d5db;
  margin: 12px -1rem;
  width: 100%;
}

/* =======================================================
   TOAST / FEEDBACK POPUPS
   ======================================================= */
#form-message {
  position: fixed;
  top: 35rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  pointer-events: none;
}

#form-message > div { pointer-events: auto; }

/* =======================================================
   MOBILE MENU & HAMBURGER
   ======================================================= */
.hamburger {
  display: none;
  background-color: #1b1b32;
  color: white;
  width: 100%;
  text-align: center;
  padding: 14px 0;
  font-size: 1.2rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  z-index: 1999;
}

/* Mobile mode */
@media (max-width: 768px) {

  .hamburger {
    display: block;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
  }

  .mobile-nav {
    display: none;
    background: #ffffff;
    padding: 1.2rem 1rem 2rem 1rem;
    border-top: 1px solid #e5e7eb;
    position: fixed;
    top: calc(80px + 48px);
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  .mobile-nav.show { display: block; }

  /* Mobile scrollbar */
  ::-webkit-scrollbar {
    width: 6px !important;
  }
  ::-webkit-scrollbar-thumb {
    background: #9ca3af !important;
    border-radius: 3px;
  }
}

/* Desktop hides mobile elements */
@media (min-width: 769px) {
  .hamburger,
  .mobile-nav { 
    display: none !important; 
  }
}

/* =======================================================
   MOBILE MENU — ITEMS, ICONS, HEADERS
   ======================================================= */

@media (max-width: 768px) {

  .mobile-nav ul {
    padding: 0;
    margin: 0;
    list-style: none;
  }

  .mobile-nav li { margin-bottom: 0.4rem; }

  .mobile-nav a {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 12px 6px;
    font-size: 16px;
    font-weight: 500;
    color: #1f2937;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.15s ease;
  }

  .mobile-nav a:hover {
    background-color: #f3f4f6;
  }

  .mobile-nav a img {
    width: 24px !important;
    height: 24px !important;
    object-fit: contain;
  }

  .mobile-nav a .dodo-icon {
    width: 32px !important;
    height: 32px !important;
    object-fit: contain;
  }

  .mobile-nav p {
    margin-top: 1.4rem;
    margin-bottom: 0.5rem;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #6b7280;
    text-transform: uppercase;
  }

  .mobile-nav hr {
    border: none;
    border-top: 1px solid #d1d5db;
    margin: 14px 0;
  }
}

/* =======================================================
   OFFENDERS LIST — MOBILE
   ======================================================= */
@media (max-width: 768px) {

  #offenders-list li {
    display: block !important;
    padding: 1rem !important;
    margin-bottom: 0.75rem !important;
    background: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
  }

  #offenders-list li .col-span-1,
  #offenders-list li .col-span-2 {
    display: block !important;
    width: 100% !important;
    margin-bottom: 0.5rem !important;
  }

  #offenders-list li .col-span-1:first-child {
    font-weight: bold !important;
    font-size: 1.1rem !important;
    color: #ed1c24 !important;
  }
}

/* =======================================================
   TABLE HEADERS — RESPONSIVE
   ======================================================= */
.desktop-offender-header { display: grid; }
.offender-header-row { display: none; }

@media (max-width: 768px) {
  .desktop-offender-header { display: none !important; }
  .offender-header-row {
    display: flex !important;
    flex-direction: column;
    gap: 0.5rem;
    background: #fff;
    border-bottom: 1px solid #d1d5db;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
  }
}

/* =======================================================
   RESPONSIVE BREAKPOINTS
   ======================================================= */
@media (max-width: 1024px) {
  .sidenav,
  .rightnav,
  .scrollbar-spacer { display: none !important; }

  #main {
    padding-right: 1rem !important;
    margin-right: 0 !important;
  }
}

@media (max-width: 768px) {

  html, body {
    overflow-y: auto;
    height: auto;
  }

  .layout {
    flex-direction: column;
    height: auto;
    margin-top: calc(80px + 48px);
  }

  #main {
    overflow-y: auto;
    padding: 1rem;
    margin-right: 0;
  }

  #offender-form {
    flex-direction: column !important;
  }

  #offender-form > * {
    width: 100% !important;
    margin-bottom: 0.75rem;
  }
}

@media (max-width: 480px) {
  #main { padding: 0.5rem; }
}

/* =======================================================
   CRITERIA LINK MOBILE FIX
   ======================================================= */
@media (max-width: 640px) {
  .criteria-link-mobile-fix {
    position: static !important;
    margin-top: 4px;
    margin-left: 2px;
    display: inline-block;
  }
}

@media (min-width: 769px) {
  .sidenav {
    padding-top: 30px !important;
  }
}

/* =======================================================
   HERO & DESCRIPTION
   ======================================================= */
#hero { margin-top: 0.5rem; }

#description { padding-top: 2rem; }

.tagline {
  font-family: montserrat, Cantarell, sans-serif;
  font-size: .82rem;
  font-weight: 600;        /* bold */
  letter-spacing: 3px;
  margin-top: 7px;
}

#hero p {
  max-width: 48rem;
}

/* Universal page section wrapper */
.page-section {
  max-width: 48rem;       /* ~4xl */
  margin-left: auto;
  margin-right: auto;
  padding-top: 1.5rem;    /* pt-6 */
  padding-bottom: 2.5rem; /* optional but keeps vertical consistency */
  padding-left: 1.5rem;   /* px-6 */
  padding-right: 1.5rem;
}

/* Universal page title */
.page-title {
  color: #1D2D47;
  text-align: center;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;  /* mb-6 */
  font-size: 1.875rem;    /* text-3xl */
}

@media (min-width: 640px) {
  .page-title {
    font-size: 2.25rem;  /* text-4xl */
  }
}
