/* Import Google Fonts - Playfair Display for headings, Source Sans 3 for body text */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Source+Sans+3:wght@300;400;600;700&display=swap');

/* Color variables - change these to update colors across the whole site */
:root {
  --navy: #0A2342;
  --red: #BF1722;
  --gold: #C9A84C;
  --white: #FFFFFF;
  --offwhite: #F7F6F2;
  --lightgray: #E8E8E8;
  --midgray: #9A9A9A;
  --darkgray: #333333;
  --green: #1A7A3C;
}

/* Remove default browser spacing and use border-box sizing on everything */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Source Sans 3', sans-serif;
  color: var(--darkgray);
  min-height: 100vh;
}

/* Screen-reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* PATRIOTIC BACKGROUND */
/* Fixed behind everything else, not clickable */
.patriotic-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Red horizontal stripes */
.patriotic-bg .stripe {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg,
      rgba(221, 14, 27, 0.04) 0px,
      rgba(215, 13, 27, 0.06) 48px,
      transparent 48px,
      transparent 96px);
}

/* Faint patriotic quotes in the corners */
.patriotic-bg .quote {
  position: absolute;
  font-family: 'Playfair Display', serif;
  font-size: 13px;
  font-style: italic;
  color: rgba(113, 113, 113, 0.33);
  max-width: 240px;
  line-height: 1.5;
  user-select: none;
}

/* Faint gold stars on the sides */
.patriotic-bg .stars {
  position: absolute;
  font-size: 11px;
  color: rgba(201, 168, 76, 0.18);
  letter-spacing: 6px;
  user-select: none;
}


/* TOP NAVIGATION BAR */
.top-nav {
  background: var(--white);
  border-bottom: 2px solid var(--lightgray);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  /* Stays at the top when the user scrolls */
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(10, 35, 66, 0.06);
}

/* Site name / logo on the left */
.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  color: var(--navy);
  font-weight: 700;
  padding: 16px 0;
  text-decoration: none;
}

/* Tab container */
.nav-tabs {
  display: flex;
}

/* Each individual navigation tab */
.nav-tab {
  padding: 18px 26px;
  font-size: 13px;
  font-weight: 600;
  color: var(--midgray);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}

.nav-tab:hover {
  color: var(--navy);
}

/* The current page tab gets a navy underline */
.nav-tab.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
}

/* User icon button on the right */
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: 'Source Sans 3', sans-serif;
  transition: background 0.2s;
}

.nav-user:hover {
  background: var(--offwhite);
}

.nav-user svg {
  width: 28px;
  height: 28px;
  color: var(--navy);
}

.nav-user span {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.theme-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1.5px solid var(--lightgray);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.theme-btn:hover,
.theme-btn:focus-visible {
  background: var(--offwhite);
  border-color: var(--navy);
  box-shadow: 0 8px 20px rgba(10, 35, 66, 0.12);
  outline: none;
}

.theme-btn-icon {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
  color: var(--navy);
  transition: color 0.2s;
}

.theme-btn-icon.is-dark {
  color: #88a9d6;
}

.theme-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 170px;
  display: none;
  flex-direction: column;
  padding: 8px;
  border: 1px solid var(--lightgray);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 16px 36px rgba(10, 35, 66, 0.14);
  z-index: 150;
}

.theme-menu.open {
  display: flex;
}

.theme-menu button {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--navy);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.theme-menu button:hover,
.theme-menu button:focus-visible {
  background: var(--offwhite);
  color: var(--red);
  outline: none;
}

.theme-floating {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 220;
}


/* MAIN PAGE CONTENT AREA */
.page-content {
  padding: 44px 52px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  /* Sits on top of the background */
}

/* Large heading at the top of each page with a red left border */
.page-title {
  position: relative;
  left: 18%;
  bottom: 20px;
  font-family: 'Playfair Display', serif;
  font-size: clamp(24px, 3vw, 40px);
  /* Scales between 24px and 40px based on screen width */
  color: var(--navy);
  margin-bottom: 28px;
  border-left: 5px solid var(--red);
  padding-left: 18px;
}

body.dark-mode {
  background: #0d1522;
  color: #e6edf8;
}

body.dark-mode .patriotic-bg .stripe {
  background: repeating-linear-gradient(0deg,
      rgba(136, 169, 214, 0.05) 0px,
      rgba(136, 169, 214, 0.08) 48px,
      transparent 48px,
      transparent 96px);
}

body.dark-mode .patriotic-bg .quote {
  color: rgba(230, 237, 248, 0.18);
}

body.dark-mode .patriotic-bg .stars {
  color: rgba(201, 168, 76, 0.14);
}

body.dark-mode .top-nav {
  background: #111b2b;
  border-bottom-color: #24354d;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.28);
}

body.dark-mode .nav-logo,
body.dark-mode .nav-tab,
body.dark-mode .nav-user span,
body.dark-mode .nav-user svg,
body.dark-mode .page-title,
body.dark-mode .popup h3,
body.dark-mode .popup-close,
body.dark-mode .form-group label,
body.dark-mode .btn-backToLogin {
  color: #e6edf8;
}

body.dark-mode .nav-tab:hover {
  color: #ffffff;
}

body.dark-mode .nav-tab.active {
  color: #ffffff;
  border-bottom-color: #88a9d6;
}

body.dark-mode .nav-user:hover {
  background: rgba(255, 255, 255, 0.06);
}

body.dark-mode .theme-btn {
  background: #132033;
  border-color: #2a3a50;
}

body.dark-mode .theme-btn:hover,
body.dark-mode .theme-btn:focus-visible {
  background: #1a2a42;
  border-color: #88a9d6;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

body.dark-mode .theme-menu {
  background: #132033;
  border-color: #2a3a50;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
}

body.dark-mode .theme-menu button {
  color: #e6edf8;
}

body.dark-mode .theme-menu button:hover,
body.dark-mode .theme-menu button:focus-visible {
  background: rgba(136, 169, 214, 0.14);
  color: #ffffff;
}

body.large-text .nav-logo {
  font-size: 20px;
}

body.large-text .nav-tab {
  font-size: 15px;
}

body.large-text .nav-user span {
  font-size: 16px;
}

body.large-text .theme-menu button {
  font-size: 18px;
}


/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Source Sans 3', sans-serif;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.7;
  cursor: default;
  transform: none !important;
}

/* Navy filled button */
.btn-primary {
  background: var(--navy);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  background: #0d2d57;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(10, 35, 66, 0.2);
}

/* Outlined button */
.btn-secondary {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
}

.btn-secondary:hover {
  background: var(--red);
  color: var(--white);
}

/* Red button - used for destructive actions like delete */
.btn-red {
  background: var(--red);
  color: var(--white);
}

.btn-red:hover:not(:disabled) {
  background: #a01320;
  transform: translateY(-1px);
}

/* Green button - used for saving / confirming */
.btn-green {
  background: var(--green);
  color: var(--white);
}

.btn-green:hover:not(:disabled) {
  background: #155e30;
  transform: translateY(-1px);
}

/* Gray button - used for neutral actions like edit */
.btn-gray {
  background: #555;
  color: var(--white);
}

.btn-gray:hover {
  background: #333;
}

.btn-block {
  width: 100%;
}

.btn-backToLogin {
  position: relative;
  left: 125px;
  margin-top: 16px;
  font-size: 16px;
  color: var(--navy);
  text-decoration: underline;
  background: none;
}

body.dark-mode .btn-primary {
  background: #88a9d6;
  color: #0d1522;
}

body.dark-mode .btn-primary:hover:not(:disabled) {
  background: #9bb7dd;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
}

body.dark-mode .btn-secondary {
  color: #e6edf8;
  border-color: #88a9d6;
}

body.dark-mode .btn-secondary:hover {
  background: #88a9d6;
  color: #0d1522;
}

body.large-text .btn {
  font-size: 18px;
}

body.large-text .page-title {
  font-size: clamp(32px, 4vw, 54px);
}

body.large-text .form-group label {
  font-size: 14px;
}

/* Makes a button full width */
.btn-sm {
  padding: 8px 18px;
  font-size: 13px;
  border-radius: 6px;
}

/* Smaller button size */


/* FORM INPUTS */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--lightgray);
  border-radius: 8px;
  font-size: 15px;
  font-family: 'Source Sans 3', sans-serif;
  color: var(--darkgray);
  background: var(--offwhite);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

/* Highlight the input the user is currently typing in */
.form-group input:focus,
.form-group select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(10, 35, 66, 0.08);
  background: var(--white);
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode textarea,
body.dark-mode input[type="date"],
body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="password"],
body.dark-mode input[type="number"],
body.dark-mode input[type="tel"] {
  background: #1a2a42;
  border-color: #2a3a50;
  color: #e6edf8;
}

body.dark-mode .form-group input::placeholder,
body.dark-mode .form-group select::placeholder,
body.dark-mode textarea::placeholder {
  color: #9fb0c7;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group select:focus,
body.dark-mode textarea:focus {
  border-color: #88a9d6;
  box-shadow: 0 0 0 3px rgba(136, 169, 214, 0.16);
  background: #21344e;
}

body.large-text .form-group input,
body.large-text .form-group select,
body.large-text textarea {
  font-size: 18px;
}


/* POPUPS */
/* The dark semi-transparent background that covers the page when a popup is open */
.overlay {
  display: none;
  /* Hidden by default */
  position: fixed;
  inset: 0;
  background: rgba(10, 35, 66, 0.5);
  z-index: 500;
  align-items: center;
  justify-content: center;
}

/* Adding the "open" class to .overlay makes the popup appear */
.overlay.open {
  display: flex;
}

/* The white box centered on screen inside the popup */
.popup {
  background: var(--white);
  border-radius: 16px;
  padding: 48px;
  max-width: 460px;
  width: 90%;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
  position: relative;
  animation: fadeUp 0.25s ease;
  /* Plays the slide-up animation below */
}

body.dark-mode .overlay {
  background: rgba(3, 8, 15, 0.72);
}

body.dark-mode .popup {
  background: #132033;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

body.large-text .popup h3 {
  font-size: 32px;
}

/* Slide-up animation when a popup opens */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: scale(0.93) translateY(12px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* The X close button in the top right corner of every popup */
.popup-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 22px;
  cursor: pointer;
  color: var(--midgray);
  background: none;
  border: none;
  transition: color 0.2s;
}

.popup-close:hover {
  color: var(--red);
}

/* Heading inside a popup */
.popup h3 {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  color: var(--navy);
  text-align: center;
  margin-bottom: 28px;
}


/* IMAGE PLACEHOLDER BOXES */
/* Gray boxes used wherever a real photo will eventually go */
.img-placeholder {
  border: 1.5px solid var(--lightgray);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(10, 35, 66, 0.05), rgba(191, 23, 34, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}

.img-placeholder svg {
  opacity: 0.22;
}

.img-placeholder span {
  font-size: 12px;
  color: var(--midgray);
  font-weight: 600;
}

body.dark-mode .img-placeholder {
  border-color: #2a3a50;
  background: linear-gradient(135deg, rgba(36, 56, 87, 0.9), rgba(18, 29, 46, 0.96));
}

body.dark-mode .img-placeholder span {
  color: #b6c4d8;
}


/* ── MOBILE / SMALL SCREEN ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .page-content {
    padding: 24px 20px;
  }

  .top-nav {
    padding: 0 16px;
  }

  .nav-tab {
    padding: 16px 14px;
    font-size: 11px;
  }

  .nav-right {
    gap: 8px;
  }

  .theme-btn {
    width: 40px;
    height: 40px;
  }

  .theme-menu {
    min-width: 160px;
  }

  .theme-floating {
    top: 14px;
    right: 14px;
  }
}
