/* PinJoy minimalist styles: responsive, accessible, performant */
:root {
  --bg: #ffffff;
  --text: #0b1f33;
  --muted: #5a6a7a;
  --border: #e5e9ef;
  --primary: #2e7d32; /* soothing green */
  --primary-contrast: #ffffff;
  --secondary: #1f6f8b; /* professional blue tone */
  --alt-bg: #f7f9fb;
  --focus: #ffbf47; /* visible amber focus */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
}
img { max-width: 100%; height: auto; }
a { color: var(--secondary); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

.skip-link {
  position: absolute; left: -999px; top: -999px; background: var(--text); color: #fff; padding: .5rem .75rem; border-radius: .25rem;
}
.skip-link:focus { left: .5rem; top: .5rem; z-index: 1000; }

.container { width: min(1100px, 92%); margin: 0 auto; }
.section { padding: 4rem 0; }
.section.alt { background: var(--alt-bg); }

.site-header { position: sticky; top: 0; background: var(--bg); border-bottom: 1px solid var(--border); z-index: 999; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: .75rem 0; }
.logo { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text); }
.logo img { height: 42px; width: auto; display: block; }
@media (max-width: 860px) { .logo img { height: 36px; } }
.logo-text { font-weight: 700; letter-spacing: .2px; }
.site-nav ul { display: flex; gap: 1rem; list-style: none; padding: 0; margin: 0; align-items: center; }
.site-nav a { padding: .4rem .6rem; border-radius: .3rem; }
.site-nav a:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.nav-toggle { display: none; font-size: 1.25rem; background: transparent; border: 1px solid var(--border); padding: .3rem .5rem; border-radius: .3rem; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .site-nav { position: absolute; right: 1rem; top: 3.2rem; background: var(--bg); border: 1px solid var(--border); border-radius: .5rem; padding: .5rem; display: none; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
}

/* Language Switcher */
.lang-switcher { 
  margin-left: .5rem; 
  position: relative; 
  display: flex;
  align-items: center; /* Vertical alignment fix */
}
.custom-select-wrapper {
  position: relative;
  user-select: none;
  width: auto;
  min-width: 140px;
}
.custom-select {
  position: relative;
  display: flex;
  flex-direction: column;
}
.custom-select-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .4rem .8rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text); /* Dark text for light theme */
  background: #fff; /* White background */
  border: 1px solid var(--border); /* Standard border */
  border-radius: .5rem;
  cursor: pointer;
  transition: all 0.2s;
  gap: .5rem;
}
.custom-select-trigger:hover {
  background: #f8fafc; /* Subtle hover state */
  border-color: #b0b8c4;
}
.custom-select-trigger:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.selected-flag, .option-flag {
  font-size: 1.1em;
  line-height: 1;
}
.selected-text {
  margin-right: auto;
}
.arrow {
  position: relative;
  height: 8px;
  width: 8px;
}
.arrow::before, .arrow::after {
  content: "";
  position: absolute;
  bottom: 0px;
  width: 0.15rem;
  height: 100%;
  transition: all 0.3s;
}
.arrow::before {
  left: -3px;
  transform: rotate(-45deg);
  background-color: var(--text); /* Dark arrow */
}
.arrow::after {
  left: 3px;
  transform: rotate(45deg);
  background-color: var(--text); /* Dark arrow */
}
.open .arrow::before {
  left: -3px;
  transform: rotate(45deg);
}
.open .arrow::after {
  left: 3px;
  transform: rotate(-45deg);
}

.custom-options {
  position: absolute;
  display: block;
  top: 100%;
  left: auto;
  right: 0;
  margin-top: .5rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: #fff; /* White background */
  box-shadow: 0 10px 20px rgba(0,0,0,0.1); /* Softer shadow */
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px);
  transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25);
  overflow: hidden;
  min-width: 200px;
}
.custom-select.open .custom-options {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateY(0);
}
.custom-option {
  position: relative;
  display: flex;
  align-items: center;
  padding: .75rem 1rem;
  font-size: 0.95rem;
  color: var(--text); /* Dark text */
  cursor: pointer;
  transition: all 0.2s;
  gap: .75rem;
  text-decoration: none; /* Remove underline for links */
}
.custom-option:hover, .custom-option:focus {
  background: #f1f5f9;
  color: var(--text);
  text-decoration: none;
}
.custom-option.selected {
  background: #f1f5f9;
  font-weight: 600;
}
.check-mark {
  margin-left: auto;
  color: var(--primary); /* Primary color for checkmark */
  font-weight: bold;
}

@media (max-width: 860px) {
  .lang-switcher { margin-left: 0; margin-top: .5rem; width: 100%; }
  .custom-select-wrapper { width: 100%; }
  .custom-options { left: 0; right: 0; min-width: auto; }
}

.hero { padding: 5rem 0 4rem; text-align: center; background: linear-gradient(120deg, #eaf7f0, #f7fbff); }
.hero h1 { margin: 0 0 .5rem; font-size: clamp(2rem, 3.6vw, 3rem); }
.lead { color: var(--muted); max-width: 60ch; margin: 0 auto 1.5rem; }
.hero-cta { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.btn { display: inline-block; padding: .7rem 1rem; border-radius: .5rem; border: 1px solid var(--border); font-weight: 600; }
.btn-primary { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }
.btn-primary:hover, .btn-primary:focus { filter: brightness(1.05); }
.btn-secondary { background: #fff; color: var(--text); }

/* Google Play Button */
.btn-google-play {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: #000;
  color: #fff;
  border: 1px solid #a6a6a6;
  padding: .5rem 1rem;
  border-radius: .5rem;
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn-google-play:hover, .btn-google-play:focus {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  text-decoration: none;
}
.btn-google-play svg {
  width: 24px;
  height: 24px;
}
.btn-google-play .btn-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}
.btn-google-play .small {
  font-size: 0.65rem;
  text-transform: uppercase;
}
.btn-google-play .large {
  font-size: 1rem;
  font-weight: 700;
}

/* Hero Title Animation */
.hero-title-animated {
  display: inline-block;
  background: linear-gradient(90deg, var(--text) 0%, var(--secondary) 50%, var(--text) 100%);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shine 5s linear infinite;
}

.highlight-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  display: inline-block;
  transition: transform 0.3s ease;
}

.highlight-text:hover {
  transform: scale(1.05);
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h1 {
  margin: 0 0 .5rem;
  font-size: clamp(2rem, 3.6vw, 3rem);
  animation: fadeInUp 0.8s ease-out forwards;
}

/* Partners Section */
.partners-section {
  padding: 3rem 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.partners-title {
  text-align: center;
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.partners-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem 3rem;
  align-items: center;
}

.partner-item {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: grayscale(100%);
  opacity: 0.6;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0.5rem;
}

.partner-item:hover, .partner-item:focus {
  filter: grayscale(0%);
  opacity: 1;
  transform: translateY(-2px);
  outline: none;
}

.partner-item img {
  height: 32px;
  width: auto;
  object-fit: contain;
  max-width: 140px;
}

@media (max-width: 640px) {
  .partners-grid {
    gap: 1.5rem;
  }
  .partner-item img {
    height: 24px;
    max-width: 100px;
  }
}

.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 1024px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .features-grid { grid-template-columns: 1fr; } }
.card { 
  background: #fff; 
  border: 1px solid var(--border); 
  border-radius: .75rem; 
  padding: 1rem; 
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(46, 125, 50, 0.15); /* Greenish glow/shadow */
  border-color: var(--primary);
}
.card h3 { margin-top: 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; padding-left: 1rem; }
.steps li { background: #fff; border: 1px solid var(--border); border-radius: .75rem; padding: 1rem; list-style: decimal; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

.grid.two { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 860px) { .grid.two { grid-template-columns: 1fr; } }

.list { padding-left: 1.2rem; }
.list li { margin: .25rem 0; }
.note { color: var(--muted); border-left: 3px solid var(--primary); padding-left: .75rem; }

.contact-list { padding-left: 1.2rem; }

.site-footer { border-top: 1px solid var(--border); padding: 1.5rem 0; background: var(--bg); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.footer-inner nav { display: inline-flex; gap: .75rem; }
.footer-inner a { color: var(--muted); }

.policy { padding: 2rem 0 4rem; }
.muted { color: var(--muted); }

/* Focus styles for accessibility */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Print basics */
@media print {
  .site-header, .site-footer, .nav-toggle, .hero-cta { display: none !important; }
  a[href]:after { content: " (" attr(href) ")"; font-size: .9em; color: var(--muted); }
}

/* Forms */
.form-row { display: grid; gap: .35rem; margin: .75rem 0; }
.form-row input[type="text"], .form-row input[type="email"] {
  padding: .6rem .7rem; border: 1px solid var(--border); border-radius: .4rem;
}
.form-row input:focus { outline: 3px solid var(--focus); }
.error { color: #b00020; min-height: 1.2em; }
.actions { display: inline-flex; gap: .5rem; flex-wrap: wrap; }

/* Logs */
.log-wrap { margin-top: 2rem; }
.log { background: #fafbfc; border: 1px solid var(--border); border-radius: .5rem; padding: .75rem; max-height: 280px; overflow: auto; }

/* Modal */
.modal { position: fixed; inset: 0; display: none; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.modal-dialog { position: relative; margin: 10vh auto; width: min(560px, 92%); background: #fff; border: 1px solid var(--border); border-radius: .75rem; padding: 1rem; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* Ordered lists with numeric badges */
ol.list { counter-reset: item; padding-left: 0; margin: 1rem 0; }
ol.list li { list-style: none; display: grid; grid-template-columns: 2.4rem 1fr; align-items: center; gap: .75rem; padding: .75rem .9rem; border: 1px solid var(--border); border-radius: .6rem; background: #fff; transition: background .2s ease, border-color .2s ease, transform .2s ease; }
ol.list li::before { counter-increment: item; content: counter(item); display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.08); grid-row: 1 / -1; align-self: center; }
ol.list li:hover { background: var(--alt-bg); border-color: #d8dee6; transform: translateY(-1px); }
ol.list li + li { margin-top: .5rem; }
@media (max-width: 640px) {
  ol.list li { grid-template-columns: 2rem 1fr; padding: .6rem .75rem; }
  ol.list li::before { width: 2rem; height: 2rem; font-size: .95rem; }
}

/* Steps list (cards) with badges */
.steps { counter-reset: step; padding-left: 0; }
.steps li { 
  list-style: none; 
  display: grid; 
  grid-template-columns: 2.6rem 1fr; 
  gap: .75rem; 
  align-items: center; 
  background: #fff; 
  border: 1px solid var(--border); 
  border-radius: .75rem; 
  padding: 1rem; 
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.steps li::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.08); grid-row: 1 / -1; align-self: center; }
.steps li:hover { 
  background: var(--alt-bg); 
  border-color: var(--primary); 
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(46, 125, 50, 0.15);
}

/* Unordered lists: subtle custom bullets */
ul.list { list-style: none; padding-left: 0; }
ul.list li { position: relative; padding-left: 1.25rem; }
ul.list li::before { content: "•"; position: absolute; left: 0; top: .2rem; color: var(--secondary); font-weight: 700; }

/* Ensure list children occupy the text column */
.steps li > * { grid-column: 2 / -1; }
ol.list li > * { grid-column: 2 / -1; }

/* Optional margin tuning for readability */
.steps li h3 { margin: 0 0 .25rem; }
.steps li p { margin: 0; }
ol.list li p { margin: 0; }

/* Disbursement History Page Styles */

.trust-badge-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f0fdf4; /* Light green bg */
  border: 1px solid #bbf7d0;
  border-radius: .75rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.trust-info h3 {
  margin: 0 0 .5rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.trust-info p {
  margin: 0 0 1rem;
  color: var(--muted);
  max-width: 600px;
}

.supported-wallets {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.wallet-tag {
  background: #fff;
  border: 1px solid #dcfce7;
  color: #166534;
  padding: .25rem .6rem;
  border-radius: .3rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.provider-logo {
  text-align: right;
  min-width: 120px;
}

.provider-logo .small-text {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .25rem;
}

.provider-logo img {
  height: 36px;
  width: auto;
}

/* Table Styles */
.table-container {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: .75rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.disbursement-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.disbursement-table th,
.disbursement-table td {
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.disbursement-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.disbursement-table tbody tr:last-child td {
  border-bottom: none;
}

.disbursement-table tbody tr:hover {
  background-color: #f8fafc;
}

.col-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.col-user, .col-account {
  font-family: monospace;
  color: var(--text);
}

.method-badge {
  display: inline-block;
  padding: .2rem .5rem;
  background: #e0f2fe;
  color: #0369a1;
  border-radius: .25rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.col-amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: .2rem .5rem;
  border-radius: 1rem;
  white-space: nowrap;
}

.col-status {
  white-space: nowrap;
}

.status-badge.success {
  background: #dcfce7;
  color: #15803d;
}

.table-footer {
  padding: .75rem 1.5rem;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

@media (max-width: 768px) {
  .trust-badge-container {
    flex-direction: column;
    align-items: flex-start;
  }
  .provider-logo {
    text-align: left;
    margin-top: .5rem;
  }
  .disbursement-table th, 
  .disbursement-table td {
    padding: .75rem 1rem;
  }
  .col-time {
    font-size: 0.85rem;
  }
}

/* Blog Styles */
.blog-container { padding: 3rem 0; }
.blog-header { text-align: center; margin-bottom: 3rem; }
.blog-header h1 { margin-bottom: 0.5rem; }
.blog-header p { color: var(--muted); }

.blog-layout { display: grid; grid-template-columns: 250px 1fr; gap: 3rem; align-items: start; }
@media (max-width: 860px) { .blog-layout { grid-template-columns: 1fr; } }

/* Sidebar */
.blog-sidebar { background: var(--alt-bg); padding: 1.5rem; border-radius: 0.75rem; border: 1px solid var(--border); }
.blog-sidebar h3 { margin-top: 0; font-size: 1.1rem; margin-bottom: 1rem; }
.category-list { list-style: none; padding: 0; margin: 0; }
.category-list li { margin-bottom: 0.5rem; }
.category-list a { display: block; padding: 0.5rem; border-radius: 0.3rem; color: var(--text); transition: background 0.2s; }
.category-list a:hover, .category-list a.active { background: #e2e8f0; color: var(--primary); font-weight: 500; text-decoration: none; }

/* Post Grid */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; }
.post-card { background: #fff; border: 1px solid var(--border); border-radius: 0.75rem; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column; }
.post-card:hover { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.post-content { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }
.post-meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; display: flex; gap: 0.5rem; }
.post-category { color: var(--primary); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; }
.post-title { margin: 0 0 1rem; font-size: 1.25rem; line-height: 1.4; }
.post-title a { color: var(--text); }
.post-excerpt { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.5rem; flex: 1; }
.read-more { font-weight: 600; color: var(--primary); margin-top: auto; }

/* Blog Detail */
.blog-detail-container { max-width: 800px; padding: 3rem 1rem; }
.blog-nav { margin-bottom: 2rem; }
.back-link { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.post-header { margin-bottom: 1rem; }
.post-meta-top { display: flex; gap: 1rem; align-items: center; margin-bottom: 0.5rem; }

/* Markdown Content */
.markdown-body { line-height: 1.7; font-size: 1.05rem; }
.markdown-body h1 { font-size: clamp(2rem, 4vw, 2.5rem); margin-top: 0; margin-bottom: 1.5rem; line-height: 1.2; color: var(--text); }
.markdown-body h2 { margin-top: 2rem; margin-bottom: 1rem; font-size: 1.5rem; color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; }
.markdown-body h3 { margin-top: 1.5rem; margin-bottom: 0.75rem; font-size: 1.25rem; color: var(--text); }
.markdown-body p { margin-bottom: 1.5rem; }
.markdown-body ul, .markdown-body ol { margin-bottom: 1.5rem; padding-left: 1.5rem; }
.markdown-body li { margin-bottom: 0.5rem; }
.markdown-body blockquote { border-left: 4px solid var(--primary); padding-left: 1rem; color: var(--muted); font-style: italic; margin: 1.5rem 0; }
.markdown-body pre { background: #f6f8fa; padding: 1rem; border-radius: 0.5rem; overflow-x: auto; margin-bottom: 1.5rem; font-size: 0.9rem; border: 1px solid var(--border); }
.markdown-body code { background: rgba(175, 184, 193, 0.2); padding: 0.2em 0.4em; border-radius: 6px; font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace; font-size: 0.9em; }
.markdown-body pre code { background: transparent; padding: 0; }
.markdown-body img { border-radius: 0.5rem; box-shadow: 0 4px 12px rgba(0,0,0,0.1); margin: 1.5rem 0; }
.markdown-body table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 0.75rem; text-align: left; }
.markdown-body th { background: var(--alt-bg); font-weight: 600; }
