/* ============================================================================
   Mulch Runner - Beechwood Band
   Typography: Graduate (main title only) + Montserrat (everything else)
   Headings: white, black, or red only
============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Graduate&family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  --crest-red: #cb2c30;
  --crest-red-dark: #a6242b;
  --light-steam: #ff9865;
  --dark-steam: #9d3b0a;
  --leaf: #233a1c;
  --cream: #faf6f0;
  --off-black: #1a1a1a;
  --border: #e0d9cd;
  --muted: #666;
  --soft: #888;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  min-height: 100%;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--cream);
  color: var(--off-black);
  font-weight: 500;
  line-height: 1.5;
}

/* Typography rules:
   - Graduate ONLY for main H1 (page titles)
   - Montserrat 800 for all other headings
   - Heading colors: white, black, or red ONLY */
h1.page-title {
  font-family: 'Graduate', serif;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--off-black);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--off-black);
}

a { color: var(--crest-red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================================
   Shared Components
============================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s;
  border: 2px solid var(--off-black);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--crest-red);
  color: white;
  box-shadow: 3px 3px 0 var(--off-black);
}

.btn-primary:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--off-black);
  text-decoration: none;
}

.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--off-black);
}

.btn-secondary {
  background: white;
  color: var(--off-black);
  box-shadow: 3px 3px 0 var(--off-black);
}

.btn-secondary:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--off-black);
  text-decoration: none;
}

.btn-secondary:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--off-black);
}

.btn-ghost {
  background: transparent;
  color: var(--off-black);
  border-color: transparent;
  box-shadow: none;
}

.btn-ghost:hover {
  background: #f0ebe0;
  text-decoration: none;
}

.btn-sm {
  padding: 0.5rem 0.875rem;
  font-size: 0.65rem;
}

.btn-full {
  width: 100%;
}

.btn-danger {
  background: white;
  color: var(--crest-red);
  border-color: var(--crest-red);
  box-shadow: 3px 3px 0 var(--crest-red);
}

.btn-danger:hover {
  background: var(--crest-red);
  color: white;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--crest-red-dark);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--off-black);
  margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--off-black);
  border-radius: 4px;
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  background: white;
  transition: all 0.15s;
  color: var(--off-black);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  box-shadow: 4px 4px 0 var(--crest-red);
  transform: translate(-2px, -2px);
}

.form-input.pin {
  text-align: center;
  letter-spacing: 0.5em;
  font-size: 1.5rem;
  font-weight: 800;
}

.form-textarea {
  min-height: 5rem;
  resize: vertical;
}

.form-error {
  background: #fdf0f0;
  color: var(--crest-red);
  border: 2px solid var(--crest-red);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.form-success {
  background: #f0faf0;
  color: #155724;
  border: 2px solid #28a745;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* ============================================================================
   Header / Logo
============================================================================ */

.site-header {
  background: var(--off-black);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 4px solid var(--crest-red);
  position: sticky;
  top: 0;
  z-index: 50;
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-mark:hover { text-decoration: none; }

.logo-shield {
  width: 36px;
  height: 42px;
  background: var(--crest-red);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Graduate', serif;
  color: white;
  font-size: 1.125rem;
  padding-bottom: 8px;
  flex-shrink: 0;
}

.logo-text {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: white;
  text-transform: uppercase;
}

.logo-text-sub {
  display: block;
  font-size: 0.65rem;
  color: var(--crest-red);
  margin-top: 2px;
  letter-spacing: 0.2em;
}

.nav-pills {
  display: flex;
  gap: 0.25rem;
}

.nav-pill {
  padding: 0.5rem 1rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: white;
  text-decoration: none;
  border-radius: 2px;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: 'Montserrat', sans-serif;
}

.nav-pill.active {
  background: var(--crest-red);
  color: white;
}

.nav-pill:hover:not(.active) {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: white;
  cursor: pointer;
  text-decoration: none;
}

.user-badge:hover { text-decoration: none; background: rgba(255, 255, 255, 0.15); }

.avatar-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--crest-red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.65rem;
  color: white;
}

.logout-btn {
  color: white;
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.5rem 0.75rem;
  opacity: 0.7;
  border-radius: 2px;
}

.logout-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

/* ============================================================================
   Notification Bell
============================================================================ */

.notification-bell-wrapper {
  position: relative;
}

.notification-bell {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.15s;
}

.notification-bell:hover {
  background: rgba(255, 255, 255, 0.2);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--crest-red);
  color: white;
  border-radius: 100px;
  min-width: 20px;
  height: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--off-black);
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 2rem);
  max-height: 500px;
  background: white;
  border: 2px solid var(--off-black);
  border-radius: 4px;
  box-shadow: 4px 4px 0 var(--crest-red);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (max-width: 500px) {
  .notification-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    max-height: 70vh;
    border-radius: 0;
    border-top: 3px solid var(--crest-red);
  }
}

.notification-header {
  padding: 0.875rem 1rem;
  border-bottom: 2px solid var(--off-black);
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notification-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--off-black);
}

.notification-mark-all {
  background: transparent;
  border: none;
  color: var(--crest-red);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.notification-mark-all:hover {
  text-decoration: underline;
}

.notification-list {
  overflow-y: auto;
  flex: 1;
}

.notification-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.notification-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  color: var(--off-black);
  display: block;
  transition: background 0.1s;
}

.notification-item:hover {
  background: var(--cream);
  text-decoration: none;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item.unread {
  border-left: 3px solid var(--crest-red);
  padding-left: calc(1rem - 3px);
  background: #fffafa;
}

.notification-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.notification-item-route {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--crest-red);
  letter-spacing: -0.01em;
}

.notification-item-time {
  font-size: 0.7rem;
  color: var(--soft);
  font-weight: 500;
  white-space: nowrap;
}

.notification-item-author {
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 0.125rem;
  color: var(--off-black);
}

.notification-item-message {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-item-note {
  font-style: italic;
  color: var(--dark-steam);
}

/* ============================================================================
   Panels
============================================================================ */

.panel {
  background: white;
  border: 2px solid var(--off-black);
  border-radius: 4px;
  box-shadow: 4px 4px 0 var(--off-black);
  overflow: hidden;
}

.panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--off-black);
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--off-black);
}

.panel-meta {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.panel-body {
  padding: 1.25rem;
}

/* ============================================================================
   Spinner / Loading
============================================================================ */

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================================
   Modal
============================================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--cream);
  border: 2px solid var(--off-black);
  border-radius: 4px;
  box-shadow: 6px 6px 0 var(--off-black);
  max-width: 30rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.15s;
}

.modal-backdrop.active .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 1.25rem;
  border-bottom: 2px solid var(--off-black);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--off-black);
  line-height: 1;
  padding: 0;
}

.modal-body { padding: 1.25rem; }

.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ============================================================================
   Utilities
============================================================================ */

.text-red { color: var(--crest-red); }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.hidden { display: none !important; }

@media (max-width: 640px) {
  .mobile-hidden { display: none !important; }
}

/* ============================================================================
   Toast notifications
============================================================================ */

.toast-container {
  position: fixed;
  top: 5rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: calc(100vw - 2rem);
}

.toast {
  background: var(--off-black);
  color: white;
  padding: 0.875rem 1.25rem;
  border-radius: 4px;
  border: 2px solid var(--off-black);
  box-shadow: 4px 4px 0 var(--crest-red);
  font-weight: 600;
  font-size: 0.875rem;
  animation: slideIn 0.2s ease-out;
  max-width: 20rem;
}

.toast.success { box-shadow: 4px 4px 0 #28a745; }
.toast.error { background: var(--crest-red); box-shadow: 4px 4px 0 var(--off-black); }

@keyframes slideIn {
  from { transform: translateX(120%); }
  to { transform: translateX(0); }
}
