/* ============================================================
   ⚡ QuickConverter — Crop PDF Tool (Final Production Version)
   ------------------------------------------------------------
   Design Harmony:
     • Blue  = Trust / Professional
     • Green = Success / Completion
     • Orange = Action / Motivation
     • Gold  = Premium / Reward
   ============================================================ */

/* -------------------- Base Layout -------------------- */
body {
  font-family: "Inter", "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #eef6ff, #ffffff);
  color: #1e293b;
  margin: 0;
  padding: 0;
  transition: background 0.4s, color 0.4s;
}

.dark-mode {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #e2e8f0;
}

/* -------------------- Header -------------------- */
header.glass-header {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 30px;
  position: sticky;
  top: 0;
  z-index: 100;
}

header.glass-header .logo span {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0078d7;
  letter-spacing: 0.5px;
}

.dark-mode header.glass-header {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
}

/* -------------------- Hero Section -------------------- */
.hero {
  text-align: center;
  padding: 70px 20px 40px;
  color: #ffffff;
  border-radius: 0 0 40px 40px;
  box-shadow: 0 8px 20px rgba(0, 120, 215, 0.3);
  background: linear-gradient(135deg, #0078d7, #00b4d8);
}

.hero h1 {
  font-size: 2.4rem;
  margin-bottom: 10px;
}

.hero p {
  color: #e0f7ff;
  font-size: 1.1rem;
}

/* -------------------- Main Container -------------------- */
.tool-container {
  max-width: 850px;
  margin: 50px auto;
  background: #ffffff;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: all 0.4s;
}

.tool-container:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.dark-mode .tool-container {
  background: #1e293b;
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.05);
}

/* -------------------- Drop Zone -------------------- */
.drop-zone {
  border: 3px dashed #0078d7;
  border-radius: 12px;
  padding: 50px;
  color: #475569;
  background: #f9fbfd;
  cursor: pointer;
  transition: all 0.3s ease;
}

.drop-zone:hover {
  background: #eaf5ff;
}

.drop-zone.dragging {
  background: #dbeafe;
  border-color: #0284c7;
  transform: scale(1.02);
}

.dark-mode .drop-zone {
  background: #1e293b;
  border-color: #3b82f6;
  color: #e2e8f0;
}

.dark-mode .drop-zone:hover {
  background: #334155;
}

/* -------------------- Controls -------------------- */
.controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 25px 0 10px;
}

.btn-outline {
  background: transparent;
  border: 2px solid #0078d7;
  color: #0078d7;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-outline:hover {
  background: #0078d7;
  color: #ffffff;
}

.dark-mode .btn-outline {
  border-color: #3b82f6;
  color: #3b82f6;
}

.dark-mode .btn-outline:hover {
  background: #3b82f6;
  color: #fff;
}

/* -------------------- PDF Preview -------------------- */
.preview-container {
  margin-top: 25px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

.preview-container canvas {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  max-width: 100%;
  cursor: crosshair;
}

.dark-mode .preview-container canvas {
  background: #f1f5f9;
}

/* -------------------- Crop Overlay -------------------- */
.crop-overlay {
  position: absolute;
  border: 2px dashed #0078d7;
  background: rgba(0, 120, 215, 0.2);
  display: none;
  cursor: move;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
  transition: all 0.2s ease;
}

.crop-overlay.active {
  display: block;
  outline: 1px solid rgba(0, 120, 215, 0.35);
  box-shadow: 0 0 8px rgba(0, 120, 215, 0.4);
}

.dark-mode .crop-overlay {
  border-color: #38bdf8;
  background: rgba(59, 130, 246, 0.25);
}

/* -------------------- Progress Bar -------------------- */
#progressContainer {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 6px;
  margin-top: 20px;
  overflow: hidden;
  display: none;
}

#progressFill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #0078d7, #22c55e);
  transition: width 0.3s ease-in-out;
}

#progressText {
  font-size: 0.9rem;
  margin-top: 8px;
  color: #475569;
}

/* -------------------- Result Section -------------------- */
#resultSection {
  display: none;
  text-align: center;
  margin-top: 30px;
}

#resultSection .result-card {
  background: #f9fafb;
  border: 1px solid #d1fae5;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 4px 10px rgba(0, 120, 215, 0.08);
  display: inline-block;
  min-width: 280px;
}

#resultSection h3 {
  color: #166534;
  margin-bottom: 8px;
}

#resultSection p {
  color: #333;
  font-size: 0.95rem;
  margin-bottom: 15px;
}

#downloadLink {
  display: inline-block;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  color: #fff;
  text-decoration: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(34, 197, 94, 0.3);
  transition: all 0.3s;
}

#downloadLink:hover {
  background: linear-gradient(90deg, #16a34a, #15803d);
  transform: translateY(-2px);
}

.dark-mode #resultSection .result-card {
  background: #1f2937;
  color: #f3f4f6;
  border-color: #065f46;
}

/* -------------------- User Info Box -------------------- */
.user-info-box {
  background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
  border-left: 5px solid #0078d7;
  border-radius: 12px;
  padding: 20px;
  margin-top: 25px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 120, 215, 0.08);
}

.user-info-box strong {
  color: #0078d7;
}

.file-actions {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

/* -------------------- Buttons -------------------- */
.btn-primary {
  background: linear-gradient(90deg, #0078d7, #00a6ff);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: linear-gradient(90deg, #005fa3, #0078d7);
  transform: translateY(-2px);
}

.btn-outline-danger {
  border: 2px solid #ef4444;
  background: transparent;
  color: #ef4444;
}

.btn-outline-danger:hover {
  background: #ef4444;
  color: #fff;
}

.btn-outline-primary {
  border: 2px solid #0078d7;
  background: transparent;
  color: #0078d7;
}

.btn-outline-primary:hover {
  background: #0078d7;
  color: #fff;
}

/* -------------------- Alerts -------------------- */
.alert-box {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  border: 1px solid transparent;
  animation: fadeIn 0.4s ease-out;
}

.alert-danger {
  background-color: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.dark-mode .alert-danger {
  background-color: #450a0a;
  border-color: #7f1d1d;
  color: #fca5a5;
}

/* -------------------- Related Tools -------------------- */
.related-tools {
  max-width: 900px;
  margin: 60px auto;
  text-align: center;
  background: linear-gradient(135deg, #f9fafb, #f0f9ff);
  border-radius: 14px;
  padding: 40px 30px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
}

.related-tools h3 {
  font-size: 1.5rem;
  color: #0f172a;
  margin-bottom: 20px;
}

.related-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
}

.related-grid a {
  background: linear-gradient(90deg, #0078d7, #00a2ff);
  color: #fff;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s;
  box-shadow: 0 3px 10px rgba(0, 120, 215, 0.25);
}

.related-grid a:hover {
  background: linear-gradient(90deg, #005fa3, #0078d7);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 95, 163, 0.35);
}

/* -------------------- Footer -------------------- */
footer {
  text-align: center;
  padding: 35px 10px;
  margin-top: 60px;
  color: #64748b;
  font-size: 1rem;
  border-top: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f9fafb, #f1f5f9);
}

footer strong {
  color: #0078d7;
  font-weight: 700;
}

footer:hover strong {
  color: #0284c7;
}

/* -------------------- Fade Animations -------------------- */
.fade-in {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* -------------------- Responsive -------------------- */
@media (max-width: 650px) {
  .tool-container {
    padding: 25px;
  }

  .btn-primary,
  .btn-outline-danger,
  .btn-outline-primary {
    width: 100%;
    margin-left: 0;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .file-actions {
    flex-direction: column;
  }
}

/* -------------------- Animations -------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

