/*
 * Atheel App: styles applied only when the site runs as an app.
 * Every rule is scoped under html.atheel-app (or a narrower class), so the
 * normal website is not affected.
 */

/* ---------- Touch and feel ---------- */
html.atheel-app {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
html.atheel-app body {
  overscroll-behavior-y: none;           /* no rubber-band reveal of the page edges */
  -webkit-touch-callout: none;           /* no long-press link preview popups */
}
html.atheel-app a,
html.atheel-app button,
html.atheel-app [role="button"],
html.atheel-app input[type="submit"] {
  touch-action: manipulation;            /* removes the 300ms double-tap delay */
}

/* Tappable targets at least 44px, the size Apple and Google both recommend. */
html.atheel-app button,
html.atheel-app .button,
html.atheel-app input[type="submit"],
html.atheel-app input[type="button"] {
  min-height: 44px;
}

/* Stop iOS from zooming in when a student taps a text box. */
html.atheel-app input[type="text"],
html.atheel-app input[type="email"],
html.atheel-app input[type="password"],
html.atheel-app input[type="search"],
html.atheel-app input[type="tel"],
html.atheel-app input[type="number"],
html.atheel-app select,
html.atheel-app textarea {
  font-size: 16px !important;
}

/* Keep text selectable inside lessons and answers (writing tasks, reading texts). */
html.atheel-app p,
html.atheel-app li,
html.atheel-app textarea,
html.atheel-app input {
  -webkit-user-select: text;
  user-select: text;
}

/* Media never wider than the screen. */
html.atheel-app img,
html.atheel-app video,
html.atheel-app iframe {
  max-width: 100%;
}
html.atheel-app iframe {
  border: 0;
}

/* Wide tables (score tables, timetables) scroll sideways instead of breaking the page. */
html.atheel-app .entry-content table,
html.atheel-app .tutor-table,
html.atheel-app .ld-table-list {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------- Installed web app (PWA) ---------- */
/* The phone status bar sits on top of the page in standalone mode. */
html.atheel-pwa body {
  padding-top: env(safe-area-inset-top);
}
html.atheel-pwa.atheel-has-tabbar body {
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

/* WordPress admin bar is not useful inside the app. */
html.atheel-app #wpadminbar {
  display: none !important;
}
html.atheel-app body.admin-bar {
  margin-top: 0 !important;
}
html.atheel-app {
  margin-top: 0 !important;
}

/* ---------- LearnDash ---------- */
/* Focus Mode (lesson/topic/quiz view) uses a fixed header and sidebar.
   In the installed web app, push them below the phone status bar. */
html.atheel-pwa .ld-focus .ld-focus-header {
  top: env(safe-area-inset-top) !important;
}
html.atheel-pwa .ld-focus .ld-focus-sidebar {
  top: calc(env(safe-area-inset-top) + 60px) !important;
}
/* Leave room for the tab bar under Focus Mode's lesson navigation. */
html.atheel-pwa.atheel-has-tabbar .ld-focus .ld-focus-sidebar {
  bottom: calc(64px + env(safe-area-inset-bottom)) !important;
}
/* Bigger tap targets for lesson navigation, expand buttons and quiz answers. */
html.atheel-app .ld-content-actions .ld-button,
html.atheel-app .ld-expand-button,
html.atheel-app .ld-item-list-item-preview {
  min-height: 44px;
}
html.atheel-app .wpProQuiz_questionListItem label {
  display: block;
  padding: 12px 10px;
  min-height: 44px;
}
/* Quiz question images and tables fit the screen. */
html.atheel-app .wpProQuiz_question img {
  height: auto;
}
html.atheel-app .wpProQuiz_content table {
  display: block;
  overflow-x: auto;
}

/* ---------- Bottom tab bar (installed web app only) ---------- */
.atheel-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  display: flex;
  background: #fff;
  border-top: 1px solid rgba(0, 27, 61, 0.1);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 16px rgba(0, 27, 61, 0.06);
}
.atheel-tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 60px;
  color: #6b7a90;
  text-decoration: none !important;
  font: 600 11px/1.1 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", sans-serif;
}
.atheel-tabbar a svg {
  width: 24px;
  height: 24px;
}
.atheel-tabbar a.is-active {
  color: var(--atheel-navy, #001B3D);
}
.atheel-tabbar a.is-active svg {
  color: var(--atheel-gold, #D4AF37);
}

/* ---------- Page loading bar (both app types) ---------- */
.atheel-progress {
  position: fixed;
  top: env(safe-area-inset-top);
  left: 0;
  height: 3px;
  width: 0;
  background: var(--atheel-gold, #D4AF37);
  z-index: 100000;
  transition: width 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}

/* ---------- Install banner (mobile browser visitors only) ---------- */
.atheel-install {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--atheel-navy, #001B3D);
  color: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  font: 14px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", sans-serif;
  animation: atheel-up 0.35s ease;
}
.atheel-install img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex: none;
}
.atheel-install strong {
  display: block;
  font-size: 15px;
}
.atheel-install .atheel-install-text {
  flex: 1;
  min-width: 0;
}
.atheel-install button {
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-height: 36px;
}
.atheel-install .atheel-install-go {
  background: var(--atheel-gold, #D4AF37);
  color: var(--atheel-navy, #001B3D);
  padding: 8px 16px;
}
.atheel-install .atheel-install-close {
  background: transparent;
  color: #fff;
  opacity: 0.7;
  padding: 4px 8px;
  font-size: 20px;
  line-height: 1;
}
@keyframes atheel-up {
  from { transform: translateY(120%); }
  to { transform: translateY(0); }
}

/* ---------- CliQ payment box (website + installed web app) ---------- */
/* Hidden in the App Store / Google Play apps: store billing rules. */
html.atheel-native .atheel-cliq {
  display: none !important;
}
.atheel-cliq {
  max-width: 460px;
  margin: 24px 0;
  padding: 20px;
  background: #fff;
  border: 1px solid rgba(0, 27, 61, 0.12);
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0, 27, 61, 0.06);
  color: var(--atheel-navy, #001B3D);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", sans-serif;
}
.atheel-cliq small {
  display: block;
  font-size: 12px;
  opacity: 0.65;
}
.atheel-cliq-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.atheel-cliq-head strong {
  display: block;
  font-size: 18px;
}
.atheel-cliq-head span:not(.atheel-cliq-badge) {
  font-size: 13px;
  opacity: 0.7;
}
.atheel-cliq-badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--atheel-navy, #001B3D);
  color: var(--atheel-gold, #D4AF37);
  font-weight: 800;
  font-size: 14px;
}
.atheel-cliq-row {
  display: flex;
  gap: 24px;
  margin-bottom: 12px;
}
.atheel-cliq-alias {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--atheel-bg, #F2F2F2);
  border-radius: 12px;
}
.atheel-cliq-number {
  display: block;
  font-size: 22px;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}
.atheel-cliq-copy {
  flex: none;
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--atheel-navy, #001B3D);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.atheel-cliq-steps {
  margin: 16px 0;
  padding-left: 20px;
}
.atheel-cliq-steps li {
  margin: 6px 0;
}
.atheel-cliq-wa {
  display: block;
  text-align: center;
  padding: 13px 16px;
  border-radius: 999px;
  background: #25D366;
  color: #fff !important;
  font-weight: 700;
  text-decoration: none !important;
}
.atheel-cliq-ar {
  margin: 16px 0 0;
  font-size: 14px;
  opacity: 0.8;
}
