/* ============================================================
   mobile-shared.css — Shared mobile utilities for all tools
   These rules apply on body.ui-mobile regardless of viewport.
   ============================================================ */

/* ── Toggle button ────────────────────────────────────────── */
.ui-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 210, 255, 0.1);
  border: 1px solid rgba(0, 210, 255, 0.4);
  color: #00d2ff;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.ui-toggle-btn:hover,
.ui-toggle-btn:focus-visible {
  background: rgba(0, 210, 255, 0.25);
  border-color: #00d2ff;
  outline: 2px solid rgba(0, 210, 255, 0.7);
  outline-offset: 2px;
}

/* ── Table scroll wrapper ─────────────────────────────────── */
.table-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}
.table-scroll-wrapper table {
  min-width: 480px;
}

/* ── Accordion / collapsible section ─────────────────────── */
.collapsible-section {
  border: 1px solid rgba(0, 210, 255, 0.2);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}
.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(0, 210, 255, 0.06);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  user-select: none;
  min-height: 52px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.collapsible-header::after {
  content: '▼';
  font-size: 0.75rem;
  transition: transform 0.25s;
  color: #00d2ff;
  flex-shrink: 0;
  margin-left: 8px;
}
.collapsible-section.open .collapsible-header::after {
  transform: rotate(-180deg);
}
.collapsible-body {
  padding: 1rem;
}

/* ── Skip link (shared) ───────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -50px;
  left: 8px;
  z-index: 9999;
  padding: 8px 16px;
  background: #00d2ff;
  color: #0a0b10;
  border-radius: 0 0 6px 6px;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.15s;
}
.skip-link:focus { top: 0; }

/* ── Screen-reader only ───────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   body.ui-mobile — genuine mobile experience
   Applied REGARDLESS of viewport when toggle is active.
   ============================================================ */

/* ── Base font & spacing ──────────────────────────────────── */
body.ui-mobile {
  font-size: 16px;
}
body.ui-mobile .container,
body.ui-mobile main {
  padding-left: 10px !important;
  padding-right: 10px !important;
}

/* ── Glass panels: more breathing room ───────────────────── */
body.ui-mobile .glass-panel {
  padding: 18px 14px !important;
  border-radius: 16px !important;
  margin-bottom: 14px !important;
}

/* ── Header: 2-row compact ───────────────────────────────── */
body.ui-mobile .header-section {
  flex-direction: column !important;
  gap: 10px !important;
  padding-bottom: 12px !important;
}
body.ui-mobile .header-left  { width: 100% !important; }
body.ui-mobile .header-right {
  width: 100% !important;
  justify-content: flex-end !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

/* ── Touch targets: all interactive elements 52px min ────── */
body.ui-mobile button:not(.btn-icon-small):not(.plan-modal-close),
body.ui-mobile .tab-btn,
body.ui-mobile select,
body.ui-mobile input:not([type="radio"]):not([type="checkbox"]):not([type="file"]):not([type="hidden"]),
body.ui-mobile textarea {
  min-height: 52px !important;
  font-size: 1rem !important;
}
body.ui-mobile .toggle-switch label {
  min-height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  font-size: 0.95rem !important;
}

/* ── Primary CTA buttons: full-width, prominent ──────────── */
body.ui-mobile .btn-main,
body.ui-mobile #btn-parse,
body.ui-mobile .btn-calc,
body.ui-mobile .btn-update-split,
body.ui-mobile .btn-reset {
  width: 100% !important;
  min-height: 56px !important;
  font-size: 1.15rem !important;
  border-radius: 14px !important;
  letter-spacing: 1px !important;
}

/* ── Secondary action buttons: full-width ────────────────── */
body.ui-mobile .btn-copy,
body.ui-mobile .btn-ticket,
body.ui-mobile .btn-donate-header {
  min-height: 48px !important;
  font-size: 0.95rem !important;
}
body.ui-mobile .btn-copy,
body.ui-mobile .btn-ticket {
  width: 100% !important;
  margin-bottom: 8px !important;
}

/* ── Result numbers: large & readable ────────────────────── */
body.ui-mobile .res-val,
body.ui-mobile .sum-val,
body.ui-mobile .range-val,
body.ui-mobile .big-neon,
body.ui-mobile .val.big {
  font-size: 2.4rem !important;
  line-height: 1.1 !important;
}
body.ui-mobile .res-mini-val {
  font-size: 1.6rem !important;
  line-height: 1.2 !important;
}
body.ui-mobile .metric-tile .res-val,
body.ui-mobile .highlight-card .val {
  font-size: 2.2rem !important;
}

/* ── Inputs: larger, readable ────────────────────────────── */
body.ui-mobile .input-cyber,
body.ui-mobile .input-cyber-large {
  font-size: 1.25rem !important;
  padding: 12px 14px !important;
  min-height: 52px !important;
}

/* ── Tables: horizontal scroll ───────────────────────────── */
body.ui-mobile table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
}

/* Accordion body hidden by default in ui-mobile (JS drives open) */
body.ui-mobile .collapsible-body {
  /* JS sets display:none / display:block */
}

/* ── Utility visibility ───────────────────────────────────── */
body.ui-mobile .ui-desktop-only { display: none !important; }
body.ui-desktop .ui-mobile-only { display: none !important; }
