/* assets/css/enhancements.css
   ─────────────────────────────────────────────────────────────────────────
   PHP Application Enhancements — AJAX feedback, animations, form states,
   notification toasts, and accessibility improvements.
   This file supplements main.css.
   ─────────────────────────────────────────────────────────────────────────
*/

/* ── Skip to content (accessibility) ─────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--gold);
  color: var(--navy);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  z-index: 9999;
  transition: top 0.2s;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ── Page transition fade-in ──────────────────────────────────────────────── */
body {
  animation: pageIn 0.35s ease-out both;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Scroll reveal (enhanced) ─────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(.22,.61,.36,1),
              transform 0.65s cubic-bezier(.22,.61,.36,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-left  { transform: translateX(-28px); }
.reveal-right { transform: translateX(28px); }
.reveal-left.visible,
.reveal-right.visible { transform: translateX(0); }
.reveal-delay-1 { transition-delay: 0.10s; }
.reveal-delay-2 { transition-delay: 0.20s; }
.reveal-delay-3 { transition-delay: 0.30s; }
.reveal-delay-4 { transition-delay: 0.40s; }
.reveal-delay-5 { transition-delay: 0.50s; }

/* ── Toast Notifications ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  max-width: 380px;
  pointer-events: all;
  box-shadow: 0 8px 32px rgba(0,0,0,.22);
  animation: toastIn 0.35s cubic-bezier(.22,.61,.36,1) both;
}
.toast.removing { animation: toastOut 0.3s ease both; }
@keyframes toastIn  { from { opacity:0; transform:translateX(40px); } }
@keyframes toastOut { to   { opacity:0; transform:translateX(40px); } }

.toast-success { background: #1d6e3b; color: #fff; }
.toast-error   { background: #b03030; color: #fff; }
.toast-info    { background: #2b5db0; color: #fff; }
.toast-warning { background: #8a6100; color: #fff; }

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,.65);
  cursor: pointer;
  font-size: 16px;
  padding: 2px;
  line-height: 1;
  flex-shrink: 0;
}
.toast-close:hover { color: #fff; }

/* ── AJAX Loading Spinner ─────────────────────────────────────────────────── */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}
.btn-loading::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(7,11,25,.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Form States ──────────────────────────────────────────────────────────── */
.form-control.valid   { border-color: #2d8a4e; }
.form-control.invalid { border-color: #e05555; }

.field-error {
  display: block;
  font-size: 12px;
  color: #e05555;
  margin-top: 5px;
  animation: fadeInDown 0.2s ease;
}
.field-success {
  display: block;
  font-size: 12px;
  color: #2d8a4e;
  margin-top: 5px;
}
@keyframes fadeInDown { from { opacity:0; transform:translateY(-4px); } }

/* Character counter */
.char-counter {
  font-size: 11px;
  color: var(--gray-mid);
  float: right;
  margin-top: 4px;
}
.char-counter.near-limit  { color: #8a6100; }
.char-counter.over-limit  { color: #e05555; }

/* ── PHP Alert messages (server-side flash) ───────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  animation: alertIn 0.3s ease;
}
@keyframes alertIn { from { opacity:0; transform:translateY(-8px); } }

.alert-success { background:#eef8f2; color:#1d6e3b; border:1px solid #b8e6cc; }
.alert-error   { background:#fdf0f0; color:#b03030; border:1px solid #f5c1c1; }
.alert-info    { background:#eef4ff; color:#2b5db0; border:1px solid #b8cdf5; }
.alert-warning { background:#fef9e7; color:#8a6100; border:1px solid #f5d96a; }

/* ── Inline loading state for AJAX sections ───────────────────────────────── */
.ajax-loading {
  pointer-events: none;
  opacity: 0.5;
  transition: opacity 0.3s;
}

/* ── Confirmation modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,11,25,.65);
  backdrop-filter: blur(4px);
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; }

.modal-box {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 36px;
  max-width: 420px;
  width: 90%;
  transform: scale(0.92) translateY(16px);
  transition: transform 0.28s cubic-bezier(.22,.61,.36,1);
  box-shadow: var(--shadow-lg);
}
.modal-overlay.open .modal-box { transform: scale(1) translateY(0); }
.modal-icon  { font-size: 36px; margin-bottom: 12px; }
.modal-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.modal-msg   { font-size: 14px; color: var(--gray-text); margin-bottom: 24px; line-height: 1.6; }
.modal-actions { display: flex; gap: 12px; }

/* ── Inline success animation ─────────────────────────────────────────────── */
.success-pulse {
  animation: successPulse 0.5s ease;
}
@keyframes successPulse {
  0%   { box-shadow: 0 0 0 0   rgba(45,138,78,.4); }
  50%  { box-shadow: 0 0 0 12px rgba(45,138,78,0); }
  100% { box-shadow: 0 0 0 0   rgba(45,138,78,0); }
}

/* ── Footer newsletter form ───────────────────────────────────────────────── */
.footer-newsletter-form { display: flex; flex-direction: column; gap: 8px; }
.footer-email-input {
  padding: 10px 14px;
  border: 1.5px solid rgba(255,255,255,.15);
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.footer-email-input:focus       { border-color: var(--gold); }
.footer-email-input::placeholder { color: rgba(255,255,255,.4); }
.footer-sub-btn  { align-self: flex-start; }
.footer-sub-msg {
  font-size: 12px;
  min-height: 18px;
  color: rgba(255,255,255,.6);
  transition: color 0.2s;
}
.footer-sub-msg.success { color: #7dd9a0; }
.footer-sub-msg.error   { color: #f59090; }

/* ── News filter tabs hover enhancement ───────────────────────────────────── */
.filter-tab {
  position: relative;
  overflow: hidden;
}
.filter-tab::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--navy);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
  z-index: -1;
  border-radius: inherit;
}
.filter-tab:hover::after { transform: scaleX(1); }
.filter-tab:hover { color: var(--gold); }

/* ── Animated counter number ──────────────────────────────────────────────── */
.count-up { display: inline-block; transition: transform 0.1s; }

/* ── Programme/Hub card hover ─────────────────────────────────────────────── */
.prog-card,
.hub-card {
  position: relative;
  overflow: hidden;
}
.prog-card::before,
.hub-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.prog-card:hover::before,
.hub-card:hover::before { transform: scaleX(1); }

/* ── Membership tier card flip-glow on hover ──────────────────────────────── */
.tier-card {
  transition: box-shadow 0.3s, transform 0.3s;
}
.tier-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(7,11,25,.14);
}

/* ── Blog card image zoom on hover ────────────────────────────────────────── */
.blog-card-image img {
  transition: transform 0.5s ease;
}
.blog-card:hover .blog-card-image img {
  transform: scale(1.06);
}

/* ── Floating label form enhancement ─────────────────────────────────────── */
.form-group.floating { position: relative; }
.form-group.floating .form-label {
  position: absolute;
  top: 14px; left: 16px;
  font-size: 15px;
  color: var(--gray-mid);
  font-weight: 400;
  pointer-events: none;
  transition: all 0.2s ease;
  background: transparent;
}
.form-group.floating .form-control:focus ~ .form-label,
.form-group.floating .form-control:not(:placeholder-shown) ~ .form-label {
  top: -8px;
  left: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--gold-dark);
  background: #fff;
  padding: 0 4px;
}

/* ── Image upload preview ─────────────────────────────────────────────────── */
.upload-preview {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 2px dashed var(--navy-100);
  display: block;
  margin-bottom: 10px;
}
.upload-zone {
  border: 2px dashed rgba(7,11,25,.15);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--off-white);
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--gold);
  background: var(--gold-pale);
}
.upload-zone p { font-size: 13px; color: var(--gray-mid); margin: 0; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .toast-container { bottom: 80px; left: 16px; right: 16px; }
  .toast           { max-width: 100%; }
  .modal-box       { padding: 24px; }
}

/* ── Navbar scrolled state ────────────────────────────────────────────────── */
.navbar.scrolled {
  box-shadow: 0 4px 24px rgba(7,11,25,.35);
  border-bottom-color: rgba(217,181,0,.22);
}

/* ── Admin mobile sidebar open ────────────────────────────────────────────── */
.admin-sidebar.mobile-open {
  transform: translateX(0) !important;
  box-shadow: 4px 0 32px rgba(7,11,25,.5);
}
@media (max-width: 700px) {
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    position: fixed;
    z-index: 200;
  }
  .admin-main { margin-left: 0 !important; }
  .admin-sidebar.mobile-open { transform: translateX(0); }
}

/* ── fadeInUp for blog card re-filter ─────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Navbar mobile nav animation ──────────────────────────────────────────── */
.mobile-nav {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(.22,.61,.36,1), opacity 0.3s;
  opacity: 0;
}
.mobile-nav.open {
  max-height: 600px;
  opacity: 1;
}

/* ── section-sm missing padding fix ──────────────────────────────────────── */
.section-sm { padding: 64px 0; }

/* ── grid-2 responsive stacking ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr !important; }
  .contact-grid { grid-template-columns: 1fr !important; }
  .membership-tiers { grid-template-columns: 1fr !important; }
  .partner-tiers { grid-template-columns: 1fr !important; }
  .blog-featured { grid-template-columns: 1fr !important; }
  .blog-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ══ PAGE & COMPONENT CSS ════════════════════════════════════════════════ */

/* ── Page hero ──────────────────────────────────────────────────────────── */
.page-hero {
  background: var(--navy, #070b19);
  padding: 120px 0 64px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 400px; height: 400px;
  border: 1px solid rgba(217,181,0,.06);
  border-radius: 50%;
  pointer-events: none;
}
.page-hero h1          { color: #fff; margin-bottom: 16px; }
.page-hero .hero-eyebrow { color: #d9b500; }
.page-hero .hero-sub   { color: rgba(255,255,255,.6); font-size: 17px; max-width: 620px; font-weight: 300; }

/* ── Pull quote ─────────────────────────────────────────────────────────── */
.pull-quote {
  border-left: 4px solid var(--gold, #d9b500);
  padding: 20px 28px;
  margin: 28px 0;
  font-family: var(--font-display, 'Playfair Display', serif);
  font-size: 20px;
  font-style: italic;
  color: var(--navy, #070b19);
  line-height: 1.5;
  background: var(--gold-pale, #fdf6d0);
  border-radius: 0 8px 8px 0;
}

/* ── CAC badge ──────────────────────────────────────────────────────────── */
.cac-badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--gold-pale, #fdf6d0);
  border: 1px solid rgba(168,140,0,.25);
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 13px; font-weight: 600;
  color: var(--gold-dark, #a88c00);
}

/* ── Org tiers ──────────────────────────────────────────────────────────── */
.org-tiers { display: grid; gap: 8px; }
.org-tier {
  background: var(--navy, #070b19);
  border-radius: 10px;
  padding: 16px 24px;
  display: flex; align-items: center; gap: 16px;
}
.org-tier-num  { font-family: var(--font-display, serif); font-size: 28px; font-weight: 700; color: #d9b500; opacity: .5; min-width: 36px; }
.org-tier-name { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.org-tier-desc { font-size: 13px; color: rgba(255,255,255,.55); }

/* ── Values grid ────────────────────────────────────────────────────────── */
.values-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.value-card  { background:#fff; border-radius:10px; padding:28px; border:1px solid rgba(7,11,25,.06); border-top:3px solid #d9b500; }
.value-icon  { font-size:28px; margin-bottom:12px; }
.value-name  { font-size:16px; font-weight:700; margin-bottom:8px; }
.value-desc  { font-size:13px; color: var(--gray-text, #4a4a46); line-height:1.6; }

/* ── Team cards ─────────────────────────────────────────────────────────── */
.team-card      { background:#fff; border-radius:16px; overflow:hidden; border:1px solid rgba(7,11,25,.06); text-align:center; transition:all .22s ease; }
.team-card:hover { box-shadow: 0 4px 16px rgba(7,11,25,.10); }
.team-avatar    { width:100%; height:200px; background:#1a2240; display:flex; align-items:center; justify-content:center; }
.team-avatar-initials { font-family:var(--font-display,'Playfair Display',serif); font-size:36px; font-weight:700; color:#d9b500; }
.team-bar       { height:3px; background:#d9b500; }
.team-info      { padding:20px; }
.team-name      { font-size:16px; font-weight:700; margin-bottom:4px; }
.team-role      { font-size:12px; color:#a88c00; font-weight:600; letter-spacing:1px; text-transform:uppercase; margin-bottom:12px; }
.team-bio       { font-size:13px; color:#4a4a46; line-height:1.6; }

/* ── Social links ───────────────────────────────────────────────────────── */
.social-links { display:flex; gap:10px; flex-wrap:wrap; }
.social-link  {
  width:40px; height:40px; border-radius:50%;
  border:1.5px solid rgba(7,11,25,.1);
  display:flex; align-items:center; justify-content:center;
  font-size:13px; transition:all .22s; color:#4a4a46; text-decoration:none;
}
.social-link:hover { background:#070b19; color:#d9b500; border-color:#070b19; }

/* ── Membership tiers ───────────────────────────────────────────────────── */
.membership-tiers { display:grid; grid-template-columns:repeat(3,1fr); gap:24px; }
.tier-card {
  background:#fff; border-radius:16px; border:1.5px solid rgba(7,11,25,.07);
  overflow:hidden; transition:all .22s ease;
}
.tier-card.featured { border-color:#d9b500; box-shadow:0 0 0 1px #d9b500, 0 12px 40px rgba(7,11,25,.14); position:relative; }
.tier-card:hover    { transform:translateY(-3px); box-shadow:0 12px 40px rgba(7,11,25,.14); }
.tier-badge-featured {
  position:absolute; top:12px; right:12px;
  background:#d9b500; color:#070b19;
  font-size:10px; font-weight:700; letter-spacing:1px;
  text-transform:uppercase; padding:3px 10px; border-radius:20px;
}
.tier-top      { background:#070b19; padding:28px; text-align:center; position:relative; }
.tier-top.gold { background:#d9b500; }
.tier-icon     { font-size:32px; margin-bottom:12px; }
.tier-name     { font-family:var(--font-display,'Playfair Display',serif); font-size:22px; font-weight:700; color:#fff; margin-bottom:4px; }
.tier-sub      { font-size:12px; color:rgba(255,255,255,.55); }
.tier-top.gold .tier-name { color:#070b19; }
.tier-top.gold .tier-sub  { color:rgba(7,11,25,.5); }
.tier-body     { padding:28px; }
.tier-body h4  { font-size:11px; font-weight:700; letter-spacing:2px; text-transform:uppercase; color:#a88c00; margin-bottom:14px; }
.tier-body ul  { list-style:none; }
.tier-body ul li {
  font-size:14px; color:#4a4a46; padding:7px 0;
  border-bottom:1px solid rgba(7,11,25,.05);
  display:flex; align-items:flex-start; gap:10px; line-height:1.5;
}
.tier-body ul li::before { content:'✓'; color:#a88c00; font-weight:700; flex-shrink:0; }
.tier-body ul li:last-child { border-bottom:none; }
.tier-cta { margin-top:20px; }

/* ── Partnership tiers ──────────────────────────────────────────────────── */
.partner-tiers { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.ptier-card    { background:#fff; border-radius:16px; border:1px solid rgba(7,11,25,.07); padding:28px; }
.ptier-icon    { font-size:28px; margin-bottom:14px; }
.ptier-name    { font-family:var(--font-display,'Playfair Display',serif); font-size:20px; font-weight:700; margin-bottom:8px; }
.ptier-fit     { font-size:11px; color:#a88c00; font-weight:600; letter-spacing:1px; text-transform:uppercase; margin-bottom:10px; }

/* ── Contact grid ───────────────────────────────────────────────────────── */
.contact-grid       { display:grid; grid-template-columns:1fr 420px; gap:40px; align-items:start; }
.contact-info-item  { display:flex; gap:16px; align-items:flex-start; margin-bottom:24px; }
.contact-icon       { width:40px; height:40px; background:#fdf6d0; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }
.contact-icon-label { font-size:11px; font-weight:600; letter-spacing:1.5px; text-transform:uppercase; color:#a88c00; margin-bottom:4px; }
.contact-icon-value { font-size:15px; font-weight:500; color:#070b19; text-decoration:none; }
.contact-icon-value:hover { color:#a88c00; }

/* ── Article body ───────────────────────────────────────────────────────── */
.article-body h2 { font-size:26px; margin:36px 0 14px; }
.article-body h3 { font-size:20px; margin:28px 0 10px; }
.article-body p  { margin-bottom:18px; }
.article-body ul, .article-body ol { padding-left:24px; margin-bottom:18px; }
.article-body li { margin-bottom:8px; font-size:16px; color:#4a4a46; }
.article-body blockquote {
  border-left:4px solid #d9b500; padding:16px 24px;
  background:#fdf6d0; border-radius:0 6px 6px 0;
  margin:24px 0; font-style:italic; font-size:17px; color:#070b19;
}
.article-body a { color:#a88c00; text-decoration:underline; }
.article-body a:hover { color:#070b19; }

/* ── Blog featured split ────────────────────────────────────────────────── */
.blog-featured { display:grid; grid-template-columns:1fr 1fr; gap:0; border-radius:16px; overflow:hidden; border:1px solid rgba(7,11,25,.07); margin-bottom:48px; }
.blog-featured-image { background:#1a2240; min-height:320px; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.blog-featured-image img { width:100%; height:100%; object-fit:cover; }
.blog-featured-body { background:#fff; padding:40px; display:flex; flex-direction:column; justify-content:center; }

/* ── btn-outline-gold ───────────────────────────────────────────────────── */
.btn-outline-gold { background:transparent; color:#a88c00; border:2px solid #d9b500; }
.btn-outline-gold:hover { background:#fdf6d0; }

/* ── Gold utility ────────────────────────────────────────────────────────── */
.gold-line  { width:48px; height:3px; background:#d9b500; border-radius:2px; margin:16px 0; }
.gold-line.centered { margin-left:auto; margin-right:auto; }

/* ── Eyebrow ─────────────────────────────────────────────────────────────── */
.eyebrow {
  display:inline-block;
  font-size:11px; font-weight:600;
  letter-spacing:3px; text-transform:uppercase;
  color:#a88c00; margin-bottom:12px;
}

/* ── Badge utilities ─────────────────────────────────────────────────────── */
.badge-navy { background:#070b19; color:#d9b500; font-size:10px; padding:3px 10px; border-radius:20px; font-weight:600; display:inline-block; }
.badge-gold { background:#fdf6d0; color:#a88c00; font-size:10px; padding:3px 10px; border-radius:20px; font-weight:600; display:inline-block; }

/* ── Hero trust line ─────────────────────────────────────────────────────── */
.hero-trust { font-size:12px; color:rgba(255,255,255,.35); margin-top:24px; letter-spacing:.5px; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width:1100px) {
  .membership-tiers  { grid-template-columns:1fr; }
  .partner-tiers     { grid-template-columns:1fr; }
  .contact-grid      { grid-template-columns:1fr; }
  .blog-featured     { grid-template-columns:1fr; }
  .values-grid       { grid-template-columns:repeat(2,1fr); }
}
@media (max-width:768px) {
  .page-hero   { padding:100px 0 48px; }
  .team-avatar { height:160px; }
}
@media (max-width:580px) {
  .values-grid { grid-template-columns:1fr; }
}
