{% load static %}

<style>
/* ── VARIABLES FOOTER (autonomes, n'attendent pas le parent) ── */
.essig-footer {
  --fp:    #205397;
  --fa:    #e90707;
  --fdark: #0f1923;
  --flb:   #4A90E2;
  --fw:    #ffffff;

  background: linear-gradient(160deg, #0f1923 0%, #152338 55%, #0f1923 100%);
  color: #fff;
  margin-top: auto;
  position: relative;
  overflow: hidden;
  font-family: 'DM Sans', 'Roboto', sans-serif;
}

/* Fond décoratif : cercles abstraits */
.essig-footer::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(32,83,151,.18) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.essig-footer::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(233,7,7,.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Trait accent en haut */
.footer-top-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--fa), var(--fp), var(--flb));
  width: 100%;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 40px 48px;
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.9fr 1fr 1.2fr 1.5fr;
  gap: 52px;
}

/* ── COL 1 : Branding ── */
.footer-brand {}

.footer-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.footer-logo-frame {
  width: 66px; height: 66px;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  padding: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-logo-frame img {
  width: 100%; height: 100%;
  object-fit: contain;
}

.footer-brand-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: .04em;
  margin: 0;
  line-height: 1.1;
}

.footer-brand-sub {
  font-size: .68rem;
  color: rgba(255,255,255,.38);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 3px 0 0;
}

.footer-desc {
  color: rgba(255,255,255,.48);
  font-size: .88rem;
  line-height: 1.75;
  margin: 0 0 24px;
  max-width: 280px;
}

/* Badge accroche */
.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(32,83,151,.2);
  border: 1px solid rgba(32,83,151,.35);
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 24px;
  font-size: .78rem;
  color: rgba(255,255,255,.7);
}
.footer-badge i {
  color: var(--flb);
  font-size: .85rem;
}
.footer-badge strong { color: #fff; }

/* Réseaux sociaux */
.footer-socials {
  display: flex;
  gap: 8px;
}

.footer-soc {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.55);
  font-size: .95rem;
  text-decoration: none;
  transition: background .25s, border-color .25s, color .25s, transform .25s;
}

.footer-soc:hover {
  background: var(--fa);
  border-color: var(--fa);
  color: #fff;
  transform: translateY(-3px);
}

/* ── COL 2 & 3 : Listes de liens ── */
.footer-col-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-col-title::before {
  content: '';
  width: 18px; height: 2px;
  background: var(--fa);
  border-radius: 2px;
  flex-shrink: 0;
}

.footer-links {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-links a {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255,255,255,.45);
  text-decoration: none;
  font-size: .875rem;
  padding: 5px 0;
  transition: color .22s, padding-left .22s;
  position: relative;
}

.footer-links a::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--fa);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .22s;
}

.footer-links a:hover {
  color: #fff;
  padding-left: 4px;
}
.footer-links a:hover::before { opacity: 1; }

/* ── COL 4 : Contact ── */
.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.footer-contact-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: rgba(32,83,151,.18);
  border: 1px solid rgba(32,83,151,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  color: var(--flb);
  flex-shrink: 0;
}

.footer-contact-text {
  color: rgba(255,255,255,.5);
  font-size: .84rem;
  line-height: 1.5;
  padding-top: 6px;
}

.footer-contact-text a {
  color: rgba(255,255,255,.5);
  text-decoration: none;
  transition: color .2s;
}
.footer-contact-text a:hover { color: #fff; }

/* Horaires */
.footer-hours {
  background: rgba(32,83,151,.12);
  border: 1px solid rgba(32,83,151,.2);
  border-left: 3px solid var(--fp);
  border-radius: 10px;
  padding: 14px 16px;
}

.footer-hours-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .78rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.footer-hours-title i { color: var(--flb); }

.footer-hours p {
  margin: 3px 0 0;
  font-size: .78rem;
  color: rgba(255,255,255,.4);
}

/* ── SÉPARATEUR ── */
.footer-sep {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
  z-index: 1;
}
.footer-sep-line {
  border: none;
  border-top: 1px solid rgba(255,255,255,.07);
}

/* ── COPYRIGHT ── */
.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.footer-copy {
  font-size: .8rem;
  color: rgba(255,255,255,.3);
  margin: 0;
}

.footer-tagline {
  font-size: .8rem;
  color: rgba(255,255,255,.3);
  margin: 0;
}

.footer-tagline span { color: var(--fa); }

/* ── SCROLL TO TOP ── */
#scrollTopBtn {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 46px; height: 46px;
  background: var(--fp);
  border: 2px solid rgba(255,255,255,.15);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0; visibility: hidden;
  z-index: 1000;
  box-shadow: 0 6px 24px rgba(32,83,151,.4);
  transition: opacity .3s, visibility .3s, background .25s, transform .25s;
  color: #fff;
  font-size: 1.1rem;
  text-decoration: none;
}
#scrollTopBtn.show { opacity: 1; visibility: visible; }
#scrollTopBtn:hover { background: var(--fa); transform: translateY(-4px); box-shadow: 0 10px 28px rgba(233,7,7,.4); }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}

@media (max-width: 600px) {
  .footer-inner { padding: 48px 20px 36px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-sep { padding: 0 20px; }
  .footer-bottom { padding: 18px 20px; flex-direction: column; text-align: center; }
  #scrollTopBtn { bottom: 18px; right: 18px; }
}
</style>

<footer class="essig-footer">

  <!-- Trait accent haut -->
  <div class="footer-top-bar"></div>

  <div class="footer-inner">
    <div class="footer-grid">

      <!-- ── COL 1 : Branding ── -->
      <div class="footer-brand">
        <div class="footer-logo-wrap">
          <div class="footer-logo-frame">
            <img src="{% static 'img/logo-removebg-preview.png' %}" alt="Logo ESSIG">
          </div>
          <div>
            <p class="footer-brand-name">ESSIG</p>
            <p class="footer-brand-sub">École Supérieure</p>
          </div>
        </div>

        <div class="footer-badge">
          <i class="bi bi-patch-check-fill"></i>
          <span>+<strong>36 ans</strong> d'excellence académique</span>
        </div>

        <p class="footer-desc">
          ESSIG forme les leaders de demain avec des programmes d'excellence et un environnement d'apprentissage innovant, tourné vers l'Afrique de demain.
        </p>

        <div class="footer-socials">
          <a href="#" class="footer-soc" aria-label="Facebook"><i class="bi bi-facebook"></i></a>
          <a href="#" class="footer-soc" aria-label="Instagram"><i class="bi bi-instagram"></i></a>
          <a href="#" class="footer-soc" aria-label="LinkedIn"><i class="bi bi-linkedin"></i></a>
          <a href="#" class="footer-soc" aria-label="YouTube"><i class="bi bi-youtube"></i></a>
          <a href="#" class="footer-soc" aria-label="Twitter/X"><i class="bi bi-twitter-x"></i></a>
        </div>
      </div>

      <!-- ── COL 2 : Liens rapides ── -->
      <div>
        <p class="footer-col-title">Liens Rapides</p>
        <ul class="footer-links">
          <li><a href="{% url 'home' %}">Accueil</a></li>
          <li><a href="{% url 'a_propos' %}">À propos</a></li>
          <li><a href="{% url 'formations' %}">Formations</a></li>
          <li><a href="{% url 'blog' %}">Blog</a></li>
          <li><a href="{% url 'vie_etudiante' %}">Vie estudiantine</a></li>
          <li><a href="{% url 'contact' %}">Contact</a></li>
          <li><a href="{% url 'postuler' %}">Postuler</a></li>
        </ul>
      </div>

      <!-- ── COL 3 : Formations ── -->
      <div>
        <p class="footer-col-title">Nos Formations</p>
        <ul class="footer-links">
          <li><a href="{% url 'classe_preparatoire' %}">Classe Préparatoire</a></li>
          <li><a href="{% url 'bts' %}">BTS</a></li>
          <li><a href="{% url 'licence' %}">Licence Professionnelle</a></li>
          <li><a href="{% url 'master' %}">Master Spécialisé</a></li>
        </ul>
      </div>

      <!-- ── COL 4 : Contact ── -->
      <div>
        <p class="footer-col-title">Contact</p>

        <div class="footer-contact-list">
          <div class="footer-contact-item">
            <div class="footer-contact-icon"><i class="bi bi-geo-alt-fill"></i></div>
            <p class="footer-contact-text">123 Avenue de l'École,<br>Lomé, Togo</p>
          </div>
          <div class="footer-contact-item">
            <div class="footer-contact-icon"><i class="bi bi-telephone-fill"></i></div>
            <p class="footer-contact-text">+228 71 19 05 05<br>+228 96 14 86 87</p>
          </div>
          <div class="footer-contact-item">
            <div class="footer-contact-icon"><i class="bi bi-envelope-fill"></i></div>
            <p class="footer-contact-text"><a href="mailto:info@essig.tg">info@essig.tg</a></p>
          </div>
          <div class="footer-contact-item">
            <div class="footer-contact-icon"><i class="bi bi-globe2"></i></div>
            <p class="footer-contact-text"><a href="https://www.es-essig.com" target="_blank">www.es-essig.com</a></p>
          </div>
        </div>

        <!-- Horaires -->
        <div class="footer-hours">
          <p class="footer-hours-title"><i class="bi bi-clock-fill"></i> Horaires d'ouverture</p>
          <p>Lun – Ven : 8h00 – 18h00</p>
          <p>Sam : 9h00 – 13h00</p>
        </div>
      </div>

    </div>
  </div>

  <!-- Séparateur -->
  <div class="footer-sep">
    <hr class="footer-sep-line">
  </div>

  <!-- Copyright -->
  <div class="footer-bottom">
    <p class="footer-copy">&copy; 2026 ESSIG — Tous droits réservés</p>
    <p class="footer-tagline">Conçu avec <span>❤</span> pour l'excellence académique</p>
  </div>

</footer>

<!-- Bouton scroll to top -->
<a href="#" id="scrollTopBtn" aria-label="Retour en haut">
  <i class="bi bi-arrow-up"></i>
</a>

<script>
  window.addEventListener('scroll', function () {
    const btn = document.getElementById('scrollTopBtn');
    if (window.scrollY > 300) btn.classList.add('show');
    else btn.classList.remove('show');
  }, { passive: true });

  document.getElementById('scrollTopBtn').addEventListener('click', function(e) {
    e.preventDefault();
    window.scrollTo({ top: 0, behavior: 'smooth' });
  });
</script>