/* PDF Tools Pro - Main Styles
   Creator: Dilawar Alyani
   Version: 1.0.0
*/

:root {
  --ptp-primary: #4f46e5;
  --ptp-primary-hover: #4338ca;
  --ptp-secondary: #0ea5e9;
  --ptp-bg: #f8fafc;
  --ptp-card: #ffffff;
  --ptp-text: #0f172a;
  --ptp-muted: #64748b;
  --ptp-border: #e2e8f0;
  --ptp-radius: 16px;
  --ptp-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07);
  --ptp-shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.08);
  --ptp-success: #10b981;
}

[data-theme="dark"] {
  --ptp-bg: #0f172a;
  --ptp-card: #1e293b;
  --ptp-text: #f1f5f9;
  --ptp-muted: #94a3b8;
  --ptp-border: #334155;
  --ptp-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3);
  --ptp-shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.4);
}

.ptp-wrapper {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--ptp-bg);
  color: var(--ptp-text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

.ptp-wrapper * { box-sizing: border-box; }

.ptp-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.ptp-header {
  background: var(--ptp-card);
  border-bottom: 1px solid var(--ptp-border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.ptp-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.ptp-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  color: inherit;
  text-decoration: none;
}

.ptp-logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--ptp-primary), var(--ptp-secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.ptp-nav a {
  color: var(--ptp-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  margin-left: 24px;
  transition: color 0.2s;
}

.ptp-nav a:hover { color: var(--ptp-primary); }

.ptp-theme-toggle {
  background: none;
  border: 1px solid var(--ptp-border);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ptp-text);
  transition: all 0.2s;
}

.ptp-theme-toggle:hover { background: var(--ptp-bg); }

/* Hero */
.ptp-hero {
  padding: 70px 0 50px;
  text-align: center;
}

.ptp-hero h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  line-height: 1.15;
}

.ptp-hero h1 span {
  background: linear-gradient(135deg, var(--ptp-primary), var(--ptp-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ptp-hero p {
  font-size: 1.15rem;
  color: var(--ptp-muted);
  max-width: 560px;
  margin: 0 auto 28px;
}

.ptp-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.ptp-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--ptp-card);
  border: 1px solid var(--ptp-border);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: var(--ptp-shadow);
}

/* Tools Grid */
.ptp-tools-section { padding: 30px 0 70px; }

.ptp-section-title {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.ptp-section-sub {
  color: var(--ptp-muted);
  margin: 0 0 28px;
  font-size: 0.95rem;
}

.ptp-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.ptp-tool-card {
  background: var(--ptp-card);
  border: 1px solid var(--ptp-border);
  border-radius: var(--ptp-radius);
  padding: 24px 20px;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s ease;
  position: relative;
  display: block;
}

.ptp-tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--ptp-shadow-lg);
  border-color: var(--ptp-primary);
}

.ptp-tool-icon {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
  color: #fff;
}

.ptp-icon-merge { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.ptp-icon-split { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.ptp-icon-compress { background: linear-gradient(135deg, #14b8a6, #06b6d4); }
.ptp-icon-convert { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.ptp-icon-img-compress { background: linear-gradient(135deg, #3b82f6, #6366f1); }
.ptp-icon-resize { background: linear-gradient(135deg, #10b981, #34d399); }
.ptp-icon-img-convert { background: linear-gradient(135deg, #8b5cf6, #a855f7); }

.ptp-tool-card h3 {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.ptp-tool-card p {
  font-size: 0.875rem;
  color: var(--ptp-muted);
  margin: 0;
  line-height: 1.45;
}

.ptp-arrow {
  position: absolute;
  top: 22px;
  right: 20px;
  opacity: 0;
  color: var(--ptp-primary);
  font-size: 18px;
  transition: all 0.2s;
}

.ptp-tool-card:hover .ptp-arrow {
  opacity: 1;
  transform: translateX(3px);
}

/* How */
.ptp-how {
  padding: 55px 0;
  background: var(--ptp-card);
  border-top: 1px solid var(--ptp-border);
  border-bottom: 1px solid var(--ptp-border);
}

.ptp-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px;
  margin-top: 36px;
}

.ptp-step { text-align: center; }

.ptp-step-num {
  width: 46px;
  height: 46px;
  background: var(--ptp-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0 auto 14px;
}

.ptp-step h4 { font-size: 1.05rem; margin: 0 0 6px; }
.ptp-step p { font-size: 0.88rem; color: var(--ptp-muted); margin: 0; }

/* About */
.ptp-about { padding: 50px 0; }

/* Footer */
.ptp-footer {
  padding: 36px 0;
  text-align: center;
  color: var(--ptp-muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--ptp-border);
}

/* ========== Tool Page ========== */
.ptp-tool-main { padding: 50px 0 70px; }

.ptp-tool-header {
  text-align: center;
  margin-bottom: 36px;
}

.ptp-tool-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 10px;
}

.ptp-tool-header p {
  color: var(--ptp-muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto;
}

/* Upload Zone */
.ptp-upload-zone {
  background: var(--ptp-card);
  border: 2px dashed var(--ptp-border);
  border-radius: var(--ptp-radius);
  padding: 50px 30px;
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
  transition: all 0.25s;
  cursor: pointer;
}

.ptp-upload-zone:hover,
.ptp-upload-zone.dragover {
  border-color: var(--ptp-primary);
  background: color-mix(in srgb, var(--ptp-primary) 6%, var(--ptp-card));
}

.ptp-upload-icon { font-size: 46px; margin-bottom: 12px; opacity: 0.75; }

.ptp-upload-zone h3 {
  font-size: 1.2rem;
  margin: 0 0 6px;
}

.ptp-upload-zone p {
  color: var(--ptp-muted);
  margin: 0 0 20px;
  font-size: 0.95rem;
}

/* Buttons */
.ptp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.98rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.ptp-btn-primary {
  background: var(--ptp-primary);
  color: #fff;
}

.ptp-btn-primary:hover {
  background: var(--ptp-primary-hover);
  transform: translateY(-1px);
}

.ptp-btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.ptp-btn-secondary {
  background: transparent;
  color: var(--ptp-muted);
  border: 1px solid var(--ptp-border);
  margin-left: 10px;
}

.ptp-btn-secondary:hover {
  background: var(--ptp-bg);
  color: var(--ptp-text);
}

.ptp-btn-download {
  background: var(--ptp-success);
  color: #fff;
  margin-top: 12px;
}

.ptp-btn-download:hover {
  filter: brightness(1.08);
}

/* File list */
.ptp-file-list {
  max-width: 620px;
  margin: 20px auto 0;
}

.ptp-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 16px;
  background: var(--ptp-card);
  border: 1px solid var(--ptp-border);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 0.92rem;
}

.ptp-file-item .name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

.ptp-file-item .size {
  color: var(--ptp-muted);
  font-size: 0.85rem;
}

/* Options */
.ptp-options {
  max-width: 620px;
  margin: 24px auto 0;
  background: var(--ptp-card);
  border: 1px solid var(--ptp-border);
  border-radius: 14px;
  padding: 20px;
}

.ptp-option-row {
  margin-bottom: 16px;
}

.ptp-option-row:last-child { margin-bottom: 0; }

.ptp-option-row label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.ptp-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--ptp-border);
  border-radius: 10px;
  background: var(--ptp-bg);
  color: var(--ptp-text);
  font-size: 0.95rem;
  font-family: inherit;
}

.ptp-input:focus {
  outline: none;
  border-color: var(--ptp-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ptp-primary) 20%, transparent);
}

.ptp-range {
  width: 100%;
  accent-color: var(--ptp-primary);
}

/* Actions */
.ptp-actions {
  text-align: center;
  margin-top: 28px;
}

/* Result */
.ptp-result {
  max-width: 620px;
  margin: 32px auto 0;
  text-align: center;
  background: var(--ptp-card);
  border: 1px solid var(--ptp-border);
  border-radius: var(--ptp-radius);
  padding: 28px 24px;
}

.ptp-result h3 {
  margin: 0 0 16px;
  color: var(--ptp-success);
}

.ptp-note {
  margin-top: 18px;
  font-size: 0.82rem;
  color: var(--ptp-muted);
}

/* Progress */
.ptp-progress {
  max-width: 620px;
  margin: 28px auto 0;
  text-align: center;
}

.ptp-progress-bar {
  height: 8px;
  background: var(--ptp-border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}

.ptp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ptp-primary), var(--ptp-secondary));
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 999px;
}

.ptp-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ptp-spin 0.7s linear infinite;
}

@keyframes ptp-spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
  .ptp-nav { display: none; }
  .ptp-hero { padding: 45px 0 35px; }
  .ptp-tools-grid { grid-template-columns: 1fr; }
  .ptp-upload-zone { padding: 40px 20px; }
}