@import url("pdf-styles.css");

/* Calculator Club PDF Tools: isolated styles */
#pdf-tools,
.cc-pdf-page {
  --pdf-ink: #172033;
  --pdf-muted: #5f6b7a;
  --pdf-line: #dce3ec;
  --pdf-soft: #f4f8fb;
  --pdf-card: #ffffff;
  --pdf-blue: #155eef;
  --pdf-teal: #0e9384;
  --pdf-gold: #b7791f;
  --pdf-danger: #b42318;
  color: var(--pdf-ink);
}

#pdf-tools *,
.cc-pdf-page * {
  box-sizing: border-box;
}

#pdf-tools {
  margin: 38px 0;
  scroll-margin-top: 84px;
  isolation: isolate;
}

.cc-pdf-shell {
  display: grid;
  gap: 18px;
}

.cc-pdf-hero,
.cc-pdf-tool,
.cc-pdf-content,
.cc-pdf-sidebar,
.cc-pdf-blog-card {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(21, 94, 239, 0.12);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(23, 32, 51, 0.1);
}

.cc-pdf-hero {
  display: grid;
  gap: 20px;
  padding: clamp(22px, 5vw, 42px);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(21, 94, 239, 0.08), rgba(14, 147, 132, 0.08)),
    #ffffff;
}

.cc-pdf-hero h1,
.cc-pdf-hero h2,
.cc-pdf-content h1,
.cc-pdf-content h2 {
  margin: 0 0 12px;
  color: var(--pdf-ink);
  letter-spacing: 0;
}

.cc-pdf-hero p,
.cc-pdf-content p,
.cc-pdf-tool p,
.cc-pdf-card p {
  color: var(--pdf-muted);
}

.cc-pdf-privacy-row,
.cc-pdf-chip-row,
.cc-pdf-tool-grid,
.cc-pdf-action-row,
.cc-pdf-file-list,
.cc-pdf-tool-tabs,
.cc-pdf-link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cc-pdf-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(15, 118, 110, 0.25);
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: #075e57;
  font-size: 13px;
  font-weight: 700;
}

.cc-pdf-ad {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #aeb9c7;
  border-radius: 8px;
  background: #f2f5f8;
  color: #667085;
  font-size: 13px;
  margin: 18px 0;
  contain: layout paint;
}

.cc-pdf-ad[data-ad-slot="mobile-sticky"] {
  display: none;
}

.cc-pdf-layout {
  display: grid;
  gap: 18px;
}

.cc-pdf-tool {
  padding: clamp(14px, 3vw, 22px);
  scroll-margin-top: 86px;
  background:
    linear-gradient(180deg, rgba(247, 250, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.cc-pdf-tool-tabs {
  margin-bottom: 14px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.cc-pdf-tab,
.cc-pdf-button,
.cc-pdf-secondary,
.cc-pdf-icon-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.cc-pdf-tab {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 10px 12px;
  background: #eef3f8;
  color: var(--pdf-muted);
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cc-pdf-tab[aria-selected="true"] {
  background: linear-gradient(135deg, var(--pdf-blue), var(--pdf-teal));
  color: #fff;
}

.cc-pdf-button {
  min-height: 48px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--pdf-blue), #0f766e);
  color: #fff;
}

.cc-pdf-secondary {
  min-height: 44px;
  padding: 10px 14px;
  background: #e9eff7;
  color: var(--pdf-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.cc-pdf-button:hover,
.cc-pdf-secondary:hover,
.cc-pdf-tab:hover {
  transform: translateY(-1px);
}

.cc-pdf-button:disabled,
.cc-pdf-secondary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.cc-pdf-dropzone {
  position: relative;
  display: grid;
  gap: 16px;
  min-height: 236px;
  padding: clamp(16px, 4vw, 26px);
  border: 2px dashed rgba(21, 94, 239, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(251, 253, 255, 0.9) 0%, rgba(238, 246, 255, 0.78) 100%);
  text-align: center;
}

.cc-pdf-dropzone.is-dragover {
  border-color: var(--pdf-blue);
  background: #eaf2ff;
}

.cc-pdf-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.cc-pdf-upload-copy {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.cc-pdf-upload-copy.is-compact {
  padding: 8px;
}

.cc-pdf-upload-copy.is-compact .cc-pdf-upload-anim {
  width: 48px;
  height: 48px;
  margin-bottom: 0;
}

.cc-pdf-upload-copy span:not(.cc-pdf-badge) {
  color: var(--pdf-muted);
  font-size: 14px;
}

.cc-pdf-upload-anim {
  width: 82px;
  height: 82px;
  margin: 0 auto 10px;
}

.cc-pdf-upload-anim .cc-pdf-ring {
  fill: none;
  stroke: #bed0e8;
  stroke-width: 7;
}

.cc-pdf-upload-anim .cc-pdf-progress {
  fill: none;
  stroke: var(--pdf-blue);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 120;
  animation: ccPdfSpin 1.8s linear infinite;
  transform-origin: 50% 50%;
}

@keyframes ccPdfSpin {
  to { transform: rotate(360deg); }
}

.cc-pdf-success svg {
  width: 48px;
  height: 48px;
}

.cc-pdf-success path {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: ccPdfTick 0.55s ease forwards;
}

@keyframes ccPdfTick {
  to { stroke-dashoffset: 0; }
}

.cc-pdf-shimmer rect {
  animation: ccPdfPulse 1.35s ease-in-out infinite;
}

@keyframes ccPdfPulse {
  50% { opacity: 0.42; }
}

.cc-pdf-file-list {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 12px;
}

.cc-pdf-file-list li {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  min-height: 142px;
  align-items: stretch;
  padding: 12px;
  border: 1px solid rgba(23, 92, 211, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 20px rgba(23, 32, 51, 0.08);
  cursor: grab;
}

.cc-pdf-tile-preview {
  display: grid;
  place-items: center;
  min-height: 116px;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--pdf-muted);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
}

.cc-pdf-tile-preview img {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  background: #fff;
}

.cc-pdf-tile-preview span {
  padding: 6px;
  color: var(--pdf-muted);
  font-size: 11px;
}

.cc-pdf-file-list li.is-dragging {
  opacity: 0.6;
  outline: 2px solid var(--pdf-blue);
}

.cc-pdf-file-tile-main {
  display: grid;
  gap: 7px;
  align-content: start;
  min-width: 0;
  text-align: left;
}

.cc-pdf-file-icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #e7f0ff;
  color: var(--pdf-blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.cc-pdf-file-list strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--pdf-ink);
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cc-pdf-file-list small {
  color: var(--pdf-muted);
}

.cc-pdf-file-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.cc-pdf-drag-hint {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 999px;
  background: #f0f7ff;
  color: var(--pdf-blue);
  font-size: 11px;
  font-weight: 800;
}

.cc-pdf-icon-button {
  min-width: 0;
  min-height: 34px;
  padding: 7px 6px;
  background: var(--pdf-soft);
  color: var(--pdf-ink);
  font-size: 12px;
}

.cc-pdf-status {
  min-height: 24px;
  margin: 10px 0;
  color: var(--pdf-muted);
  font-weight: 700;
}

.cc-pdf-status[data-tone="success"] {
  color: #087443;
}

.cc-pdf-status[data-tone="error"] {
  color: var(--pdf-danger);
}

.cc-pdf-options {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 14px;
  border: 1px solid rgba(21, 94, 239, 0.14);
  border-radius: 8px;
  background: #f8fbff;
  text-align: left;
}

.cc-pdf-options[hidden] {
  display: none;
}

.cc-pdf-options label {
  display: grid;
  gap: 6px;
  color: var(--pdf-ink);
  font-weight: 800;
}

.cc-pdf-options p {
  margin: 0;
  font-size: 13px;
}

.cc-pdf-option-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #bcc8d8;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  background: #fff;
}

.cc-pdf-check {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
  font-weight: 800;
}

.cc-pdf-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cc-pdf-preset-row button {
  min-height: 34px;
  border: 1px solid rgba(21, 94, 239, 0.18);
  border-radius: 999px;
  background: #fff;
  color: var(--pdf-blue);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 7px 10px;
}

.cc-pdf-watermark-input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #bcc8d8;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
}

.cc-pdf-tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.cc-pdf-card {
  padding: 14px;
  border: 1px solid rgba(21, 94, 239, 0.12);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f9fbff);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.cc-pdf-card:hover {
  transform: translateY(-2px);
  border-color: rgba(21, 94, 239, 0.3);
  box-shadow: 0 16px 36px rgba(23, 32, 51, 0.1);
}

.cc-pdf-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.cc-pdf-card.is-disabled {
  opacity: 0.7;
}

.cc-pdf-content {
  padding: clamp(18px, 4vw, 34px);
}

.cc-pdf-content ul,
.cc-pdf-content ol {
  padding-left: 20px;
  color: var(--pdf-muted);
}

.cc-pdf-content li + li {
  margin-top: 7px;
}

.cc-pdf-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.cc-pdf-link-grid a,
.cc-pdf-share a {
  color: var(--pdf-blue);
  font-weight: 800;
  text-decoration: none;
}

.cc-pdf-sidebar {
  padding: 16px;
  align-self: start;
}

.cc-pdf-limits {
  border-left: 4px solid var(--pdf-gold);
  padding: 12px;
  background: #fff8eb;
  border-radius: 8px;
}

.cc-pdf-blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.cc-pdf-blog-card {
  padding: 16px;
}

.cc-pdf-sticky-cta {
  position: sticky;
  bottom: 0;
  z-index: 50;
  margin: 18px -20px -20px;
  padding: 10px 20px;
  border-top: 1px solid var(--pdf-line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

@media (min-width: 860px) {
  .cc-pdf-hero {
    grid-template-columns: 1.3fr 0.7fr;
    align-items: center;
  }

  .cc-pdf-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }

  .cc-pdf-sticky-cta {
    display: none;
  }
}

@media (max-width: 859px) {
  #pdf-tools {
    margin: 18px 0;
    scroll-margin-top: 76px;
  }

  .cc-pdf-shell {
    gap: 12px;
  }

  .cc-pdf-hero {
    padding: 18px;
  }

  .cc-pdf-hero h2,
  .cc-pdf-tool h2 {
    font-size: 24px;
    line-height: 1.2;
  }

  .cc-pdf-layout {
    gap: 12px;
  }

  .cc-pdf-tool {
    padding: 14px;
  }

  .cc-pdf-tool-tabs {
    margin-left: -4px;
    margin-right: -4px;
    padding-left: 4px;
  }

  .cc-pdf-tab {
    min-height: 44px;
    padding: 10px 14px;
  }

  .cc-pdf-dropzone {
    min-height: 210px;
  }

  .cc-pdf-file-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cc-pdf-action-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .cc-pdf-button,
  .cc-pdf-secondary {
    width: 100%;
  }

  .cc-pdf-ad[data-ad-slot="desktop-sidebar"] {
    display: none;
  }

  .cc-pdf-ad[data-ad-slot="mobile-sticky"] {
    display: none;
    min-height: 64px;
    margin: 10px 0;
  }

  .cc-pdf-sticky-cta {
    position: static;
    margin: 14px 0 0;
    padding: 0;
    border-top: 0;
    background: transparent;
    backdrop-filter: none;
  }

}

@media (max-width: 420px) {
  .cc-pdf-file-list {
    grid-template-columns: 1fr;
  }

  .cc-pdf-privacy-row,
  .cc-pdf-badge,
  .cc-pdf-drag-hint {
    width: 100%;
    justify-content: center;
  }
}

/* Responsive safety pass for PDF tools */
#pdf-tools,
.cc-pdf-page,
.cc-pdf-shell,
.cc-pdf-tool,
.cc-pdf-content,
.cc-pdf-dropzone,
.cc-pdf-file-list li {
  min-width: 0;
  max-width: 100%;
}

.cc-pdf-action-row,
.cc-pdf-chip-row,
.cc-pdf-privacy-row,
.cc-pdf-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cc-pdf-action-row > *,
.cc-pdf-preset-row > * {
  flex: 1 1 150px;
}

.cc-pdf-option-input,
.cc-pdf-watermark-input,
.cc-pdf-options input,
.cc-pdf-options select,
.cc-pdf-options textarea {
  min-width: 0;
  max-width: 100%;
}

.cc-pdf-tool-tabs {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.cc-pdf-status {
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  .cc-pdf-page {
    padding-left: 12px;
    padding-right: 12px;
  }

  .cc-pdf-file-list {
    grid-template-columns: 1fr;
  }

  .cc-pdf-action-row > *,
  .cc-pdf-button,
  .cc-pdf-secondary {
    width: 100%;
  }

  .cc-pdf-dropzone {
    min-height: 190px;
    padding: 16px 12px;
  }
}
