/* ══════════════════════════════════════════════════════════════════════════════
   Agility Hub — Shared Styles
   ══════════════════════════════════════════════════════════════════════════════ */

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Design Tokens ─── */
:root {
  --dark:        #02070f;
  --dark-mid:    #0a0f1e;
  --blue:        #2388ff;
  --blue-hover:  #1a70e0;
  --blue-pale:   #eef5ff;
  --white:       #ffffff;
  --gray-50:     #f4f7fa;
  --gray-200:    #e2e8f0;
  --gray-300:    #cbd5e1;
  --gray-400:    #8a8f98;
  --gray-600:    #525866;
  --green:       #16a34a;
  --green-bg:    #dcfce7;
  --red:         #dc2626;
  --red-bg:      #fee2e2;
  --success:     var(--green);
  --danger:      var(--red);
  --amber:       #d97706;
  --amber-bg:    #fef3c7;
  --purple:      #7c3aed;
  --purple-bg:   #f5f3ff;
  --orange:      #ea580c;
  --orange-bg:   #fff7ed;
  --radius:      4px;
  --border:      2px solid #02070f;
  --shadow:      5px 5px 0px #02070f;
  --shadow-sm:   3px 3px 0px #02070f;
  --shadow-lg:   8px 8px 0px #02070f;
  --transition:  .2s ease;
}

/* ─── Base ─── */
html { font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ─── */
.site-header {
  background: var(--dark);
  border-bottom: var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo-img {
  width: 30px; height: 30px;
  object-fit: contain;
  flex-shrink: 0;
}
.header-text { flex: 1; }
.header-title {
  color: var(--white);
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -.01em;
}
.header-sub {
  color: rgba(255,255,255,.35);
  font-size: .74rem;
  margin-top: 1px;
}
.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.user-name { color: rgba(255,255,255,.55); font-size: .8rem; font-weight: 500; }
.sign-out-link {
  color: rgba(255,255,255,.4);
  font-size: .75rem;
  font-weight: 600;
  text-decoration: none;
  padding: 4px 10px;
  border: 1.5px solid rgba(255,255,255,.15);
  border-radius: 3px;
  transition: border-color .15s, color .15s;
  cursor: pointer;
  background: none;
  font-family: inherit;
}
.sign-out-link:hover { color: var(--white); border-color: rgba(255,255,255,.4); }

/* ─── Header Nav (admin pages) ─── */
.header-nav { display: flex; gap: 6px; }
.header-nav a {
  color: rgba(255,255,255,.5);
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 12px;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  transition: border-color .15s, color .15s;
}
.header-nav a:hover { border-color: rgba(255,255,255,.2); color: var(--white); }
.header-nav a.active { background: var(--blue); border-color: var(--blue); color: var(--white); }
.header-nav a.nav-back {
  color: rgba(255,255,255,.3);
  border-color: transparent;
  margin-right: 4px;
  padding-right: 14px;
  border-right: 1px solid rgba(255,255,255,.12);
  border-radius: 0;
}
.header-nav a.nav-back:hover {
  color: rgba(255,255,255,.6);
  background: none;
  border-color: transparent;
  border-right-color: rgba(255,255,255,.12);
}

/* ─── Back Link (tool pages) ─── */
.back-link {
  color: rgba(255,255,255,.5);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color .2s;
  white-space: nowrap;
}
.back-link:hover { color: var(--blue); }
.back-link svg { width: 12px; height: 12px; fill: currentColor; }
.header-divider { color: rgba(255,255,255,.2); font-size: .9rem; }

/* ─── Container Widths ─── */
.container-tool { max-width: 960px; margin: 0 auto; }
.container-admin { max-width: 1200px; margin: 0 auto; }

/* ─── Page Header (dark banner) ─── */
.page-header {
  background: var(--dark-mid);
  border-bottom: var(--border);
  padding: 40px 24px 36px;
}
.page-header-inner {
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.page-header h1, .page-title {
  color: var(--white);
  font-family: 'Montserrat', sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -.03em;
}
.page-header h1 span, .page-title span { color: var(--blue); }
.page-header p, .page-desc {
  color: rgba(255,255,255,.45);
  font-size: .86rem;
  margin-top: 6px;
  max-width: 520px;
  line-height: 1.55;
}
.page-eyebrow {
  display: inline-block;
  background: var(--blue);
  color: var(--white);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border: 2px solid var(--white);
  margin-bottom: 14px;
}

/* ─── Hero (homepage) ─── */
.hero {
  background: var(--dark-mid);
  border-bottom: var(--border);
  padding: 64px 32px 56px;
  text-align: center;
}
.hero-eyebrow {
  display: inline-block;
  background: var(--blue);
  color: var(--white);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border: 2px solid var(--white);
  margin-bottom: 20px;
}
.hero h1 {
  color: var(--white);
  font-family: 'Montserrat', sans-serif;
  font-size: 2.6rem;
  font-weight: 900;
  letter-spacing: -.03em;
  margin-bottom: 16px;
  line-height: 1.1;
}
.hero h1 span { color: var(--blue); }
.hero p {
  color: rgba(255,255,255,.55);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.7;
  font-weight: 400;
}

/* ─── Page Hero (tool pages) ─── */
.page-hero { background: var(--dark-mid); border-bottom: var(--border); padding: 40px 24px 36px; }
.page-hero-inner { margin: 0 auto; }
.page-hero h1 {
  color: var(--white);
  font-family: 'Montserrat', sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -.03em;
  margin-bottom: 8px;
}
.page-hero p {
  color: rgba(255,255,255,.5);
  font-size: .9rem;
  max-width: 560px;
  line-height: 1.65;
}

/* ─── Form Card ─── */
.form-card {
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
}
.form-section { padding: 28px; border-bottom: 2px solid var(--dark); }
.form-section:last-of-type { border-bottom: none; }
.section-label {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::after { content: ''; flex: 1; height: 2px; background: var(--gray-200); }

.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
label { display: block; font-size: .84rem; font-weight: 700; color: var(--dark); margin-bottom: 6px; }
label .req { color: var(--blue); margin-left: 2px; }
.field-hint { font-size: .76rem; color: var(--gray-400); margin-bottom: 8px; font-weight: 400; }

input[type="text"], input[type="url"], input[type="email"], input[type="date"], textarea, select {
  width: 100%; padding: 10px 12px; border: var(--border); border-radius: var(--radius);
  font-size: .9rem; color: var(--dark); background: var(--white);
  font-family: inherit; line-height: 1.5; transition: box-shadow var(--transition); outline: none;
}
input:focus, textarea:focus, select:focus { box-shadow: 3px 3px 0px var(--blue); border-color: var(--blue); }
textarea { resize: vertical; min-height: 80px; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius);
  font-size: .8rem; font-weight: 600; cursor: pointer;
  border: 1.5px solid; text-decoration: none;
  transition: all .15s; white-space: nowrap; font-family: inherit;
}
.btn-primary {
  background: var(--blue); color: var(--white);
  border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 12px 24px; font-size: .88rem; font-weight: 800;
}
.btn-primary:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0px var(--dark);
}
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  border-color: rgba(255,255,255,.2);
  color: rgba(255,255,255,.6);
}
.btn-ghost:hover { border-color: rgba(255,255,255,.5); color: var(--white); }

/* ─── Cards Grid (homepage) ─── */
.cards-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 32px;
  flex: 1;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.card {
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-lg);
}
.card-icon {
  width: 52px; height: 52px;
  background: var(--blue-pale);
  border: var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.card-label {
  font-size: .68rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--blue);
}
.card-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.2rem; font-weight: 800;
  color: var(--dark); letter-spacing: -.02em;
  line-height: 1.2; margin-top: -2px;
}
.card-desc {
  font-size: .88rem; color: var(--gray-600);
  line-height: 1.65; flex: 1;
}
.card-fields { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.card-field-tag {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: 2px; padding: 3px 10px;
  font-size: .72rem; font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase; letter-spacing: .04em;
}
.card-cta {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue);
  color: var(--white);
  font-size: .85rem;
  font-weight: 700;
  padding: 12px 20px;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  align-self: flex-start;
  transition: transform .1s, box-shadow .1s;
}
.card:hover .card-cta {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0px var(--dark);
}
.card-cta svg { width: 14px; height: 14px; fill: white; }

/* ─── Compact Cards (admin section) ─── */
.cards-compact .card {
  padding: 24px 20px;
  gap: 10px;
}
.cards-compact .card-icon {
  width: 40px; height: 40px;
  font-size: 1.2rem;
}
.cards-compact .card-title { font-size: 1rem; }
.cards-compact .card-cta {
  padding: 8px 14px;
  font-size: .78rem;
}

/* ─── Filters ─── */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-btn {
  padding: 6px 14px; border: var(--border); border-radius: var(--radius);
  background: var(--white); font-family: inherit; font-size: .78rem; font-weight: 700;
  cursor: pointer; transition: background .12s, color .12s;
}
.filter-btn.active { background: var(--dark); color: var(--white); }
.filter-btn:hover:not(.active) { background: var(--gray-50); }

/* ─── Type Pills ─── */
.type-pill {
  display: inline-block; padding: 3px 9px; border-radius: 3px;
  font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  white-space: nowrap;
}
.type-blog       { background: #eef5ff;         color: #1d4ed8; }
.type-social     { background: var(--purple-bg); color: var(--purple); }
.type-instagram  { background: var(--purple-bg); color: var(--purple); }
.type-newsletter { background: var(--orange-bg); color: var(--orange); }
.type-engagement { background: var(--gray-200);  color: var(--gray-600); }

/* ─── States (loading, empty, error) ─── */
.state-box { text-align: center; padding: 60px 24px; }
.state-icon { font-size: 2.5rem; margin-bottom: 16px; }
.state-title { font-weight: 700; font-size: 1rem; margin-bottom: 6px; }
.state-desc { color: var(--gray-400); font-size: .84rem; }
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--gray-200);
  border-top-color: var(--blue); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Toast Notifications ─── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 1000;
}
.toast {
  padding: 12px 18px; border: var(--border); border-radius: var(--radius);
  font-size: .82rem; font-weight: 600; background: var(--white);
  box-shadow: var(--shadow); max-width: 340px; animation: slideIn .2s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.toast.success { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.toast.error   { background: var(--red-bg);   border-color: var(--red);   color: var(--red); }

/* ─── QC Warnings ─── */
.qc-warning {
  padding: 8px 14px;
  background: var(--amber-bg);
  border: 1.5px solid var(--amber);
  border-radius: var(--radius);
  font-size: .78rem;
  font-weight: 600;
  color: var(--amber);
  margin-top: 8px;
}

/* ─── Footer ─── */
.site-footer {
  background: var(--dark);
  border-top: var(--border);
  padding: 20px 32px;
  text-align: center;
  color: rgba(255,255,255,.3);
  font-size: .78rem;
  font-weight: 500;
  margin-top: auto;
}
.site-footer a { color: rgba(255,255,255,.5); text-decoration: none; }
.site-footer a:hover { color: var(--blue); }

/* ─── LinkedIn Connected State ─── */
.li-connected {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 5px;
  background: rgba(255,255,255,.06);
  border: 1.5px solid rgba(255,255,255,.12);
  border-radius: 20px;
  text-decoration: none; white-space: nowrap;
}
.li-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(74,222,128,.5);
  object-fit: cover; flex-shrink: 0;
}
.li-avatar-placeholder {
  width: 22px; height: 22px; border-radius: 50%;
  background: #0077b5;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.li-name { color: rgba(255,255,255,.75); font-size: .78rem; }
.li-status { color: #4ade80; font-size: .65rem; font-weight: 700; letter-spacing: .04em; }

/* ─── Admin-only visibility ─── */
.admin-only { display: none; }

/* ─── Accessibility ─── */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ─── Responsive: Tablet ─── */
@media (max-width: 768px) {
  .header-inner { padding: 14px 16px; gap: 10px; }
  .header-nav { gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .header-nav a { font-size: .72rem; padding: 5px 8px; white-space: nowrap; }
  .page-header { padding: 32px 16px 28px; }
  .page-header h1, .page-title { font-size: 1.5rem; }
  .hero { padding: 48px 24px 40px; }
  .hero h1 { font-size: 2rem; }
  .cards-section { padding: 36px 16px; }
  .cards-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

/* ─── Responsive: Mobile ─── */
@media (max-width: 640px) {
  .hero { padding: 40px 20px 36px; }
  .hero h1 { font-size: 1.8rem; }
  .cards-section { padding: 32px 20px; }
  .cards-grid { grid-template-columns: 1fr; }
  .card { padding: 28px 24px; }
  .page-hero { padding: 32px 16px 28px; }
  .page-hero h1 { font-size: 1.5rem; }
  .header-user .user-name { display: none; }
}

/* ─── Responsive: Small Mobile ─── */
@media (max-width: 480px) {
  .header-inner { padding: 12px; gap: 8px; }
  .header-nav a { font-size: .68rem; padding: 4px 6px; }
  .card-fields { gap: 4px; }
  .card-field-tag { font-size: .65rem; padding: 2px 6px; }
  .page-header h1, .page-title { font-size: 1.3rem; }
}
