/* appui.css: professional mobile-app shell for the outfit coordinator.
   Additive layer: only applies when JS adds body.appui-on, so the app still works without it. */

/* ---------- design tokens ---------- */
body.appui-on{--r-lg:18px;--r-md:14px;--r-sm:10px;--nav-h:64px;--appbar-h:56px;--shadow-1:0 1px 2px rgba(0,0,0,.18),0 4px 14px rgba(0,0,0,.14);--shadow-2:0 8px 30px rgba(0,0,0,.35)}

/* ---------- app bar ---------- */
#appbar{position:sticky;top:0;z-index:950;display:flex;align-items:center;gap:10px;height:calc(var(--appbar-h) + env(safe-area-inset-top,0px));padding:env(safe-area-inset-top,0px) 12px 0;margin:0 -15px 14px;background:color-mix(in srgb,var(--bg) 82%,transparent);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-bottom:1px solid var(--b)}
#appbar .ab-logo{width:34px;height:34px;border-radius:11px;background:linear-gradient(135deg,#D4AF37,#F5D060);display:flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:0 2px 8px rgba(212,175,55,.35)}
#appbar .ab-logo svg{width:20px;height:20px;stroke:#0a0a0a}
#appbar .ab-title{flex:1;min-width:0;font-size:17px;font-weight:900;color:var(--t1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:start}
#appbar .ab-btn{width:40px;height:40px;border-radius:12px;display:flex;align-items:center;justify-content:center;color:var(--t2);background:var(--card);border:1px solid var(--b);flex-shrink:0;transition:transform .15s,color .15s}
#appbar .ab-btn:active{transform:scale(.92)}
#appbar .ab-btn svg{width:20px;height:20px;stroke:currentColor}
#appbar .ab-btn.ab-lang{font-size:12px;font-weight:800;width:auto;min-width:40px;padding:0 10px}

/* legacy header becomes redundant once the app bar is on */
body.appui-on .hdr{display:none}
body.appui-on .toolbar{display:none}
body.appui-on #app{padding-top:8px}

/* ---------- bottom navigation ---------- */
@media(max-width:639px){
  body.appui-on #app{padding-bottom:calc(var(--nav-h) + env(safe-area-inset-bottom,0px) + 18px)}
  body.appui-on #app>.tabbar{position:fixed;bottom:0;left:0;right:0;z-index:940;height:calc(var(--nav-h) + env(safe-area-inset-bottom,0px));margin:0;border:none;border-top:1px solid var(--b);border-radius:0;padding:6px 8px calc(6px + env(safe-area-inset-bottom,0px));background:color-mix(in srgb,var(--bg2) 92%,transparent);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);box-shadow:0 -8px 24px rgba(0,0,0,.30);gap:2px}
  body.appui-on #app>.tabbar .tab{flex-direction:column;gap:3px;font-size:10px!important;font-weight:700;border-radius:12px;color:var(--t3);padding:5px 2px!important;min-height:52px}
  body.appui-on #app>.tabbar .tab.on{background:rgba(212,175,55,.14);color:var(--g)}
  body.appui-on #app>.tabbar .tab .tab-ico{width:24px;height:24px;display:flex;align-items:center;justify-content:center}
  body.appui-on #app>.tabbar .tab .tab-ico svg{width:23px;height:23px;stroke:currentColor}
  body.appui-on #app>.tabbar .tab.on .tab-ico svg{stroke:var(--g)}
  body.appui-on .toast-wrap{bottom:calc(var(--nav-h) + env(safe-area-inset-bottom,0px) + 14px)}
}
@media(min-width:640px){
  body.appui-on #app>.tabbar .tab{display:inline-flex;align-items:center;gap:7px}
  body.appui-on #app>.tabbar .tab .tab-ico svg{width:17px;height:17px;stroke:currentColor;vertical-align:-3px}
}
.tab .tab-ico svg{fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#appbar .ab-btn svg,.ab-logo svg{fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* ---------- screen transitions ---------- */
@media(prefers-reduced-motion:no-preference){
  body.appui-on .tab-page.on{animation:appui-screen .26s cubic-bezier(.2,.7,.3,1)}
  @keyframes appui-screen{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
  body.appui-on .modal-bg.open .modal-card{animation:appui-sheet .28s cubic-bezier(.2,.8,.3,1)}
  @keyframes appui-sheet{from{transform:translateY(46px);opacity:.4}to{transform:none;opacity:1}}
}
@media(prefers-reduced-motion:reduce){
  body.appui-on .tab-page.on{animation:none}
}

/* ---------- cards & sections ---------- */
body.appui-on .sec-card,body.appui-on .bx-sec,body.appui-on .sc,body.appui-on .res-card{border-radius:var(--r-lg);border:1px solid var(--b);background:var(--bg2);box-shadow:var(--shadow-1)}
body.appui-on .bx-sec>summary{min-height:52px;display:flex;align-items:center;gap:10px}
body.appui-on .bx-sec>summary::after{content:'';width:9px;height:9px;border-inline-end:2px solid var(--t3);border-bottom:2px solid var(--t3);transform:rotate(45deg);margin-inline-start:auto;transition:transform .2s;flex-shrink:0}
body.appui-on .bx-sec[open]>summary::after{transform:rotate(225deg)}
body.appui-on .bx-card,body.appui-on .fit,body.appui-on .chip,body.appui-on .pill{border-radius:var(--r-md)}
body.appui-on .sc-ico{display:flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:10px;background:rgba(212,175,55,.10);flex-shrink:0}
body.appui-on .sc-ico svg{width:20px;height:20px;stroke:var(--g);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* ---------- bottom-sheet modals (mobile) ---------- */
@media(max-width:639px){
  body.appui-on .modal-bg{align-items:flex-end;padding:0}
  body.appui-on .modal-card{width:100%;max-width:520px;border-radius:20px 20px 0 0;border-bottom:none;max-height:88vh;padding-bottom:calc(18px + env(safe-area-inset-bottom,0px))}
  body.appui-on .modal-card::before{content:'';display:block;width:38px;height:4px;border-radius:99px;background:var(--t4);margin:2px auto 10px}
}

/* ---------- empty & loading states ---------- */
body.appui-on .wd-empty,body.appui-on .miss-card{border:1.5px dashed var(--b);border-radius:var(--r-lg);padding:22px 16px;text-align:center;color:var(--t2);font-size:13px;line-height:1.9;background:var(--card)}
body.appui-on .wd-empty::before,body.appui-on .miss-card::before{content:'';display:block;width:44px;height:44px;margin:0 auto 10px;background:currentColor;opacity:.55;-webkit-mask:var(--appui-empty-ico) center/contain no-repeat;mask:var(--appui-empty-ico) center/contain no-repeat}
body.appui-on .wd-empty{--appui-empty-ico:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M9 3 5 6 3 9l3 1v9h12v-9l3-1-2-3-4-3a3 3 0 0 1-6 0Z"/></svg>')}
body.appui-on .miss-card{--appui-empty-ico:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 8v5M12 16.5v.01"/></svg>')}
body.appui-on .skel{position:relative;overflow:hidden;background:var(--card);border-radius:var(--r-md);min-height:14px}
body.appui-on .skel::after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.09),transparent);animation:appui-shimmer 1.3s infinite}
@keyframes appui-shimmer{from{transform:translateX(-100%)}to{transform:translateX(100%)}}

/* ---------- touch targets ---------- */
@media(max-width:639px){
  body.appui-on .tbtn,body.appui-on .gold-btn,body.appui-on .ghost-btn{min-height:44px}
  body.appui-on .chip,body.appui-on .pill{min-height:40px}
  body.appui-on .more-item{min-height:52px;font-size:15px;display:flex;align-items:center;gap:12px}
  body.appui-on .more-item svg{width:21px;height:21px;stroke:var(--g);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
}

/* ---------- RTL / LTR polish ---------- */
body.appui-on .tab-lbl{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis}
html[dir=ltr] body.appui-on .ab-title{text-align:left}

/* merge fix: our app shows its own .ti icon inside each tab on mobile; keep only appui's icon + label */
body.appui-on #app>.tabbar .tab .tab-lbl .ti{display:none}
body.appui-on #app>.tabbar .tab .tab-lbl .tl{display:block;font-size:10px;font-weight:700}
