/* nexutils mobile global styles — add to every page */

/* Remove iOS tap highlight flash */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  box-sizing: border-box;
}

/* Prevent any horizontal overflow on any page */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Remove 300ms tap delay on all interactive elements */
a, button, input, select, textarea, label, [role="button"] {
  touch-action: manipulation;
}

/* Minimum touch target size — Apple HIG 44px, Google Material 48px */
button, .btn, .tool-card, .category-pill,
input[type="submit"], input[type="button"],
input[type="reset"], [role="button"] {
  min-height: 44px;
  min-width: 44px;
}

/* Prevent iOS zoom on input focus — must be 16px or higher */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="url"],
input[type="password"],
textarea,
select {
  font-size: 16px !important;
  min-height: 44px;
}

/* Images never overflow */
img, canvas, video, iframe, svg {
  max-width: 100%;
}

/* Tables get horizontal scroll wrapper behavior */
table {
  word-break: break-word;
}

/* Momentum scroll on all scrollable containers */
.scroll-container,
.table-scroll,
.horizontal-scroll,
.tool-cards-row {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Page bottom padding for mobile bottom nav bar */
@media (max-width: 767px) {
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  /* Container padding — content never touches screen edges */
  .container, .tool-container, .page-wrapper {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Typography — minimum readable sizes */
  body { font-size: 15px; line-height: 1.6; }
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  h3 { font-size: 17px; }
  p, li, label, span { font-size: 15px; }
  small, .caption, .helper-text { font-size: 13px; }

  /* Buttons full-width on mobile for primary actions */
  .btn-primary, .btn-download, .btn-generate,
  .btn-calculate, .btn-convert, .btn-compress {
    width: 100%;
    height: 52px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 12px;
  }

  /* Select dropdowns */
  select {
    min-height: 48px;
    padding: 10px 36px 10px 14px;
    border-radius: 8px;
  }

  /* Spacing between form rows */
  .form-row + .form-row,
  .input-group + .input-group {
    margin-top: 16px;
  }

  /* Safe area for fixed/sticky elements */
  .header-fixed {
    padding-top: env(safe-area-inset-top);
  }

  .bottom-fixed {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
}

/* Range input mobile styling — all sliders site-wide */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--color-border-tertiary, #e5e7eb);
  outline: none;
  cursor: pointer;
  touch-action: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent, #4F46E5);
  border: 3px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: transform 0.1s ease;
}

input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent, #4F46E5);
  border: 3px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  cursor: pointer;
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: var(--color-border-tertiary, #e5e7eb);
}

/* Slider value bubble */
.slider-wrapper {
  position: relative;
  padding-top: 28px;
}

.slider-bubble {
  position: absolute;
  top: 0;
  background: var(--accent, #4F46E5);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 6px;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
}

.slider-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--accent, #4F46E5);
}
