/* ============================================================
   Local Flyers App — main.css
   Matches Univey design system and colors
   ============================================================ */

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  background: #f8fafc;
  color: #1a1a2e;
  line-height: 1.6;
}

/* ── Header ──────────────────────────────────────────────────── */
.site-header {
  background: #1e3a5f;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  padding: 0 1.5rem;
  position: relative;
}
.site-header .container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.brand-tag {
  font-size: 0.75rem;
  color: rgba(255,255,255,.8);
  letter-spacing: 0.04em;
  margin: 0;
}
.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.nav-link {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: all 0.15s;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}
.nav-link:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
}

@media (max-width: 768px) {
  header .container {
    flex-direction: column;
    height: auto;
    padding: 1rem 0;
  }
  .nav {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* ── Main Content ────────────────────────────────────────────── */
main {
  min-height: 70vh;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

h1 {
  font-size: 1.85rem;
  font-weight: 800;
  margin: 0 0 0.4rem;
  color: #1a1a2e;
}
h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 1.5rem 0 1rem;
}
h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a2e;
}

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.alert.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}
.alert.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: all 0.15s;
  font-family: inherit;
}
.btn-primary {
  background: #2563eb;
  color: white;
}
.btn-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.btn-secondary {
  background: #e8edf3;
  color: #1a1a2e;
}
.btn-secondary:hover {
  background: #d1d9e6;
}
.btn-outline {
  background: transparent;
  color: #1a1a2e;
  border: 1px solid #e8edf3;
}
.btn-outline:hover {
  background: #f8fafc;
  border-color: #d1d9e6;
}
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* ── Grid & Cards ────────────────────────────────────────────– */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.card {
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  transition: transform .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
}
@media (hover: hover) {
  .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  }
}
.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* ── Tables ──────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
table th {
  background: #f8fafc;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid #e8edf3;
  color: #1a1a2e;
}
table td {
  padding: 1rem;
  border-bottom: 1px solid #e8edf3;
  color: #1a1a2e;
}
table tr:hover {
  background: #f8fafc;
}

/* ── Forms ───────────────────────────────────────────────────── */
input, textarea, select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e8edf3;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #1a1a2e;
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #1a1a2e;
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  background: #1a1a2e;
  color: rgba(255,255,255,.8);
  padding: 2rem;
  margin-top: 3rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}
.footer-tagline {
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
  color: rgba(255,255,255,.9);
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.footer-links a {
  color: rgba(255,255,255,.8);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: #fff;
}
.footer-legal {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(255,255,255,.7);
}

/* ── Utilities ───────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted { color: #64748b; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }

/* ── Badge ───────────────────────────────────────────────────– */
.badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
}
.badge-active {
  background: #d1fae5;
  color: #065f46;
}
.badge-inactive {
  background: #fee2e2;
  color: #991b1b;
}
.badge-blue {
  background: #f0f6ff;
  color: #1e40af;
}

/* ── PDF Viewer Controls ─────────────────────────────────────── */
#pdf-viewer {
  border: 1px solid #e8edf3;
  border-radius: 8px;
  overflow: auto;
  max-height: 700px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}
#pdf-canvas {
  max-width: 100%;
  display: block;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  h1 {
    font-size: 1.5rem;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  table {
    font-size: 0.875rem;
  }
  table td, table th {
    padding: 0.75rem 0.5rem;
  }
}
