/* AfiaỌru phone bottom bar (version 1.66.0). Drawn by includes/module-app-style.php.
   Classic 3D: a raised slate dock with a gold rim and a sheen that crosses it. Inactive tabs are
   recessed wells; the open page is a raised gold key with a solid under-lip. Pressing a key pushes
   it down. Phones only: on desktop the bar is hidden.
   Every rule is scoped under body.afiaoru-app-shell so page rules cannot change the bar. */

.afiaoru-tabbar { display: none; }

@media (max-width: 768px) {
  body.afiaoru-app-shell {
    --afi-tab-clear: 112px;
    padding-bottom: var(--afi-tab-clear);
  }

  body.afiaoru-app-shell .afiaoru-tabbar {
    --afi-gold-hi: #F6D9A4;
    --afi-gold:    #C8903A;
    --afi-gold-lo: #8C5A1E;
    --afi-ink:     #0B151B;
    --afi-cream:   #E9DFCB;

    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 9999;
    height: 74px;
    padding: 8px 8px 7px;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 4px;
    overflow: hidden;
    isolation: isolate;
    border: 0;
    border-radius: 22px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, .14) 0%, rgba(255, 255, 255, 0) 38%),
      linear-gradient(180deg, #37525F 0%, #2A4352 52%, #1C2F3B 100%);
    /* 3D dock: a light top edge, a dark bottom bevel, a gold rim and a deep drop shadow */
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .24),
      inset 0 -3px 0 rgba(0, 0, 0, .32),
      0 0 0 1px var(--afi-ink),
      0 0 0 3px var(--afi-gold),
      0 0 0 4px var(--afi-gold-lo),
      0 18px 28px -10px rgba(0, 0, 0, .65);
  }

  /* A sheen that crosses the dock every few seconds */
  body.afiaoru-app-shell .afiaoru-tabbar::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -45%;
    width: 35%;
    z-index: 0;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .22), transparent);
    pointer-events: none;
    animation: afia-dock-sheen 8s ease-in-out infinite;
  }

  body.afiaoru-app-shell .afiaoru-tab {
    position: relative;
    z-index: 1;
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 16px;
    color: var(--afi-cream);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  body.afiaoru-app-shell .afiaoru-tab:focus-visible {
    outline: 2px solid var(--afi-gold-hi);
    outline-offset: 2px;
  }

  /* Icon well: recessed when the page is not open */
  body.afiaoru-app-shell .afiaoru-tab-ic {
    width: 46px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    color: #C9BDA5;
    background: linear-gradient(180deg, #14232D 0%, #1F3442 100%);
    box-shadow:
      inset 0 2px 4px rgba(0, 0, 0, .55),
      inset 0 -1px 0 rgba(255, 255, 255, .08),
      0 1px 0 rgba(255, 255, 255, .12);
    transition: transform .18s ease, box-shadow .18s ease, color .2s ease, background .2s ease;
  }
  body.afiaoru-app-shell .afiaoru-tab-ic svg {
    width: 22px;
    height: 22px;
    transition: transform .25s cubic-bezier(.2, .8, .2, 1);
  }
  body.afiaoru-app-shell .afiaoru-tab:not(.is-on):hover .afiaoru-tab-ic { color: var(--afi-gold-hi); }
  body.afiaoru-app-shell .afiaoru-tab:not(.is-on):hover .afiaoru-tab-ic svg { transform: scale(1.1); }

  /* Label */
  body.afiaoru-app-shell .afiaoru-tab-label {
    max-width: 100%;
    overflow: hidden;
    font-family: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--afi-cream);
    transition: color .2s ease, transform .3s cubic-bezier(.2, .8, .2, 1);
  }

  /* The open page: a raised gold key with a solid under-lip, and a slight lift */
  body.afiaoru-app-shell .afiaoru-tab.is-on .afiaoru-tab-ic {
    color: #1C2F3B;
    background: linear-gradient(180deg, #FFF1C2 0%, var(--afi-gold-hi) 34%, var(--afi-gold) 78%, var(--afi-gold-lo) 100%);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .85),
      0 4px 0 #6B4716,
      0 9px 14px -4px rgba(0, 0, 0, .6),
      0 0 16px rgba(246, 217, 164, .35);
    transform: translateY(-4px);
    animation: afia-key-rise .5s cubic-bezier(.2, .8, .2, 1);
  }
  body.afiaoru-app-shell .afiaoru-tab.is-on .afiaoru-tab-label {
    color: var(--afi-gold-hi);
    text-shadow: 0 1px 0 #0B151B;
    transform: translateY(-2px);
  }

  /* Press: the key goes down into the dock */
  body.afiaoru-app-shell .afiaoru-tab:active .afiaoru-tab-ic {
    transform: translateY(2px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, .5), 0 1px 0 #6B4716;
    animation: none;
  }
  body.afiaoru-app-shell .afiaoru-tab.is-on:active .afiaoru-tab-ic {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(90, 58, 16, .55), 0 1px 0 #6B4716;
  }

  @keyframes afia-dock-sheen {
    0%, 60%  { left: -45%; }
    100%     { left: 115%; }
  }
  @keyframes afia-key-rise {
    0%   { transform: translateY(0) scale(.86); }
    60%  { transform: translateY(-7px) scale(1.06); }
    100% { transform: translateY(-4px) scale(1); }
  }

  @media (prefers-reduced-motion: reduce) {
    body.afiaoru-app-shell .afiaoru-tabbar::before,
    body.afiaoru-app-shell .afiaoru-tab.is-on .afiaoru-tab-ic { animation: none !important; }
    body.afiaoru-app-shell .afiaoru-tab-ic,
    body.afiaoru-app-shell .afiaoru-tab-ic svg,
    body.afiaoru-app-shell .afiaoru-tab-label { transition: none !important; }
  }
}
