/* ==========================================================================
   webtools4all.com — Apple Design Language & Adaptive Dark Theme (DESIGN.md)
   ========================================================================== */

/* ── CSS Variable Tokens (Light Theme Default) ── */
:root {
  --apple-primary: #0066cc;
  --apple-primary-focus: #0071e3;
  --apple-primary-on-dark: #2997ff;
  --apple-ink: #1d1d1f;
  --apple-muted: #86868b;
  --apple-parchment: #f5f5f7;
  --apple-pearl: #fafafc;
  --apple-hairline: #e5e5ea;
  --apple-divider: #d2d2d7;
  --apple-card-bg: #ffffff;
  --apple-card-secondary: #fafafc;
  --apple-code-bg: #fafafc;
  --apple-code-text: #1d1d1f;
  --apple-input-bg: #ffffff;
  --apple-input-border: #d2d2d7;
  --apple-input-text: #1d1d1f;
  --apple-card-radius: 18px;
}

/* ── Dark Theme Tokens ── */
html.dark {
  --apple-primary: #2997ff;
  --apple-primary-focus: #0071e3;
  --apple-primary-on-dark: #2997ff;
  --apple-ink: #f5f5f7;
  --apple-muted: #98989d;
  --apple-parchment: #000000;
  --apple-pearl: #161617;
  --apple-hairline: #2c2c2e;
  --apple-divider: #38383a;
  --apple-card-bg: #1c1c1e;
  --apple-card-secondary: #2c2c2e;
  --apple-code-bg: #161618;
  --apple-code-text: #f5f5f7;
  --apple-input-bg: #1c1c1e;
  --apple-input-border: #38383a;
  --apple-input-text: #f5f5f7;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  color: var(--apple-ink);
  background-color: var(--apple-parchment);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  transition: background-color 200ms ease, color 200ms ease;
}

/* ── Typography Standards ── */
.apple-headline {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.25;
}

/* ── Top-Left to Bottom-Right Branding Gradient (135deg) ── */
.apple-gradient-heading {
  background: linear-gradient(135deg, #0066cc 0%, #3052ff 25%, #5856d6 55%, #af52de 80%, #ff2d55 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  display: inline-block;
  padding-bottom: 0.15em;
  line-height: 1.25;
}

html.dark .apple-gradient-heading {
  background: linear-gradient(135deg, #2997ff 0%, #5e5ce6 35%, #bf5af2 70%, #ff375f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* ── Showcased Gradient Number ── */
.apple-gradient-number {
  font-size: 1.35em;
  font-weight: 800;
  letter-spacing: -0.035em;
  background: linear-gradient(135deg, #0066cc 0%, #3052ff 25%, #5856d6 55%, #af52de 80%, #ff2d55 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  display: inline-block;
  vertical-align: baseline;
  line-height: 1;
}

html.dark .apple-gradient-number {
  background: linear-gradient(135deg, #2997ff 0%, #5e5ce6 35%, #bf5af2 70%, #ff375f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* ── Apple Action Buttons (Pill Grammar) ── */
.btn-apple-primary {
  background-color: var(--apple-primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 400;
  padding: 8px 18px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: none;
  text-decoration: none;
  outline: none;
  user-select: none;
  min-height: 38px;
}

.btn-apple-primary:hover {
  background-color: var(--apple-primary-focus);
}

.btn-apple-primary:active {
  transform: scale(0.96);
}

.btn-apple-secondary {
  background-color: transparent;
  color: var(--apple-primary);
  border: 1px solid var(--apple-primary);
  font-size: 14px;
  font-weight: 400;
  padding: 7px 17px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  text-decoration: none;
  outline: none;
  user-select: none;
  min-height: 38px;
}

.btn-apple-secondary:hover {
  background-color: rgba(0, 102, 204, 0.08);
}

html.dark .btn-apple-secondary:hover {
  background-color: rgba(41, 151, 255, 0.15);
}

.btn-apple-secondary:active {
  transform: scale(0.96);
}

.btn-apple-ghost {
  background-color: var(--apple-card-bg);
  color: var(--apple-ink);
  border: 1px solid var(--apple-hairline);
  font-size: 13px;
  font-weight: 400;
  padding: 6px 14px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 150ms ease;
  cursor: pointer;
  user-select: none;
  min-height: 34px;
}

.btn-apple-ghost:hover {
  background-color: var(--apple-pearl);
  border-color: var(--apple-divider);
}

.btn-apple-ghost:active {
  transform: scale(0.96);
}

/* ── Apple Cards & Tiles ── */
.apple-card {
  background-color: var(--apple-card-bg);
  border: 1px solid var(--apple-hairline);
  border-radius: var(--apple-card-radius);
  transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.apple-card:hover {
  border-color: var(--apple-divider);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.06);
}

html.dark .apple-card {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

html.dark .apple-card:hover {
  border-color: #48484a;
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.6);
}

/* ── Apple Input Elements ── */
.apple-input,
.apple-textarea,
.apple-select {
  width: 100%;
  background-color: var(--apple-input-bg);
  border: 1px solid var(--apple-input-border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--apple-input-text);
  outline: none;
  transition: all 180ms ease;
  font-family: inherit;
}

.apple-input:focus,
.apple-textarea:focus,
.apple-select:focus {
  border-color: var(--apple-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

html.dark .apple-input:focus,
html.dark .apple-textarea:focus,
html.dark .apple-select:focus {
  box-shadow: 0 0 0 3px rgba(41, 151, 255, 0.25);
}

.apple-textarea {
  font-family: "SF Mono", "JetBrains Mono", Menlo, monospace;
  line-height: 1.6;
}

.apple-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2386868b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ── iOS / Apple Range Slider ── */
input[type="range"].apple-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--apple-hairline);
  border-radius: 3px;
  outline: none;
  margin: 10px 0;
}

input[type="range"].apple-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  background: #ffffff;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2), 0 1px 1px rgba(0, 0, 0, 0.1);
  transition: transform 120ms ease;
}

html.dark input[type="range"].apple-range::-webkit-slider-thumb {
  background: #f5f5f7;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
}

input[type="range"].apple-range::-webkit-slider-thumb:hover {
  transform: scale(1.08);
}

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

/* ── Apple Switch Toggle ── */
.apple-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.apple-toggle-input {
  display: none;
}

.apple-toggle-switch {
  width: 44px;
  height: 26px;
  background-color: var(--apple-hairline);
  border-radius: 13px;
  position: relative;
  transition: background-color 220ms ease;
  flex-shrink: 0;
}

.apple-toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background-color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-toggle-input:checked + .apple-toggle-switch {
  background-color: #34c759;
}

.apple-toggle-input:checked + .apple-toggle-switch::after {
  transform: translateX(18px);
}

/* ── Code Output & Monospace Containers ── */
.apple-code-box {
  background-color: var(--apple-code-bg);
  border: 1px solid var(--apple-hairline);
  border-radius: 12px;
  padding: 16px;
  font-family: "SF Mono", "JetBrains Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--apple-code-text);
  line-height: 1.65;
  overflow-x: auto;
  word-break: break-all;
}

/* ── Drop Zone (Clean Apple Style) ── */
.apple-dropzone {
  border: 2px dashed var(--apple-divider);
  border-radius: 16px;
  padding: 40px 24px;
  background-color: var(--apple-card-secondary);
  text-align: center;
  cursor: pointer;
  transition: all 200ms ease;
}

.apple-dropzone:hover,
.apple-dropzone.dragover {
  border-color: var(--apple-primary);
  background-color: rgba(0, 102, 204, 0.04);
}

html.dark .apple-dropzone:hover,
html.dark .apple-dropzone.dragover {
  background-color: rgba(41, 151, 255, 0.08);
}

/* ── Professional Interactive Crop Box & Overlay ── */
.crop-container-wrapper {
  position: relative;
  user-select: none;
  touch-action: none;
  overflow: hidden;
  max-width: 100%;
  display: inline-block;
}

.crop-box {
  position: absolute;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65);
  cursor: move;
  box-sizing: border-box;
  touch-action: none;
}

/* Rule of Thirds Lines */
.crop-grid-line-h {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.crop-grid-line-v {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

/* Crop Corner & Edge Handles */
.crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border: 2px solid var(--apple-primary);
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  z-index: 10;
  touch-action: none;
}

.handle-nw { top: -7px; left: -7px; cursor: nwse-resize; }
.handle-ne { top: -7px; right: -7px; cursor: nesw-resize; }
.handle-sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.handle-se { bottom: -7px; right: -7px; cursor: nwse-resize; }
.handle-n { top: -7px; left: calc(50% - 7px); cursor: ns-resize; }
.handle-s { bottom: -7px; left: calc(50% - 7px); cursor: ns-resize; }
.handle-w { top: calc(50% - 7px); left: -7px; cursor: ew-resize; }
.handle-e { top: calc(50% - 7px); right: -7px; cursor: ew-resize; }

/* ── Mobile iOS Bottom Tab Bar Active Item ── */
.mobile-tab-btn.active {
  color: var(--apple-primary) !important;
}

.mobile-tab-btn.active span:first-child {
  transform: scale(1.1);
  transition: transform 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Scrollbars ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #c7c7cc;
  border-radius: 3px;
}

html.dark ::-webkit-scrollbar-thumb {
  background: #38383a;
}

::-webkit-scrollbar-thumb:hover {
  background: #8e8e93;
}

html.dark ::-webkit-scrollbar-thumb:hover {
  background: #48484a;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ── Micro-Animations ── */
@keyframes appleFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-apple-fade {
  animation: appleFadeIn 320ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── Highlight Match for Search ── */
.search-highlight {
  background-color: #ffe58f;
  color: #1d1d1f;
  padding: 0 2px;
  border-radius: 2px;
}

html.dark .search-highlight {
  background-color: rgba(255, 214, 10, 0.35);
  color: #ffffff;
}

/* ── FAQ Accordion ── */
.faq-accordion details {
  overflow: hidden;
}

.faq-accordion details[open] .faq-answer {
  animation: faqSlideDown 250ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes faqSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.faq-accordion summary {
  list-style: none;
}

.faq-accordion summary::-webkit-details-marker,
.faq-accordion summary::marker {
  display: none;
}

/* ── Blog & Legal Page Typography ── */
.wtb-prose {
  font-size: 15px;
  line-height: 1.75;
  color: var(--apple-ink);
}

.wtb-prose h2 {
  font-size: 22px;
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 0.75em;
  letter-spacing: -0.02em;
  color: var(--apple-ink);
}

.wtb-prose h3 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  letter-spacing: -0.015em;
  color: var(--apple-ink);
}

.wtb-prose p {
  margin-bottom: 1em;
}

.wtb-prose ul, .wtb-prose ol {
  margin-bottom: 1em;
  padding-left: 1.5em;
}

.wtb-prose li {
  margin-bottom: 0.4em;
}

.wtb-prose strong {
  font-weight: 600;
  color: var(--apple-ink);
}

.wtb-prose a:not(.btn-apple-primary):not(.tool-cta-btn) {
  color: var(--apple-primary);
  text-decoration: none;
}

.wtb-prose a:not(.btn-apple-primary):not(.tool-cta-btn):hover {
  text-decoration: underline;
}

/* ── High-Converting Tool CTA Button (Psychology-Driven UX) ── */
.tool-cta-btn,
.wtb-prose a.btn-apple-primary,
.wtb-prose a.tool-cta-btn {
  background: linear-gradient(135deg, #0066cc 0%, #3052ff 45%, #5856d6 100%) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  padding: 10px 22px !important;
  border-radius: 9999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  text-decoration: none !important;
  box-shadow: 0 4px 15px rgba(0, 102, 204, 0.35) !important;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  font-size: 13.5px !important;
  letter-spacing: -0.01em !important;
  cursor: pointer !important;
}

html.dark .tool-cta-btn,
html.dark .wtb-prose a.btn-apple-primary,
html.dark .wtb-prose a.tool-cta-btn {
  background: linear-gradient(135deg, #2997ff 0%, #5e5ce6 55%, #af52de 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 18px rgba(41, 151, 255, 0.45) !important;
}

.tool-cta-btn:hover,
.wtb-prose a.btn-apple-primary:hover,
.wtb-prose a.tool-cta-btn:hover {
  transform: translateY(-2px) scale(1.03) !important;
  box-shadow: 0 8px 25px rgba(0, 102, 204, 0.55) !important;
  color: #ffffff !important;
  text-decoration: none !important;
}

html.dark .tool-cta-btn:hover,
html.dark .wtb-prose a.btn-apple-primary:hover,
html.dark .wtb-prose a.tool-cta-btn:hover {
  box-shadow: 0 8px 25px rgba(41, 151, 255, 0.65) !important;
}

.tool-cta-btn:active,
.wtb-prose a.btn-apple-primary:active,
.wtb-prose a.tool-cta-btn:active {
  transform: scale(0.97) !important;
}

/* ── SEO Content Section ── */
.seo-content-section {
  font-size: 14px;
  line-height: 1.8;
  color: #424245;
}

html.dark .seo-content-section {
  color: #98989d;
}

.seo-content-section h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--apple-ink);
  margin-bottom: 0.5em;
  letter-spacing: -0.02em;
}

.seo-content-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--apple-ink);
  margin-bottom: 0.4em;
  margin-top: 1.25em;
  letter-spacing: -0.015em;
}

.seo-content-section p {
  margin-bottom: 0.85em;
}

.seo-content-section ul {
  list-style: none;
  padding: 0;
  margin-bottom: 1em;
}

.seo-content-section ul li {
  position: relative;
  padding-left: 1.25em;
  margin-bottom: 0.35em;
}

.seo-content-section ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--apple-primary);
  font-weight: bold;
}

/* ── Blog Card Hover ── */
.blog-card {
  transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.08);
}

html.dark .blog-card:hover {
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.5);
}

/* ── Apple Input Fields, Selects, and Textareas ── */
.apple-input,
.apple-select,
.apple-textarea {
  width: 100%;
  background-color: var(--apple-input-bg);
  color: var(--apple-input-text);
  border: 1px solid var(--apple-input-border);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.apple-input:focus,
.apple-select:focus,
.apple-textarea:focus {
  border-color: var(--apple-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

html.dark .apple-input:focus,
html.dark .apple-select:focus,
html.dark .apple-textarea:focus {
  box-shadow: 0 0 0 3px rgba(41, 151, 255, 0.25);
}

.apple-input::placeholder,
.apple-textarea::placeholder {
  color: var(--apple-muted);
  opacity: 0.8;
}

.apple-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2386868b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 32px;
}

.apple-textarea {
  resize: vertical;
  min-height: 80px;
}


