/* ===== Flying Tigers 92 — Global Styles ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* --- Brand palette (derived from Flying Tigers & Scouting America logos) --- */
  --navy:           #1B3A6B;
  --navy-light:     #264D8C;
  --navy-dark:      #0F2444;
  --gold:           #F5C518;
  --gold-light:     #FFD954;
  --gold-dark:      #C9A000;
  --red:            #CE1126;
  --red-light:      #E8394D;
  --red-dark:       #A30D1E;
  --white:          #FFFFFF;
  --off-white:      #F7F8FA;
  --gray-50:        #F9FAFB;
  --gray-100:       #F3F4F6;
  --gray-200:       #E5E7EB;
  --gray-300:       #D1D5DB;
  --gray-400:       #9CA3AF;
  --gray-500:       #6B7280;
  --gray-600:       #4B5563;
  --gray-700:       #374151;
  --gray-800:       #1F2937;
  --gray-900:       #111827;

  /* --- Semantic tokens --- */
  --primary:        var(--navy);
  --primary-hover:  var(--navy-light);
  --accent:         var(--gold);
  --accent-hover:   var(--gold-light);
  --danger:         var(--red);
  --danger-hover:   var(--red-dark);
  --bg:             var(--off-white);
  --card-bg:        var(--white);
  --text:           var(--gray-800);
  --text-light:     var(--gray-500);
  --text-inverse:   var(--white);
  --border:         var(--gray-200);
  --radius:         8px;
  --radius-lg:      16px;
  --shadow:         0 1px 3px rgba(0,0,0,.08);
  --shadow-md:      0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:      0 8px 30px rgba(0,0,0,.12);
  --transition:     .2s ease;

  /* --- Unit colors --- */
  --pack-color:     #2E86DE;   /* Cub Scout blue */
  --girls-color:    #27AE60;   /* Girl Scout green */
  --boys-color:     #E74C3C;   /* Boy Scout red */
}

/* --- Base --- */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 { line-height: 1.25; color: var(--navy-dark); }
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

/* --- Utility Classes --- */
.container     { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-sm  { max-width: 800px; margin: 0 auto; padding: 0 20px; }
.text-center   { text-align: center; }
.text-light    { color: var(--text-light); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* --- Top Navigation Bar --- */
.top-bar {
  background: var(--navy);
  color: var(--white);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.top-bar .nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 64px;
}
.top-bar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--white);
}
.top-bar .brand img {
  height: 44px;
  width: auto;
  border-radius: 4px;
}
.top-bar .brand-text {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .3px;
}
.top-bar .brand-text .sub {
  display: block;
  font-size: .7rem;
  font-weight: 400;
  opacity: .8;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.top-bar nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.top-bar nav a {
  color: rgba(255,255,255,.85);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
}
.top-bar nav a:hover,
.top-bar nav a.active {
  background: rgba(255,255,255,.12);
  color: var(--white);
  text-decoration: none;
}
.top-bar nav a.btn-login {
  background: var(--gold);
  color: var(--navy-dark);
  font-weight: 600;
  padding: 8px 18px;
  margin-left: 8px;
}
.top-bar nav a.btn-login:hover {
  background: var(--gold-light);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
}

/* --- Hero Banner --- */
.hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-light) 100%);
  color: var(--white);
  text-align: center;
  padding: 60px 20px 50px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -30%;
  width: 160%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 50%, rgba(245,197,24,.08) 0%, transparent 60%);
  pointer-events: none;
}
.hero-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin-bottom: 24px;
  position: relative;
}
.hero-logos img {
  height: 110px;
  width: auto;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.3));
}
.hero h1 {
  color: var(--white);
  font-size: 2.75rem;
  margin-bottom: 8px;
  position: relative;
}
.hero h1 span {
  color: var(--gold);
}
.hero .tagline {
  font-size: 1.15rem;
  opacity: .9;
  max-width: 620px;
  margin: 0 auto 32px;
}

/* --- Unit Cards --- */
.units-section {
  padding: 60px 20px;
}
.units-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
  max-width: 1100px;
  margin: 0 auto;
}
.unit-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
}
.unit-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.unit-card .card-header {
  padding: 28px 24px 20px;
  text-align: center;
  color: var(--white);
}
.unit-card .card-header.pack    { background: linear-gradient(135deg, #1e6fc0, var(--pack-color)); }
.unit-card .card-header.girls   { background: linear-gradient(135deg, #1d8f4e, var(--girls-color)); }
.unit-card .card-header.boys    { background: linear-gradient(135deg, #c0392b, var(--boys-color)); }

.unit-card .card-header .unit-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}
.unit-card .card-header h3 {
  color: var(--white);
  margin: 0;
  font-size: 1.35rem;
}
.unit-card .card-header .age-range {
  font-size: .85rem;
  opacity: .85;
  margin-top: 4px;
}
.unit-card .card-body {
  padding: 20px 24px 24px;
  flex: 1;
}
.unit-card .card-body p {
  color: var(--text-light);
  font-size: .95rem;
  margin-bottom: 16px;
}
.unit-card .card-body .card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: .9rem;
}

/* --- Section titles --- */
.section-title {
  text-align: center;
  margin-bottom: 40px;
}
.section-title h2 {
  font-size: 2rem;
  margin-bottom: 8px;
}
.section-title .accent-bar {
  width: 60px;
  height: 4px;
  background: var(--gold);
  border-radius: 2px;
  margin: 12px auto 0;
}
.section-title p {
  color: var(--text-light);
  max-width: 560px;
  margin: 12px auto 0;
}

/* --- Upcoming Events strip --- */
.events-section {
  background: var(--white);
  padding: 60px 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}
.event-card {
  display: flex;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
.event-card:hover { box-shadow: var(--shadow); }
.event-date {
  min-width: 56px;
  text-align: center;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.2;
}
.event-date .month { font-size: .7rem; text-transform: uppercase; letter-spacing: 1px; }
.event-date .day   { font-size: 1.5rem; font-weight: 700; }
.event-info h4 { margin-bottom: 4px; font-size: 1rem; }
.event-info p  { color: var(--text-light); font-size: .85rem; }
.event-info .badge {
  display: inline-block;
  font-size: .7rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  margin-top: 6px;
}
.badge-pack  { background: rgba(46,134,222,.12); color: var(--pack-color); }
.badge-girls { background: rgba(39,174,96,.12); color: var(--girls-color); }
.badge-boys  { background: rgba(231,76,60,.12); color: var(--boys-color); }
.badge-all   { background: rgba(245,197,24,.15); color: var(--gold-dark); }

/* --- Quick Links bar --- */
.quick-links {
  padding: 50px 20px;
}
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  max-width: 900px;
  margin: 0 auto;
}
.quick-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}
.quick-link:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}
.quick-link .link-icon {
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  border-radius: var(--radius);
}

/* --- Announcements --- */
.announcements-section {
  padding: 50px 20px;
  background: var(--white);
  border-top: 1px solid var(--border);
}
.announcement-list {
  max-width: 800px;
  margin: 0 auto;
  list-style: none;
}
.announcement-list li {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.announcement-list li:last-child { border-bottom: none; }
.announcement-list .ann-date {
  font-size: .8rem;
  color: var(--gold-dark);
  font-weight: 600;
  text-transform: uppercase;
}
.announcement-list h4 { margin: 4px 0 6px; }
.announcement-list p { color: var(--text-light); font-size: .92rem; }

/* --- Footer --- */
.site-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,.7);
  padding: 40px 20px 24px;
  margin-top: auto;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}
.footer-col h4 {
  color: var(--gold);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  color: rgba(255,255,255,.65);
  padding: 3px 0;
  font-size: .9rem;
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--white); text-decoration: none; }
.footer-col p { font-size: .88rem; line-height: 1.7; }
.footer-bottom {
  max-width: 1100px;
  margin: 28px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .8rem;
}
.footer-bottom .footer-logos img {
  height: 32px;
  margin-left: 12px;
  opacity: .6;
  transition: opacity var(--transition);
}
.footer-bottom .footer-logos img:hover { opacity: 1; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .9rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary   { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-light); color: var(--white); text-decoration: none; }
.btn-accent    { background: var(--gold); color: var(--navy-dark); }
.btn-accent:hover  { background: var(--gold-light); color: var(--navy-dark); text-decoration: none; }
.btn-outline   { background: transparent; border: 2px solid var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); text-decoration: none; }
.btn-danger    { background: var(--red); color: var(--white); }
.btn-danger:hover  { background: var(--red-dark); color: var(--white); text-decoration: none; }
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }

/* --- Forms --- */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: .88rem;
  margin-bottom: 6px;
  color: var(--gray-700);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .92rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--white);
  color: var(--text);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,58,107,.12);
}
.form-group textarea { resize: vertical; min-height: 100px; }

/* --- Cards (generic) --- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
}

/* --- Alert Messages --- */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: .9rem;
  margin-bottom: 16px;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger  { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeaa7; }

/* --- Tables --- */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--gray-50);
  font-weight: 600;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-600);
}
tr:hover td { background: var(--gray-50); }

/* --- Login Page --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  padding: 20px;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.login-card .login-header {
  text-align: center;
  margin-bottom: 28px;
}
.login-card .login-header img { height: 64px; margin-bottom: 16px; }
.login-card .login-header h2 { margin-bottom: 4px; }
.login-card .login-header p { color: var(--text-light); font-size: .9rem; }

/* --- Members Dashboard Layout --- */
.dashboard-layout {
  display: flex;
  min-height: calc(100vh - 64px);
}
.sidebar {
  width: 240px;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  flex-shrink: 0;
}
.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--gray-600);
  font-size: .9rem;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
}
.sidebar a:hover,
.sidebar a.active {
  background: var(--gray-100);
  color: var(--navy);
  text-decoration: none;
}
.sidebar a.active {
  border-right: 3px solid var(--navy);
  font-weight: 600;
}
.sidebar .sidebar-section {
  padding: 14px 20px 6px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-400);
}
.main-content {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
}
.main-content .page-header {
  margin-bottom: 28px;
}
.main-content .page-header h1 {
  font-size: 1.75rem;
  margin-bottom: 4px;
}
.main-content .page-header p {
  color: var(--text-light);
}

/* --- Stat Cards --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--navy);
}
.stat-card .stat-label {
  font-size: .8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy);
  margin-top: 4px;
}
.stat-card.accent { border-left-color: var(--gold); }
.stat-card.accent .stat-value { color: var(--gold-dark); }
.stat-card.danger { border-left-color: var(--red); }
.stat-card.danger .stat-value { color: var(--red); }

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}
.tab {
  padding: 10px 20px;
  background: none;
  border: none;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}
.tab:hover { color: var(--navy); }
.tab.active { color: var(--navy); border-bottom-color: var(--navy); font-weight: 600; }

/* --- Page header (public pages) --- */
.page-banner {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  color: var(--white);
  padding: 48px 20px;
  text-align: center;
}
.page-banner h1 { color: var(--white); margin-bottom: 8px; }
.page-banner p { opacity: .85; max-width: 560px; margin: 0 auto; }

/* --- Calendar styles --- */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal-header {
  background: var(--navy);
  color: var(--white);
  padding: 10px 8px;
  text-align: center;
  font-size: .8rem;
  font-weight: 600;
}
.cal-day {
  background: var(--white);
  min-height: 90px;
  padding: 6px 8px;
  font-size: .8rem;
}
.cal-day .day-num {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--gray-600);
}
.cal-day.today .day-num {
  background: var(--navy);
  color: var(--white);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-day .cal-event {
  display: block;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: .7rem;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.cal-day.inactive { background: var(--gray-50); }
.cal-day.inactive .day-num { color: var(--gray-300); }

/* --- Gallery --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition);
}
.gallery-item:hover { transform: scale(1.02); }
.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.gallery-item .caption {
  padding: 10px 12px;
  background: var(--white);
  font-size: .85rem;
}

/* --- Modal/Overlay --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 540px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal .modal-header h3 { margin: 0; }
.modal .close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--gray-400);
  padding: 4px;
}
.modal .close-btn:hover { color: var(--text); }

/* --- Responsive --- */
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .top-bar nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: 8px 12px 16px;
    box-shadow: 0 8px 16px rgba(0,0,0,.2);
  }
  .top-bar nav.open { display: flex; }
  .top-bar nav a { padding: 12px 14px; }

  .hero h1 { font-size: 2rem; }
  .hero-logos img { height: 75px; }

  .units-grid { grid-template-columns: 1fr; }
  .events-grid { grid-template-columns: 1fr; }

  .dashboard-layout { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .main-content { padding: 20px 16px; }

  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

@media (max-width: 480px) {
  .hero { padding: 40px 16px 36px; }
  .hero h1 { font-size: 1.65rem; }
  .hero-logos { gap: 16px; }
  .hero-logos img { height: 60px; }
  .login-card { padding: 28px 20px; }
}
