/* EP CUBE shared footer v1
   Menu items, labels, links and icons are defined in epcube-footer.json.
   Mobile <= 760px: footer is not mounted by JS and is hidden defensively here.
*/

:root{
  --ep-footer-left:20px;
  --ep-footer-right:20px;
  --ep-footer-bottom:10px;
  --ep-footer-height:58px;
  --ep-footer-compact-width:70px;
  --ep-footer-radius:8px 8px 0 0;
  --ep-footer-bg-top:#183d55;
  --ep-footer-bg-bottom:#102f45;
  --ep-footer-text:#eaf7ff;
  --ep-footer-active:var(--green,#25f08b);
  --ep-footer-hover-bg:rgba(37,240,139,.045);
  --ep-footer-font-size:24px;
  --ep-footer-font-weight:790;

  /* JSON(siteBadges.layout)からJSで上書き可能 */
  --ep-badge-pc-bottom:10px;
  --ep-badge-pc-left:14px;
  --ep-badge-pc-right:14px;
  --ep-badge-mobile-bottom:8px;
  --ep-badge-mobile-left:10px;
  --ep-badge-mobile-right:10px;
}

.footer.epcube-shared-footer{
  position:absolute !important;
  left:var(--ep-footer-left) !important;
  right:var(--ep-footer-right) !important;
  bottom:var(--ep-footer-bottom) !important;
  width:auto !important;
  height:var(--ep-footer-height) !important;
  display:flex !important;
  align-items:center !important;
  padding:0 !important;
  margin:0 !important;
  overflow:hidden !important;
  border:0 !important;
  border-radius:var(--ep-footer-radius) !important;
  background:linear-gradient(180deg,var(--ep-footer-bg-top),var(--ep-footer-bg-bottom)) !important;
  box-shadow:0 -2px 18px rgba(0,0,0,.25) !important;
  z-index:2000 !important;
}

.epcube-footer-item{
  position:relative !important;
  flex:1 1 0 !important;
  min-width:0 !important;
  height:100% !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:10px !important;
  padding:0 8px !important;
  border:0 !important;
  background:transparent !important;
  color:var(--ep-footer-text) !important;
  font-size:var(--ep-footer-font-size) !important;
  line-height:1 !important;
  font-weight:var(--ep-footer-font-weight) !important;
  text-decoration:none !important;
  white-space:nowrap !important;
  cursor:pointer !important;
  transition:color .18s ease,background .18s ease,filter .18s ease !important;
}

.epcube-footer-item.compact{
  flex:0 0 var(--ep-footer-compact-width) !important;
  width:var(--ep-footer-compact-width) !important;
  padding:0 !important;
}

.epcube-footer-icon{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1;
}

.epcube-footer-icon img{
  display:block;
  width:28px;
  height:28px;
  object-fit:contain;
}

.epcube-footer-item.compact .epcube-footer-icon{
  font-size:34px;
}

.epcube-footer-label{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}

.epcube-footer-item:hover,
.epcube-footer-item:focus-visible{
  outline:none !important;
  color:var(--ep-footer-active) !important;
  background:var(--ep-footer-hover-bg) !important;
}

.epcube-footer-item.active{
  color:var(--ep-footer-active) !important;
}

.epcube-footer-item.active::after{
  content:"";
  position:absolute;
  left:8%;
  right:8%;
  bottom:0;
  height:4px;
  border-radius:3px;
  background:var(--ep-footer-active);
  box-shadow:0 0 9px var(--ep-footer-active);
}

.epcube-footer-item.compact.active::after{
  left:6px;
  right:6px;
}

/* Mobile uses the existing slide menu only. */
@media(max-width:760px){
  .footer,
  .footer.epcube-shared-footer{
    display:none !important;
  }

  /* Release space that older page-specific mobile CSS reserved for the footer. */
  .dashboard{
    padding-bottom:env(safe-area-inset-bottom) !important;
  }

  .content{
    padding-bottom:calc(28px + env(safe-area-inset-bottom)) !important;
  }

  .workspace{
    padding-bottom:calc(20px + env(safe-area-inset-bottom)) !important;
  }

  .unofficial-site-badge{
    bottom:calc(10px + env(safe-area-inset-bottom)) !important;
  }
}

@media(prefers-reduced-motion:reduce){
  .epcube-footer-item{
    transition:none !important;
  }
}


/* =========================================================
   EP CUBE common corner badges v2
   全ページで同じ位置・同じ外観に統一
   ========================================================= */
.epcube-site-corner-badge{
  position:fixed !important;
  bottom:calc(
    var(--ep-badge-pc-bottom) +
    env(safe-area-inset-bottom)
  ) !important;
  z-index:4200 !important;
  min-height:24px;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:5px 10px !important;
  border-radius:999px !important;
  font-size:11px !important;
  line-height:1 !important;
  font-weight:700 !important;
  letter-spacing:.02em !important;
  white-space:nowrap !important;
  user-select:none;
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
}

.first-visit-link.epcube-site-corner-badge{
  left:var(--ep-badge-pc-left) !important;
  right:auto !important;
  border:1px solid rgba(143,240,178,.20) !important;
  background:rgba(0,0,0,.28) !important;
  color:rgba(143,240,178,.70) !important;
  text-decoration:none !important;
  pointer-events:auto !important;
  transition:color .18s ease,border-color .18s ease,background .18s ease !important;
}

.first-visit-link.epcube-site-corner-badge:hover,
.first-visit-link.epcube-site-corner-badge:focus-visible{
  outline:none !important;
  color:#8ff0b2 !important;
  border-color:rgba(143,240,178,.48) !important;
  background:rgba(0,0,0,.42) !important;
}

.unofficial-site-badge.epcube-site-corner-badge{
  left:auto !important;
  right:var(--ep-badge-pc-right) !important;
  border:1px solid rgba(255,255,255,.10) !important;
  background:rgba(0,0,0,.28) !important;
  color:rgba(255,255,255,.48) !important;
  pointer-events:none !important;
}

/* モバイルは共通フッタなし → 両バッジを画面最下部の左右へ */
@media(max-width:760px){
  .epcube-site-corner-badge{
    bottom:calc(var(--ep-badge-mobile-bottom) + env(safe-area-inset-bottom)) !important;
    min-height:23px !important;
    padding:5px 9px !important;
    font-size:10px !important;
  }

  .first-visit-link.epcube-site-corner-badge{
    left:var(--ep-badge-mobile-left) !important;
  }

  .unofficial-site-badge.epcube-site-corner-badge{
    right:var(--ep-badge-mobile-right) !important;
  }

  /*
   dashboard.html のナビゲーションガイドのうち、
   フッタ用「QUICK NAVIGATION」バルーンだけを廃止。
   メニュー・アイコンのガイドは残します。
  */
  #footerGuideBubble{
    display:none !important;
  }

  .footer.nav-guide-target{
    box-shadow:none !important;
  }
}
