/* ============================================================
   Site-Footer — Pflicht-Links (Impressum / Datenschutz / Cookies)
   plus kurze Brand-Wiederholung. Lebt am Ende der SPA, nach
   UeberMichSection.
============================================================ */

const FT_PALETTE = {
  bg:     "#040D14",
  card:   "#0D2030",
  accent: "#3ABDD0",
  soft:   "#8DDBEA",
  ink:    "#ffffff",
  muted:  "rgba(141,219,234,0.55)",
  line:   "rgba(141,219,234,0.14)",
};

function SiteFooter() {
  const year = new Date().getFullYear();
  return (
    <footer className="sm-footer">
      <style>{`
        .sm-footer{
          background: ${FT_PALETTE.bg};
          border-top: 1px solid ${FT_PALETTE.line};
          padding: 56px 60px 36px;
          color: ${FT_PALETTE.soft};
          font-family: 'Inter', sans-serif;
        }
        .sm-footer-grid{
          max-width: 1280px; margin: 0 auto;
          display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr;
          gap: 40px;
          padding-bottom: 36px;
          border-bottom: 1px solid ${FT_PALETTE.line};
        }
        .sm-footer-brand .name{
          font-family: 'Outfit', sans-serif; font-size: 18px; font-weight: 600;
          color: ${FT_PALETTE.ink}; letter-spacing: -0.01em;
          margin: 0 0 8px;
        }
        .sm-footer-brand p{
          font-size: 13.5px; line-height: 1.55; opacity: 0.75;
          margin: 0; max-width: 36ch;
        }
        .sm-footer-col h5{
          font-family: 'JetBrains Mono', monospace; font-size: 10px;
          color: ${FT_PALETTE.muted}; letter-spacing: 0.18em;
          text-transform: uppercase; margin: 0 0 14px; font-weight: 500;
        }
        .sm-footer-col ul{
          list-style: none; padding: 0; margin: 0;
          display: flex; flex-direction: column; gap: 8px;
        }
        .sm-footer-col a{
          color: ${FT_PALETTE.soft}; text-decoration: none;
          font-size: 13.5px; opacity: 0.85; transition: opacity 0.15s, color 0.15s;
        }
        .sm-footer-col a:hover{ color: ${FT_PALETTE.accent}; opacity: 1; }
        .sm-footer-col .ctc{
          font-size: 13.5px; line-height: 1.6;
          color: ${FT_PALETTE.soft}; opacity: 0.85;
        }
        .sm-footer-col .ctc a{ display: block; }

        .sm-footer-bottom{
          max-width: 1280px; margin: 0 auto;
          padding-top: 24px;
          display: flex; flex-wrap: wrap; gap: 16px 32px;
          align-items: center; justify-content: space-between;
        }
        .sm-footer-bottom .meta{
          font-family: 'JetBrains Mono', monospace; font-size: 11px;
          color: ${FT_PALETTE.muted}; letter-spacing: 0.1em;
        }
        .sm-footer-bottom nav{
          display: flex; flex-wrap: wrap; gap: 8px 22px;
        }
        .sm-footer-bottom nav a{
          color: ${FT_PALETTE.soft}; text-decoration: none;
          font-size: 12.5px; opacity: 0.75;
        }
        .sm-footer-bottom nav a:hover{ color: ${FT_PALETTE.accent}; opacity: 1; }

        @media (max-width: 980px){
          .sm-footer-grid{ grid-template-columns: 1fr 1fr; }
        }
        @media (max-width: 600px){
          .sm-footer{ padding: 44px 24px 28px; }
          .sm-footer-grid{ grid-template-columns: 1fr; gap: 28px; }
        }
      `}</style>

      <div className="sm-footer-grid">
        <div className="sm-footer-brand">
          <h4 className="name">Smartmacherei</h4>
          <p>
            Smart-Building-Beratung für Altbau, Neubau und Gewerbe — herstellerunabhängig,
            sauber dokumentiert, im Alltag bedienbar.
          </p>
        </div>

        <div className="sm-footer-col">
          <h5>Navigation</h5>
          <ul>
            <li><a href="#demo">Live-Demo</a></li>
            <li><a href="#leistungen">Leistungen</a></li>
            <li><a href="#konfigurator">Konfigurator</a></li>
            <li><a href="#ueber">Über mich</a></li>
            <li><a href="#kontakt">Kontakt</a></li>
          </ul>
        </div>

        <div className="sm-footer-col">
          <h5>Rechtliches</h5>
          <ul>
            <li><a href="impressum.html">Impressum</a></li>
            <li><a href="datenschutz.html">Datenschutz</a></li>
            <li><a href="cookies.html">Cookies &amp; Speicherung</a></li>
            <li>
              <a href="#"
                 onClick={(e) => {
                   e.preventDefault();
                   if (window.smConsent && window.smConsent.show) window.smConsent.show();
                 }}>
                Cookie-Einstellungen
              </a>
            </li>
          </ul>
        </div>

        <div className="sm-footer-col">
          <h5>Kontakt</h5>
          <div className="ctc">
            Ing. Thomas Basting<br />
            Edt bei Lambach · 4650 OÖ<br />
            <a href="mailto:thobasting@gmail.com">thobasting@gmail.com</a>
            <a href="tel:+436776426544">+43 677 642 654 41</a>
          </div>
        </div>
      </div>

      <div className="sm-footer-bottom">
        <div className="meta">© {year} Ing. Thomas Basting · Smartmacherei</div>
        <nav>
          <a href="impressum.html">Impressum</a>
          <a href="datenschutz.html">Datenschutz</a>
          <a href="cookies.html">Cookies</a>
          <a href="#"
             onClick={(e) => {
               e.preventDefault();
               if (window.smConsent && window.smConsent.show) window.smConsent.show();
             }}>
            Cookie-Einstellungen
          </a>
        </nav>
      </div>
    </footer>
  );
}

window.SiteFooter = SiteFooter;
