* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', sans-serif;
  background: #f9fafb;
  color: #333;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ═══ Header / Footer (shared) ═══ */
header.custom-header, footer.site-footer {
  background: #f2d397; color: #485565;
  padding: 2rem 1rem; text-align: center;
}
.logo-title-wrap {
  display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap;
}
.logo-circle { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; }
.logo-circle img { width: 100%; height: 100%; object-fit: cover; }
.title-group h1 { font-size: 2rem; font-weight: 700; }
.title-group p { font-size: 1rem; color: #6b7280; }

/* ═══ Navbar ═══ */
.prodev-navbar {
  background: #2c3e50; padding: 1rem 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  position: relative; z-index: 99; width: 100%;
}
.prodev-container {
  max-width: 1200px; margin: 0 auto; padding: 0 1rem;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.prodev-logo { display: none; }
@media (max-width: 768px) {
  .prodev-logo {
    display: block; position: absolute; left: 1rem; top: 50%;
    transform: translateY(-50%); color: #f2d397; font-size: 1.5rem; font-weight: bold;
  }
}
.prodev-hamburger {
  position: absolute; right: 1rem; font-size: 1.5rem;
  color: #f2d397; cursor: pointer; display: none;
}
.prodev-nav-links {
  list-style: none; display: flex; justify-content: center;
  gap: 1.5rem; transition: all 0.3s ease-in-out;
}
.prodev-nav-links li a {
  text-decoration: none; color: #f2d397; font-weight: 600;
  font-size: 1rem; padding: 0.5rem 1rem; border-radius: 5px;
  transition: all 0.3s ease; white-space: nowrap;
}
.prodev-nav-links li a:hover {
  background-color: #f2d397; color: #111;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
@media (max-width: 768px) {
  .prodev-hamburger { display: block; }
  .prodev-nav-links {
    display: none; flex-direction: column; align-items: center;
    background-color: #2c3e50; width: 100%; padding: 1rem 0;
  }
  .prodev-nav-links.show { display: flex; }
}

/* ═══ Footer ═══ */
.site-footer .footer-content { max-width: 1300px; margin: 0 auto; }
.footer-links a { margin: 0 0.75rem; color: #485565; text-decoration: none; transition: color 0.3s; }
.footer-links a:hover { color: #3b82f6; }
.footer-copy { margin-top: 0.5rem; font-size: 0.85rem; color: #6b7280; }
.prodev-visitor-strip {
  background: #2c3e50; padding: 0.75rem 1rem;
  text-align: center; box-shadow: 0 -2px 6px rgba(0,0,0,0.05);
}
.visitor-ticker { font-weight: 600; font-size: 1.1rem; color: #f8f8f8; }
.visitor-icon { color: #fff; font-size: 1.3rem; margin-right: 8px; }
.animated-icon {
  animation: pulse-glow 1.8s ease-in-out infinite;
  will-change: transform, opacity;
}
@keyframes pulse-glow {
  0%, 100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* ═══════════════════════════════════════════
   TOOL PAGE — COMMON STYLES
   ═══════════════════════════════════════════ */
.tool-section {
  padding: 2rem 1rem;
  max-width: 900px;
  margin: 2rem auto;
}

.tool-box {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.tool-title {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.25rem;
  color: #2c3e50;
}

.tool-subtitle {
  text-align: center;
  color: #6b7280;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* ─── Upload Area ─── */
.tool-upload {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s;
  margin-bottom: 1.5rem;
  cursor: pointer;
}
.tool-upload.drag-over { border-color: #f2d397; background: #fffbeb; }
.tool-upload.has-file  { border-color: #22c55e; background: #f0fdf4; }

.tool-upload-icon {
  font-size: 2.5rem; color: #94a3b8;
  margin-bottom: 0.75rem; display: block;
}
.tool-upload p { color: #6b7280; margin-bottom: 0.5rem; }

.tool-upload-btn {
  display: inline-block; background: #f2d397;
  padding: 0.5rem 1.2rem; border-radius: 6px;
  font-weight: 600; cursor: pointer; transition: background 0.3s;
}
.tool-upload-btn:hover { background: #fcd34d; }

.tool-file-input { display: none; }
.tool-file-hint { font-size: 0.8rem; color: #9ca3af; margin-top: 0.5rem; }
.tool-file-name {
  display: block; margin-top: 0.5rem; font-weight: 600; color: #22c55e;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ─── Controls ─── */
.tool-controls { margin-bottom: 1.5rem; }

.tool-control-group {
  padding: 1rem; background: #f9fafb;
  border-radius: 8px; margin-bottom: 0.75rem;
}
.tool-control-group label {
  display: block; font-weight: 600;
  margin-bottom: 0.5rem; color: #374151;
}

.tool-row {
  display: flex; gap: 1rem; flex-wrap: wrap; align-items: center;
}
.tool-row .tool-control-group { flex: 1; min-width: 120px; }

.tool-input {
  width: 100%; padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1; border-radius: 6px;
  font-size: 0.95rem; font-family: inherit;
}
.tool-input:focus { outline: none; border-color: #f2d397; }

.tool-select {
  width: 100%; padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1; border-radius: 6px;
  font-size: 0.95rem; background: #fff; font-family: inherit;
}

.tool-slider {
  width: 100%; height: 6px;
  -webkit-appearance: none; appearance: none;
  background: #e2e8f0; border-radius: 3px;
  outline: none; cursor: pointer;
}
.tool-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; background: #f2d397;
  border-radius: 50%; cursor: pointer; border: 2px solid #d4a84b;
}
.tool-slider::-moz-range-thumb {
  width: 20px; height: 20px; background: #f2d397;
  border-radius: 50%; cursor: pointer; border: 2px solid #d4a84b;
}

.tool-checkbox-wrap {
  display: flex; align-items: center; gap: 0.5rem;
}
.tool-checkbox-wrap input[type="checkbox"] {
  width: 18px; height: 18px; cursor: pointer;
}

.tool-color-wrap {
  display: flex; align-items: center; gap: 0.75rem;
}
.tool-color-input {
  width: 50px; height: 40px; border: 2px solid #cbd5e1;
  border-radius: 6px; cursor: pointer; padding: 2px;
}
.tool-color-hex {
  font-weight: 600; color: #374151;
  font-family: monospace; font-size: 1rem;
}

/* ─── Button Groups / Tabs ─── */
.tool-btn-group {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 1rem; justify-content: center;
}
.tool-btn {
  background: #eef2f7; border: 2px solid transparent;
  padding: 0.5rem 1rem; border-radius: 8px;
  font-weight: 600; font-size: 0.9rem;
  cursor: pointer; transition: all 0.3s; color: #485565;
}
.tool-btn:hover { background: #e2e8f0; }
.tool-btn.active { background: #f2d397; border-color: #d4a84b; color: #2c3e50; }

/* ─── Action Buttons ─── */
.tool-actions {
  display: flex; justify-content: center;
  gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}

.tool-process-btn {
  background: #f2d397; border: none;
  padding: 0.75rem 2rem; border-radius: 8px;
  font-weight: 600; font-size: 1rem;
  cursor: pointer; transition: all 0.3s;
}
.tool-process-btn:hover:not(:disabled) { background: #fcd34d; }
.tool-process-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.tool-download-btn {
  background: #3b82f6; color: #fff; border: none;
  padding: 0.75rem 2rem; border-radius: 8px;
  font-weight: 600; font-size: 1rem;
  cursor: pointer; transition: all 0.3s;
}
.tool-download-btn:hover { background: #2563eb; }

.tool-secondary-btn {
  background: #6b7280; color: #fff; border: none;
  padding: 0.5rem 1.2rem; border-radius: 6px;
  font-weight: 600; cursor: pointer; transition: all 0.3s;
}
.tool-secondary-btn:hover { background: #4b5563; }

/* ─── Loading Spinner ─── */
.tool-loading { text-align: center; padding: 2rem; }
.tool-spinner {
  width: 48px; height: 48px;
  border: 4px solid #e2e8f0; border-top: 4px solid #f2d397;
  border-radius: 50%; animation: tool-spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes tool-spin { to { transform: rotate(360deg); } }
.tool-loading p { color: #6b7280; font-weight: 500; }

/* ─── Preview ─── */
.tool-preview {
  display: flex; gap: 1.5rem; justify-content: center;
  flex-wrap: wrap; margin-top: 1.5rem;
}
.tool-preview-item {
  flex: 1; min-width: 250px; max-width: 400px; text-align: center;
}
.tool-preview-item h4 {
  margin-bottom: 0.5rem; color: #374151; font-size: 0.95rem;
}
.tool-preview-item img {
  width: 100%; max-height: 350px; object-fit: contain;
  border-radius: 8px; border: 1px solid #e2e8f0;
  background: repeating-conic-gradient(#e5e7eb 0% 25%, transparent 0% 50%) 50% / 16px 16px;
}

.tool-result-single {
  text-align: center; margin-top: 1.5rem;
}
.tool-result-single img {
  max-width: 100%; max-height: 400px; object-fit: contain;
  border-radius: 8px; border: 1px solid #e2e8f0;
  background: repeating-conic-gradient(#e5e7eb 0% 25%, transparent 0% 50%) 50% / 16px 16px;
}

/* ─── Error ─── */
.tool-error {
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 8px; padding: 0.75rem 1rem;
  color: #dc2626; display: flex; align-items: center;
  gap: 0.5rem; margin-top: 1rem;
}
.tool-error i { font-size: 1.1rem; }

/* ─── Info / Stats ─── */
.tool-stats {
  display: flex; justify-content: space-around;
  flex-wrap: wrap; gap: 1rem; margin: 1rem 0;
}
.tool-stat {
  text-align: center; padding: 0.75rem;
  background: #f9fafb; border-radius: 8px; flex: 1; min-width: 100px;
}
.tool-stat-value { font-size: 1.3rem; font-weight: 700; color: #2c3e50; }
.tool-stat-label { font-size: 0.8rem; color: #6b7280; }

/* ─── Textarea ─── */
.tool-textarea {
  width: 100%; min-height: 150px; padding: 0.75rem;
  border: 1px solid #cbd5e1; border-radius: 8px;
  font-family: monospace; font-size: 0.85rem;
  resize: vertical; margin-bottom: 1rem;
}
.tool-textarea:focus { outline: none; border-color: #f2d397; }

/* ─── SEO Content Section ─── */
.tool-seo .tool-box { margin-top: 0; }
.tool-seo h2 {
  font-size: 1.3rem; font-weight: 700;
  color: #2c3e50; margin-bottom: 0.75rem; margin-top: 1.25rem;
}
.tool-seo h2:first-child { margin-top: 0; }
.tool-seo ol, .tool-seo ul {
  padding-left: 1.5rem; margin-bottom: 0.75rem; color: #4b5563;
}
.tool-seo li { margin-bottom: 0.4rem; line-height: 1.6; }
.tool-seo p { color: #4b5563; line-height: 1.6; margin-bottom: 0.5rem; }

/* ═══════════════════════════════════════════
   TOOL-SPECIFIC STYLES
   ═══════════════════════════════════════════ */

/* ─── Cropper ─── */
.cropper-wrapper {
  max-width: 100%; max-height: 400px; margin-bottom: 1rem; overflow: hidden;
}
.cropper-wrapper img { max-width: 100%; display: block; }

/* ─── QR Code Generator ─── */
.qr-output {
  display: flex; justify-content: center;
  margin: 1.5rem 0; padding: 1rem; background: #fff;
  border-radius: 8px;
}
.qr-output canvas, .qr-output img { max-width: 100%; }

/* ─── Color Picker ─── */
.picker-canvas-wrap {
  position: relative; cursor: crosshair;
  display: inline-block; margin-bottom: 1rem;
}
.picker-canvas-wrap canvas {
  max-width: 100%; border-radius: 8px;
  border: 1px solid #e2e8f0;
}
.color-result {
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap; justify-content: center;
  margin: 1rem 0;
}
.color-swatch {
  width: 60px; height: 60px; border-radius: 8px;
  border: 2px solid #e2e8f0;
}
.color-values { text-align: left; }
.color-values p {
  font-family: monospace; font-size: 0.95rem;
  margin-bottom: 0.25rem; color: #374151;
}

/* ─── Meme Generator ─── */
.meme-canvas-wrap {
  text-align: center; margin: 1rem 0;
}
.meme-canvas-wrap canvas {
  max-width: 100%; border-radius: 8px;
  border: 1px solid #e2e8f0;
}

/* ─── Image Compare ─── */
.compare-container {
  position: relative; overflow: hidden;
  border-radius: 8px; border: 1px solid #e2e8f0;
  max-width: 100%; margin: 1.5rem auto;
  user-select: none; -webkit-user-select: none;
}
.compare-container img {
  display: block; width: 100%; height: auto;
}
.compare-overlay {
  position: absolute; top: 0; left: 0;
  height: 100%; overflow: hidden;
  border-right: 3px solid #f2d397;
}
.compare-overlay img {
  display: block; height: 100%;
  max-width: none;
}
.compare-handle {
  position: absolute; top: 0; width: 3px;
  height: 100%; background: #f2d397; cursor: ew-resize; z-index: 10;
}
.compare-handle::after {
  content: ''; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 36px; height: 36px; background: #f2d397;
  border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ─── File List (for multi-upload) ─── */
.tool-file-list {
  list-style: none; padding: 0; margin: 0.5rem 0;
}
.tool-file-list li {
  padding: 0.4rem 0.75rem; background: #f0fdf4;
  border-radius: 6px; margin-bottom: 0.3rem;
  font-size: 0.9rem; color: #374151;
  display: flex; justify-content: space-between; align-items: center;
}
.tool-file-list .remove-file {
  color: #dc2626; cursor: pointer; font-weight: bold;
}

/* ─── Multi-Upload File List (div-based) ─── */
.tool-file-item {
  padding: 0.5rem 0.75rem; background: #f0fdf4;
  border-radius: 6px; margin-bottom: 0.4rem;
  font-size: 0.9rem; color: #374151;
  display: flex; align-items: center; gap: 0.5rem;
}
.tool-file-item i { color: #22c55e; }
.tool-file-size { color: #9ca3af; font-size: 0.8rem; }

/* ─── Result Cards Grid ─── */
.tool-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem; margin-top: 1.5rem;
  max-width: 100%; overflow: hidden;
}
.tool-result-card {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  max-width: 100%;
}
.tool-result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.tool-result-card img {
  width: 100%; max-width: 100%; height: 180px; object-fit: cover;
  border-bottom: 1px solid #e2e8f0;
  display: block;
  background: repeating-conic-gradient(#e5e7eb 0% 25%, transparent 0% 50%) 50% / 16px 16px;
}
.tool-result-info {
  padding: 0.75rem; display: flex; flex-direction: column;
  align-items: center; gap: 0.5rem; text-align: center;
}
.tool-result-info span {
  font-weight: 600; color: #374151;
  font-size: 0.85rem; word-break: break-word;
}
.tool-result-info .tool-download-btn {
  padding: 0.5rem 1.2rem; font-size: 0.85rem;
  border-radius: 6px; text-decoration: none;
  display: inline-block;
}

/* ─── Metadata Badges ─── */
.tool-badges {
  display: flex; flex-wrap: wrap; gap: 0.3rem;
  justify-content: center; margin: 0.25rem 0;
}
.tool-badge {
  font-size: 0.7rem; font-weight: 600;
  padding: 0.2rem 0.5rem; border-radius: 4px;
}
.tool-badge-removed {
  background: #fef2f2; color: #dc2626; border: 1px solid #fecaca;
}
.tool-badge-clean {
  background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0;
}

/* ─── Half-Width Upload Boxes (Overlay Tool) ─── */
.tool-upload-half {
  flex: 1; min-width: 200px; overflow: hidden;
}

/* ═══ Responsive ═══ */
@media (max-width: 600px) {
  .tool-box { padding: 1.25rem; }
  .tool-title { font-size: 1.3rem; }
  .tool-btn-group { gap: 0.3rem; }
  .tool-btn { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
  .tool-preview { flex-direction: column; align-items: center; }
  .tool-preview-item { min-width: unset; max-width: 100%; }
  .tool-upload { padding: 1.25rem; }
  .tool-actions { flex-direction: column; align-items: stretch; }
  .tool-process-btn, .tool-download-btn { width: 100%; }
  .tool-row { flex-direction: column; }
  .tool-results { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
  .tool-result-card img { height: 140px; }
  .tool-upload-half { min-width: 100%; }
}
