// === MaxAMove SHARED VERSE OF THE DAY ===
// Single source of truth for the daily Bible verse. Used by:
//   - Dashboard (welcome card)
//   - On-Job screen (motivational anchor at the bottom)
//   - Worker portal (when shipped)
// Same verse on the same day across every surface — rotation is deterministic
// by day-of-year so a reload won't reshuffle, and every user sees the same one.

const BUSINESS_INTEGRITY_VERSES = [
  { ref: 'Proverbs 11:1',       text: 'A false balance is an abomination to the Lord, but a just weight is His delight.' },
  { ref: 'Proverbs 16:11',      text: 'Honest scales and balances belong to the Lord; all the weights in the bag are of His making.' },
  { ref: 'Proverbs 20:23',      text: 'The Lord detests differing weights, and dishonest scales do not please Him.' },
  { ref: 'Proverbs 13:11',      text: 'Wealth gained hastily will dwindle, but whoever gathers little by little will increase it.' },
  { ref: 'Proverbs 22:1',       text: 'A good name is to be chosen rather than great riches, and favor is better than silver or gold.' },
  { ref: 'Colossians 3:23',     text: 'Whatever you do, work heartily, as for the Lord and not for men.' },
  { ref: 'Proverbs 10:9',       text: 'Whoever walks in integrity walks securely, but he who makes his ways crooked will be found out.' },
  { ref: 'Proverbs 11:3',       text: 'The integrity of the upright guides them, but the unfaithful are destroyed by their duplicity.' },
  { ref: 'Luke 16:10',          text: 'One who is faithful in a very little is also faithful in much, and one who is dishonest in a very little is also dishonest in much.' },
  { ref: 'Proverbs 12:11',      text: 'Whoever works his land will have plenty of bread, but he who follows worthless pursuits lacks sense.' },
  { ref: 'Ecclesiastes 9:10',   text: 'Whatever your hand finds to do, do it with all your might.' },
  { ref: 'Proverbs 14:23',      text: 'All hard work brings a profit, but mere talk leads only to poverty.' },
  { ref: 'Proverbs 21:5',       text: 'The plans of the diligent lead surely to abundance, but everyone who is hasty comes only to poverty.' },
  { ref: 'Proverbs 16:3',       text: 'Commit your work to the Lord, and your plans will be established.' },
  { ref: 'Proverbs 16:8',       text: 'Better is a little with righteousness than great revenues with injustice.' },
  { ref: 'Romans 12:11',        text: 'Do not be slothful in zeal, be fervent in spirit, serve the Lord.' },
  { ref: '1 Corinthians 10:31', text: 'So, whether you eat or drink, or whatever you do, do all to the glory of God.' },
  { ref: 'Galatians 6:9',       text: 'Let us not grow weary of doing good, for in due season we will reap, if we do not give up.' },
  { ref: 'Proverbs 27:23',      text: 'Know well the condition of your flocks, and give attention to your herds.' },
  { ref: 'Ephesians 4:28',      text: 'Let the thief no longer steal, but rather let him labor, doing honest work with his own hands, so that he may have something to share with anyone in need.' },
  { ref: 'Proverbs 19:1',       text: 'Better is a poor person who walks in his integrity than one who is crooked in speech and is a fool.' },
  { ref: 'Micah 6:8',           text: 'He has shown you, O man, what is good — to do justice, to love kindness, and to walk humbly with your God.' },
  { ref: 'Proverbs 28:6',       text: 'Better is a poor man who walks in his integrity than a rich man who is crooked in his ways.' },
  { ref: '2 Corinthians 8:21',  text: 'For we aim at what is honorable not only in the Lord’s sight but also in the sight of man.' },
  { ref: 'Titus 2:7',           text: 'Show yourself in all respects to be a model of good works, and in your teaching show integrity, dignity.' },
  { ref: '1 Peter 2:12',        text: 'Keep your conduct honorable, so that when they speak against you as evildoers, they may see your good deeds and glorify God.' },
  { ref: 'Proverbs 24:27',      text: 'Prepare your work outside; get everything ready for yourself in the field, and after that build your house.' },
  { ref: 'Leviticus 19:13',     text: 'Do not defraud or rob your neighbor. Do not hold back the wages of a hired worker overnight.' },
  { ref: 'Matthew 7:12',        text: 'So whatever you wish that others would do to you, do also to them.' },
  { ref: 'Proverbs 22:29',      text: 'Do you see a man skillful in his work? He will stand before kings; he will not stand before obscure men.' },
  { ref: 'Proverbs 11:25',      text: 'Whoever brings blessing will be enriched, and one who waters will himself be watered.' },
  { ref: '1 Thessalonians 4:11',text: 'Aspire to live quietly, and to mind your own affairs, and to work with your hands.' },
  { ref: 'Proverbs 3:9-10',     text: 'Honor the Lord with your wealth and with the firstfruits of all your produce; then your barns will be filled with plenty.' },
  { ref: 'Proverbs 15:16',      text: 'Better is a little with the fear of the Lord than great treasure and trouble with it.' },
];

function getTodayVerse() {
  const now = new Date();
  const start = new Date(now.getFullYear(), 0, 0);
  const dayOfYear = Math.floor((now - start) / 86400000);
  return BUSINESS_INTEGRITY_VERSES[dayOfYear % BUSINESS_INTEGRITY_VERSES.length];
}

// Verse-of-the-day card. Self-contained; pass `style` to override margins/spacing
// at the call site (Dashboard wants 24px bottom; on-job wants tighter).
function VerseOfTheDay({ style }) {
  const verse = getTodayVerse();
  return (
    <div style={{
      background: 'var(--card)',
      borderRadius: 16,
      padding: 22,
      border: '1px solid var(--border)',
      position: 'relative',
      overflow: 'hidden',
      ...style,
    }}>
      <div aria-hidden style={{
        position: 'absolute', top: -28, right: -6,
        fontSize: 140, lineHeight: 1, fontFamily: 'Poppins, system-ui, sans-serif',
        fontWeight: 900, color: 'var(--accent)', opacity: 0.07,
        pointerEvents: 'none', userSelect: 'none',
      }}>“</div>
      <div style={{ display: 'flex', alignItems: 'center', gap: 10, marginBottom: 10 }}>
        <div style={{
          width: 26, height: 26, borderRadius: 8,
          background: 'linear-gradient(135deg, #14C6BF, #3DCC7E)',
          display: 'flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0,
        }}>
          <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#fff" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round">
            <path d="m19 21-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"/>
          </svg>
        </div>
        <h2 style={{ fontSize: 13, fontWeight: 800, fontFamily: 'Poppins, sans-serif', letterSpacing: '.02em' }}>Verse of the day</h2>
        <span style={{ fontSize: 11, color: 'var(--muted)', fontWeight: 600 }}>Business &amp; integrity</span>
      </div>
      <p style={{
        fontSize: 16, lineHeight: 1.6, color: 'var(--text)',
        fontWeight: 400, margin: '4px 0 12px',
        maxWidth: '94%', position: 'relative', zIndex: 1,
      }}>
        {verse.text}
      </p>
      <div style={{
        fontSize: 12, fontWeight: 700, color: 'var(--accent-dark, #0a9e98)',
        letterSpacing: '.04em', textTransform: 'uppercase',
      }}>
        {verse.ref}
      </div>
    </div>
  );
}

// Expose globally so other Babel-loaded scripts can use these without imports.
window.BUSINESS_INTEGRITY_VERSES = BUSINESS_INTEGRITY_VERSES;
window.getTodayVerse = getTodayVerse;
window.VerseOfTheDay = VerseOfTheDay;
