/* ==========================================================================
   Compress PDF Tool — Premium Upscaled & Fully Responsive Stylesheet
   Theme: Royal Blue (#1a3566), Amber Gold (#d97706), Slate, Glassmorphism
   Supported Breakpoints: 320px, 375px, 430px, 768px, 1024px, 1280px+
   ========================================================================== */

/* --- Tool Header & Badges --- */
.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(26, 53, 102, 0.12);
  box-shadow: 0 4px 16px rgba(26, 53, 102, 0.05);
  font-size: 13px;
  font-weight: 600;
  color: var(--royal-dark, #122549);
  margin-bottom: 18px;
  max-width: 100%;
  text-align: center;
}

.tool-badge svg {
  width: 16px;
  height: 16px;
  color: #059669;
  flex-shrink: 0;
}

/* --- Dropzone Base & Responsive Ergonomics --- */
.dropzone {
  position: relative;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px dashed rgba(26, 53, 102, 0.22);
  border-radius: 24px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-sizing: border-box;
}

.dropzone:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--royal, #1a3566);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(26, 53, 102, 0.08);
}

.dropzone.drag-active,
.dropzone.dragover {
  background: rgba(238, 246, 255, 0.95);
  border-color: #2563eb;
  border-style: solid;
  transform: scale(1.01);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.15), 0 20px 40px rgba(37, 99, 235, 0.12);
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.dz-content {
  position: relative;
  z-index: 5;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dz-icon-wrapper {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: linear-gradient(135deg, #1a3566 0%, #2563eb 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 12px 24px rgba(26, 53, 102, 0.22);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.dropzone:hover .dz-icon-wrapper {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.35);
}

.dz-icon-wrapper svg {
  width: 38px;
  height: 38px;
}

.dropzone h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.dropzone p {
  font-size: 15px;
  color: var(--slate-600, #475569);
  margin-bottom: 18px;
  line-height: 1.5;
  max-width: 480px;
}

.dz-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  max-width: 100%;
}

.dz-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(26, 53, 102, 0.06);
  border: 1px solid rgba(26, 53, 102, 0.1);
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--royal, #1a3566);
  white-space: nowrap;
}

.dz-chip svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.dz-btn {
  pointer-events: auto;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(26, 53, 102, 0.22);
}

/* --- Processing Panel & File Overview --- */
.process-panel {
  animation: slideFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideFadeIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.file-info {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.03);
  margin-bottom: 22px;
}

.file-icon-box {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.25);
  flex-shrink: 0;
}

.file-icon-box svg {
  width: 26px;
  height: 26px;
}

.file-details {
  flex: 1;
  min-width: 0;
}

.file-details h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--slate-800, #1e293b);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-details p {
  font-size: 13px;
  color: var(--slate-500, #64748b);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.btn-icon {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-icon:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #ef4444;
  transform: rotate(90deg);
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

/* --- Compression Preset Cards --- */
.settings-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--royal-dark, #122549);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-section-title svg {
  width: 16px;
  height: 16px;
  color: var(--gold, #d97706);
}

.compression-presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.preset-card {
  position: relative;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preset-card:hover {
  border-color: #93c5fd;
  background: #f8fafc;
  transform: translateY(-2px);
}

.preset-card.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.12);
}

.preset-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 22px;
}

.preset-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
}

.preset-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
}

.preset-tag.recommended {
  background: #dcfce7;
  color: #15803d;
}

.preset-desc {
  font-size: 12px;
  color: var(--slate-600, #475569);
  line-height: 1.4;
  margin: 0;
}

.preset-radio-indicator {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.preset-card.active .preset-radio-indicator {
  border-color: #2563eb;
  background: #2563eb;
}

.preset-card.active .preset-radio-indicator::after {
  content: '';
  width: 6px;
  height: 6px;
  background: #ffffff;
  border-radius: 50%;
}

/* Fallback native select */
.form-select-wrapper {
  margin-bottom: 22px;
}

.form-select {
  width: 100%;
  background-color: #ffffff;
  border: 2px solid #e2e8f0;
  color: #1e293b;
  padding: 13px 16px;
  border-radius: 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%231e293b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 16px top 50%;
  background-size: 12px auto;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.02);
}

.form-select:hover,
.form-select:focus {
  border-color: #2563eb;
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* --- Progress Bar --- */
.progress-container {
  margin-bottom: 22px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.03);
}

.progress-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--royal-dark, #122549);
  margin-bottom: 10px;
}

#progressPercentage {
  font-size: 14px;
  font-weight: 800;
  color: #2563eb;
  background: #eff6ff;
  padding: 2px 9px;
  border-radius: 9999px;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.progress-bar {
  height: 9px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb 0%, #d97706 100%);
  width: 0%;
  transition: width 0.25s ease;
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* --- Compression Results Stats --- */
.compression-stats {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1.5px solid #cbd5e1;
  border-radius: 18px;
  padding: 16px 20px;
  margin-top: 14px;
  margin-bottom: 22px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.04);
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  min-width: 0;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 20px;
  font-weight: 900;
  color: #1e293b;
  letter-spacing: -0.02em;
}

.stat-value.success {
  color: #059669;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: #e2e8f0;
  margin: 0 10px;
  flex-shrink: 0;
}

.reduction-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #dcfce7;
  color: #15803d;
  font-size: 16px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(22, 163, 74, 0.2);
}

/* --- Action Buttons --- */
.action-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.btn-compress-action {
  background: linear-gradient(135deg, #1a3566 0%, #1e4080 100%);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(26, 53, 102, 0.25);
  font-size: 15px;
  min-height: 48px;
  padding: 14px 24px;
  border-radius: 14px;
  font-weight: 700;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-compress-action:hover {
  background: linear-gradient(135deg, #122549 0%, #1a3566 100%);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(26, 53, 102, 0.35);
}

.btn-download-action {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(217, 119, 6, 0.3);
  font-size: 15px;
  min-height: 48px;
  padding: 14px 24px;
  border-radius: 14px;
  font-weight: 700;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-download-action:hover {
  background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(217, 119, 6, 0.4);
}

.credit-clarity-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: #64748b;
  text-align: center;
  margin-top: 4px;
  line-height: 1.4;
}

.credit-clarity-pill svg {
  width: 15px;
  height: 15px;
  color: #10b981;
  flex-shrink: 0;
}

/* --- Password Decryption Modal --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-content {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 10;
  box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.3);
  animation: modalUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-header {
  padding: 20px 24px 14px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-header-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #fee2e2;
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-header-icon svg {
  width: 18px;
  height: 18px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin: 0;
}

.modal-body {
  padding: 20px 24px;
}

.modal-body p {
  font-size: 13.5px;
  color: var(--slate-600, #475569);
  margin-bottom: 16px;
  line-height: 1.5;
}

.modal-footer {
  padding: 14px 24px 20px;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* --- Section Headlines & Content --- */
.section-headline {
  font-size: 26px;
  font-weight: 900;
  color: var(--royal-dark, #122549);
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 15px;
  color: var(--slate-600, #475569);
  text-align: center;
  max-width: 680px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

/* --- How it Works Steps --- */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.step-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a3566, #2563eb);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(26, 53, 102, 0.2);
}

.step-text h5 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--slate-800, #1e293b);
  margin-bottom: 3px;
}

.step-text p {
  font-size: 13.5px;
  color: var(--slate-600, #475569);
  line-height: 1.5;
  margin: 0;
}

/* --- Guidelines Callout List --- */
.guidelines-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guideline-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.guideline-icon {
  width: 20px;
  height: 20px;
  color: #d97706;
  flex-shrink: 0;
  margin-top: 1px;
}

.guideline-text {
  font-size: 13.5px;
  color: var(--slate-700, #334155);
  line-height: 1.5;
}

.guideline-text strong {
  color: var(--slate-900, #0f172a);
}

/* --- SEO Article Highlight Box --- */
.article-highlight-box {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  padding: 20px;
  margin: 20px 0;
}

.article-highlight-box h4 {
  font-size: 16px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.article-highlight-box p {
  font-size: 13.5px;
  color: var(--slate-700, #334155);
  line-height: 1.55;
  margin: 0;
}

/* ==========================================================================
   Comprehensive Responsive Breakpoints (Mobile, Tablet, Desktop)
   ========================================================================== */

/* --- Tablet / Small Laptops (max-width: 768px) --- */
@media (max-width: 768px) {
  .compression-presets-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .preset-card {
    padding: 12px 14px;
  }

  .section-headline {
    font-size: 22px;
  }

  .section-subtitle {
    font-size: 14px;
    margin-bottom: 24px;
  }
}

/* --- Mobile Devices (max-width: 480px) --- */
@media (max-width: 480px) {
  .tool-badge {
    font-size: 11px;
    padding: 5px 12px;
    gap: 6px;
    margin-bottom: 12px;
  }

  .dropzone {
    padding: 24px 14px 20px;
    border-radius: 16px;
  }

  .dz-icon-wrapper {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    margin-bottom: 12px;
  }

  .dz-icon-wrapper svg {
    width: 28px;
    height: 28px;
  }

  .dropzone h3 {
    font-size: 17px;
    margin-bottom: 4px;
  }

  .dropzone p {
    font-size: 12.5px;
    margin-bottom: 12px;
  }

  .dz-chips {
    gap: 6px;
    margin-bottom: 14px;
  }

  .dz-chip {
    font-size: 10.5px;
    padding: 3px 8px;
    gap: 4px;
  }

  .dz-btn {
    width: 100%;
    max-width: 260px;
    font-size: 14px;
    padding: 11px 18px;
    border-radius: 12px;
  }

  .file-info {
    padding: 12px 14px;
    gap: 10px;
    border-radius: 14px;
    margin-bottom: 16px;
  }

  .file-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .file-icon-box svg {
    width: 20px;
    height: 20px;
  }

  .file-details h4 {
    font-size: 13.5px;
  }

  .file-details p {
    font-size: 11.5px;
  }

  .btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .preset-card {
    padding: 10px 12px;
    border-radius: 12px;
  }

  .preset-title {
    font-size: 13.5px;
  }

  .preset-tag {
    font-size: 9.5px;
    padding: 1.5px 5px;
  }

  .preset-desc {
    font-size: 11px;
    line-height: 1.35;
  }

  .preset-radio-indicator {
    top: 10px;
    right: 10px;
    width: 15px;
    height: 15px;
  }

  .progress-container {
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: 14px;
  }

  .progress-text {
    font-size: 12.5px;
  }

  #progressPercentage {
    font-size: 12.5px;
    padding: 1px 7px;
  }

  .compression-stats {
    padding: 12px 8px;
    border-radius: 14px;
    margin-bottom: 16px;
  }

  .stat-label {
    font-size: 9.5px;
    letter-spacing: 0.2px;
  }

  .stat-value {
    font-size: 15px;
  }

  .stat-divider {
    height: 28px;
    margin: 0 4px;
  }

  .reduction-pill {
    font-size: 13px;
    padding: 2px 7px;
  }

  .btn-compress-action,
  .btn-download-action {
    font-size: 14px;
    padding: 12px 18px;
    border-radius: 12px;
    min-height: 44px;
  }

  .credit-clarity-pill {
    font-size: 11px;
  }
}

/* --- Small Mobile (max-width: 360px) --- */
@media (max-width: 360px) {
  .dropzone {
    padding: 18px 10px 16px;
  }

  .dz-icon-wrapper {
    width: 48px;
    height: 48px;
  }

  .dropzone h3 {
    font-size: 15px;
  }

  .stat-value {
    font-size: 13.5px;
  }

  .reduction-pill {
    font-size: 12px;
    padding: 1px 5px;
  }
}

/* --- Accessibility & Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .dropzone,
  .preset-card,
  .btn-compress-action,
  .btn-download-action,
  .modal-content,
  .progress-fill {
    transition: none !important;
    animation: none !important;
  }
}
