/* PDFPremium.pro Professional UI & Responsive Layer — 2026-08-08 */
:root{
  --pp-blue:#2563eb;
  --pp-blue-2:#1d4ed8;
  --pp-violet:#7c3aed;
  --pp-cyan:#06b6d4;
  --pp-success:#15803d;
  --pp-danger:#b91c1c;
  --pp-ring:0 0 0 4px rgba(37,99,235,.18);
  --pp-card-shadow:0 10px 35px rgba(15,23,42,.08);
  --pp-card-shadow-hover:0 20px 50px rgba(37,99,235,.16);
  --pp-safe-bottom:env(safe-area-inset-bottom,0px);
  --pp-safe-top:env(safe-area-inset-top,0px);
}

html{
  max-width:100%;
  overflow-x:clip;
  scrollbar-gutter:stable;
  text-size-adjust:100%;
  -webkit-text-size-adjust:100%;
}
body{
  max-width:100%;
  overflow-x:clip;
  min-height:100dvh;
  text-rendering:optimizeLegibility;
}
body.pp-modal-open{overflow:hidden; overscroll-behavior:none;}
img,svg,video,canvas{max-width:100%; height:auto;}
button,input,select,textarea{font:inherit;}
button,[role="button"],a{touch-action:manipulation;}
button:disabled{cursor:not-allowed; opacity:.62;}
:focus{outline:none;}
:focus-visible{
  outline:3px solid rgba(37,99,235,.55);
  outline-offset:3px;
}
input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:none;
  border-color:var(--pp-blue)!important;
  box-shadow:var(--pp-ring)!important;
}

/* Header and navigation */
header{
  padding-top:var(--pp-safe-top);
  box-shadow:0 1px 0 rgba(255,255,255,.06),0 10px 34px rgba(2,6,23,.18);
}
header nav{min-width:0;}
.logo{min-width:0;}
.logo-text{white-space:nowrap;}
.nav-links,.nav-item{min-width:0;}
.theme-btn,.dots-btn,.pp-settings-btn{
  min-width:42px;
  min-height:42px;
  display:inline-grid;
  place-items:center;
}

/* Fix wide desktop mega menus: center them in the viewport instead of anchoring
   a 900px panel to the right-most navigation label. */
@media (min-width:901px){
  .nav-item .mega-menu.mega-full{
    position:fixed;
    top:72px;
    left:50%;
    right:auto;
    width:min(900px,calc(100vw - 32px));
    max-width:calc(100vw - 32px);
    transform:translate(-50%,10px);
    transform-origin:top center;
  }
  .nav-item:hover .mega-menu.mega-full,
  .nav-item:focus-within .mega-menu.mega-full{
    opacity:1;
    pointer-events:auto;
    transform:translate(-50%,0);
  }
  .mega-menu.mega-full::before{display:none;}
}

/* Homepage surfaces and cards */
.tool-card,.category-card,.feat-card,.review-card,.blog-card,.stat-card,
.faq-item,.related-card,.card{
  isolation:isolate;
}
.tool-card{
  position:relative;
  overflow:hidden;
  border-color:rgba(37,99,235,.12)!important;
  box-shadow:var(--pp-card-shadow);
  transform:translateZ(0);
}
.tool-card::before{
  content:"";
  position:absolute;
  inset:0 0 auto;
  height:3px;
  background:linear-gradient(90deg,var(--pp-blue),var(--pp-violet),var(--pp-cyan));
  opacity:0;
  transition:opacity .2s ease;
}
.tool-card:hover,.tool-card:focus-visible{
  border-color:rgba(37,99,235,.34)!important;
  box-shadow:var(--pp-card-shadow-hover);
}
.tool-card:hover::before,.tool-card:focus-visible::before{opacity:1;}
.tool-card .badge{
  border:1px solid rgba(21,128,61,.16);
  background:rgba(22,163,74,.08);
}
.category-card,.feat-card,.review-card,.blog-card,.stat-card,.related-card,.faq-item{
  box-shadow:0 6px 24px rgba(15,23,42,.055);
}
.q-chip,.tab-btn,.cta-btn,.btn,.dl-btn,.review-add-btn,.review-submit{
  min-height:44px;
}

/* Modal: safe, keyboard-friendly, responsive, and no horizontal overflow */
.overlay{
  padding:clamp(8px,2.5vw,24px);
  overscroll-behavior:contain;
}
.overlay .modal{
  width:min(760px,100%);
  max-width:min(760px,100%);
  max-height:min(90dvh,920px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.5);
  box-shadow:0 34px 100px rgba(2,6,23,.38);
}
.modal-head{
  flex:0 0 auto;
  position:relative;
  z-index:3;
  background:color-mix(in srgb,var(--surface) 94%,transparent);
  -webkit-backdrop-filter:blur(16px);
  backdrop-filter:blur(16px);
}
.modal-head > div:first-child{min-width:0;}
.modal-head h3{overflow-wrap:anywhere;}
.modal-close{
  flex:0 0 auto;
  width:42px;
  height:42px;
  min-width:42px;
  min-height:42px;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  background:var(--surface-2);
  color:var(--ink-soft);
  border-radius:12px;
  cursor:pointer;
}
.modal-close:hover{background:var(--surface-3); color:var(--ink);}
.modal-body{
  min-width:0;
  min-height:0;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  padding-bottom:calc(32px + var(--pp-safe-bottom));
}
.modal-body > *{max-width:100%;}
.modal-body [style*="display:grid"]{max-width:100%; width:100%;}
.modal-body [style*="display:grid"] > *{min-width:0; max-width:100%;}
.modal-body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
.modal-body select,.modal-body textarea{
  min-width:0!important;
  max-width:100%!important;
}
.modal-body textarea{resize:vertical;}
.modal-body .opt-row{min-width:0;}
.modal-body .action-row{gap:10px; flex-wrap:wrap;}
.modal-body .btn,.modal-body .dl-btn{
  min-height:46px;
  padding-inline:18px;
}
.modal-body .dropzone{
  border-width:2px;
  border-style:dashed;
  transition:border-color .2s ease,background .2s ease,transform .2s ease;
}
.modal-body .dropzone:hover,.modal-body .dropzone:focus-within{
  border-color:var(--pp-blue);
  background:rgba(37,99,235,.055);
}
.status-msg.active,.result-box.active{border-radius:14px;}
.status-msg.err{color:var(--pp-danger);}
.status-msg.ok{color:var(--pp-success);}
.progress{overflow:hidden; border-radius:999px;}
.progress-bar{background:linear-gradient(90deg,var(--pp-blue),var(--pp-violet),var(--pp-cyan));}

/* Public tool landing pages */
.tool-hero{
  position:relative;
  isolation:isolate;
  overflow:hidden;
  background:
    radial-gradient(600px 260px at 12% -10%,rgba(255,255,255,.24),transparent 65%),
    radial-gradient(620px 300px at 92% 110%,rgba(6,182,212,.22),transparent 68%),
    linear-gradient(135deg,#1d4ed8 0%,#4f46e5 48%,#7c3aed 100%)!important;
}
.tool-hero::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  opacity:.22;
  background-image:linear-gradient(rgba(255,255,255,.12) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.12) 1px,transparent 1px);
  background-size:36px 36px;
  -webkit-mask-image:linear-gradient(to bottom,black,transparent 92%);
  mask-image:linear-gradient(to bottom,black,transparent 92%);
}
.tool-hero .th-icon{
  width:76px;
  height:76px;
  margin:0 auto 16px;
  display:grid;
  place-items:center;
  border-radius:22px;
  background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.3);
  box-shadow:0 16px 50px rgba(15,23,42,.2);
}
.tool-hero .crumbs{color:rgba(255,255,255,.76)!important;}
.tool-hero .crumbs a{color:#fff!important; text-decoration:underline!important; text-underline-offset:3px;}
.cta-btn{
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:50px;
  box-shadow:0 14px 34px rgba(15,23,42,.22)!important;
}
article{overflow-wrap:anywhere;}
article h2{scroll-margin-top:90px;}
article a{text-decoration:underline; text-underline-offset:3px;}
.faq-item,.related-card{
  transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease;
}
.faq-item:hover,.related-card:hover{
  border-color:rgba(37,99,235,.28);
  box-shadow:0 14px 34px rgba(37,99,235,.11);
}
#seoFooter{overflow-wrap:anywhere;}

/* Preference panel */
.pp-settings-btn{
  margin-right:8px;
  border:1px solid var(--line-light);
  border-radius:50%;
  background:rgba(255,255,255,.08);
  color:#fff;
  font-size:1.02rem;
  cursor:pointer;
  flex-shrink:0;
}
.pp-settings-btn:hover{background:rgba(255,255,255,.14);}
.pp-prefs-overlay{
  position:fixed;
  inset:0;
  z-index:10020;
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(2,6,23,.52);
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
}
.pp-prefs-overlay.open{display:flex;}
.pp-prefs-card{
  width:min(460px,100%);
  max-height:88dvh;
  overflow:auto;
  background:var(--surface,#fff);
  color:var(--ink,#0f172a);
  border:1px solid var(--line,rgba(15,23,42,.1));
  border-radius:24px;
  box-shadow:0 30px 90px rgba(2,6,23,.36);
  padding:24px;
}
.pp-prefs-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:18px;}
.pp-prefs-head h2{font-size:1.25rem;margin:0;}
.pp-prefs-close{width:40px;height:40px;border-radius:12px;border:1px solid var(--line);background:var(--surface-2);color:var(--ink);cursor:pointer;}
.pp-pref-group{padding:16px 0;border-top:1px solid var(--line);}
.pp-pref-group:first-of-type{border-top:0;}
.pp-pref-label{font-weight:750;font-size:.9rem;margin-bottom:9px;}
.pp-pref-help{font-size:.78rem;color:var(--ink-soft);margin-top:7px;}
.pp-segment{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}
.pp-segment button,.pp-toggle-row{
  min-height:44px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface-2);
  color:var(--ink);
  cursor:pointer;
}
.pp-segment button.active{background:var(--pp-blue);border-color:var(--pp-blue);color:#fff;}
.pp-toggle-row{width:100%;padding:11px 13px;display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:left;}
.pp-toggle-dot{width:44px;height:24px;border-radius:999px;background:#94a3b8;padding:3px;transition:background .2s ease;flex:0 0 auto;}
.pp-toggle-dot::after{content:"";display:block;width:18px;height:18px;border-radius:50%;background:#fff;transition:transform .2s ease;box-shadow:0 1px 4px rgba(0,0,0,.25);}
.pp-toggle-row[aria-pressed="true"] .pp-toggle-dot{background:var(--pp-blue);}
.pp-toggle-row[aria-pressed="true"] .pp-toggle-dot::after{transform:translateX(20px);}
.pp-reset-btn{width:100%;min-height:44px;border:1px solid var(--line);border-radius:12px;background:transparent;color:var(--ink-soft);font-weight:650;cursor:pointer;}

/* Offline indicator */
.pp-network-status{
  position:fixed;
  left:50%;
  bottom:calc(16px + var(--pp-safe-bottom));
  z-index:10050;
  transform:translate(-50%,130%);
  opacity:0;
  pointer-events:none;
  padding:10px 16px;
  border-radius:999px;
  background:#111827;
  color:#fff;
  box-shadow:0 10px 30px rgba(0,0,0,.28);
  font-size:.82rem;
  font-weight:650;
  transition:transform .25s ease,opacity .25s ease;
}
.pp-network-status.show{transform:translate(-50%,0);opacity:1;}
.pp-network-status.online{background:#166534;}

/* User preferences */
html[data-pp-motion="reduced"] *,
html[data-pp-motion="reduced"] *::before,
html[data-pp-motion="reduced"] *::after{
  animation-duration:.01ms!important;
  animation-iteration-count:1!important;
  scroll-behavior:auto!important;
  transition-duration:.01ms!important;
}
html[data-pp-density="compact"] .tool-card{padding:15px!important;gap:7px!important;}
html[data-pp-density="compact"] .tool-card p{display:none;}
html[data-pp-density="compact"] .tools-grid{gap:12px!important;}

/* Tablet and mobile */
@media (max-width:900px){
  .nav-item .mega-menu.mega-full{
    position:static;
    width:100%;
    max-width:100%;
    transform:none;
  }
  .nav-links{padding-bottom:calc(24px + var(--pp-safe-bottom))!important;}
}
@media (max-width:640px){
  .overlay{
    align-items:flex-end;
    padding:0;
  }
  .overlay .modal{
    width:100%;
    max-width:100%;
    max-height:94dvh;
    border-radius:24px 24px 0 0!important;
    border-bottom:0;
  }
  .modal-head{padding:18px 16px 14px!important;}
  .modal-head h3{font-size:1.15rem!important;}
  .modal-head p{font-size:.82rem!important;}
  .modal-body{padding:18px 16px calc(24px + var(--pp-safe-bottom))!important;}
  .modal-body [style*="grid-template-columns"]{
    grid-template-columns:minmax(0,1fr)!important;
  }
  .modal-body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  .modal-body select,.modal-body textarea{font-size:16px!important;}
  .modal-body .action-row .btn,.modal-body .action-row .dl-btn{width:100%;justify-content:center;}
  .pp-prefs-overlay{align-items:flex-end;padding:0;}
  .pp-prefs-card{width:100%;max-height:92dvh;border-radius:24px 24px 0 0;padding:20px 16px calc(20px + var(--pp-safe-bottom));}
  .tool-hero{padding:44px 18px 38px!important;}
  .tool-hero .th-icon{width:66px;height:66px;border-radius:19px;font-size:2.7rem!important;}
  .tool-hero h1{font-size:clamp(1.45rem,7vw,1.85rem)!important;}
  .tool-hero p{font-size:.96rem!important;}
  .cta-btn{width:min(100%,340px);padding-inline:20px!important;}
  .trust{gap:10px 16px!important;}
}
@media (max-width:380px){
  nav{padding-inline:14px!important;}
  .logo{font-size:1.05rem!important;}
  .theme-btn,.dots-btn,.pp-settings-btn{min-width:38px;min-height:38px;width:38px;height:38px;margin-right:4px;}
  .modal-head{padding-inline:13px!important;}
  .modal-body{padding-inline:13px!important;}
  .pp-segment{grid-template-columns:1fr;}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;}
}

/* Fallback for browsers without color-mix */
@supports not (background:color-mix(in srgb,white 50%,black)){
  .modal-head{background:var(--surface,#fff);}
}
