/* ============================================================
   UX Enhancement Layer — সমস্ত পেজে যুক্ত হয়
   বিদ্যমান style.css ওভাররাইড করে না, শুধু নতুন ফিচার যোগ করে
   ============================================================ */

/* Smooth transitions globally */
.alert { transition: opacity .4s ease, transform .4s ease; }
.alert.ux-dismiss { opacity: 0; transform: translateY(-8px); }

/* Password toggle button */
.ux-pwd-wrap { position: relative; display: block; }
.ux-pwd-wrap input { padding-right: 42px !important; width: 100%; }
.ux-pwd-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; cursor: pointer; font-size: 18px;
  padding: 4px 8px; color: #64748b; line-height: 1;
}
.ux-pwd-toggle:hover { color: #0ea5e9; }

/* Input validation badge */
.ux-validate-msg {
  display: block; font-size: 12px; margin-top: 4px;
  color: #dc2626; min-height: 16px;
}
.ux-validate-msg.ok { color: #16a34a; }
input.ux-invalid { border-color: #dc2626 !important; box-shadow: 0 0 0 2px rgba(220,38,38,.12); }
input.ux-valid { border-color: #16a34a !important; }

/* Submit-in-progress state */
button[disabled].ux-loading,
.btn[disabled].ux-loading {
  opacity: .7; cursor: progress; position: relative;
}
button.ux-loading::after, .btn.ux-loading::after {
  content: ""; display: inline-block; width: 14px; height: 14px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; margin-left: 8px; vertical-align: middle;
  animation: uxSpin .7s linear infinite;
}
@keyframes uxSpin { to { transform: rotate(360deg); } }

/* Back to top */
.ux-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 999;
  width: 42px; height: 42px; border-radius: 50%;
  background: #0ea5e9; color: #fff; border: 0; cursor: pointer;
  font-size: 20px; line-height: 1; box-shadow: 0 6px 18px rgba(14,165,233,.4);
  display: none; transition: transform .2s ease, opacity .3s ease;
}
.ux-top.show { display: block; }
.ux-top:hover { transform: translateY(-2px); }

/* Sidebar mobile backdrop — must sit BELOW the sidebar, ABOVE content */
@media (max-width: 900px) {
  .sidebar { z-index: 101 !important; }
  .sidebar.open ~ .main::before {
    content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.45);
    z-index: 100; animation: uxFade .25s ease;
  }
}
@keyframes uxFade { from { opacity: 0; } to { opacity: 1; } }

/* Network offline banner */
.ux-offline {
  position: fixed; left: 0; right: 0; top: 0; z-index: 9999;
  background: #dc2626; color: #fff; text-align: center;
  padding: 8px 12px; font-size: 14px; transform: translateY(-100%);
  transition: transform .3s ease;
}
.ux-offline.show { transform: translateY(0); }

/* Print: hide non-essentials */
@media print {
  .sidebar, .topbar, .ux-top, .menu-btn, .banner, .alert { display: none !important; }
  .main, .content { margin: 0 !important; padding: 0 !important; }
}

/* Better focus visibility */
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid #0ea5e9; outline-offset: 2px;
}
