* { 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 (inherited from open-style pattern) */
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; }

/* Visitor Strip */
.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);
  }
}

/* ===== Background Tool Specific Styles ===== */
.bg-tool-section {
  padding: 2rem 1rem;
  max-width: 900px;
  margin: 2rem auto;
}

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

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

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

/* Mode Tabs */
.bg-mode-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.bg-tab {
  background: #eef2f7;
  border: 2px solid transparent;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s;
  color: #485565;
}

.bg-tab:hover {
  background: #e2e8f0;
}

.bg-tab.active {
  background: #f2d397;
  border-color: #d4a84b;
  color: #2c3e50;
}

/* Upload Area */
.bg-upload-area {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s;
  margin-bottom: 1.5rem;
  cursor: pointer;
}

.bg-upload-area.drag-over {
  border-color: #f2d397;
  background: #fffbeb;
}

.bg-upload-area.has-file {
  border-color: #22c55e;
  background: #f0fdf4;
}

.bg-upload-icon {
  font-size: 2.5rem;
  color: #94a3b8;
  margin-bottom: 0.75rem;
  display: block;
}

.bg-upload-area p {
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.bg-upload-label {
  display: inline-block;
  background: #f2d397;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
  margin-bottom: 0.5rem;
}

.bg-upload-label:hover {
  background: #fcd34d;
}

#bg-file-input {
  display: none;
}

.bg-file-hint {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 0.5rem;
}

.bg-file-name {
  display: inline-block;
  margin-top: 0.5rem;
  font-weight: 600;
  color: #22c55e;
}

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

.bg-control-group {
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.bg-control-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #374151;
}

#blur-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #e2e8f0;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

#blur-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #f2d397;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #d4a84b;
}

#blur-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #f2d397;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #d4a84b;
}

.bg-color-pick-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#color-picker {
  width: 50px;
  height: 40px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  padding: 2px;
}

#color-hex-display {
  font-weight: 600;
  color: #374151;
  font-family: monospace;
  font-size: 1rem;
}

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

#bg-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;
}

#bg-process-btn:hover:not(:disabled) {
  background: #fcd34d;
}

#bg-process-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#bg-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;
}

#bg-download-btn:hover {
  background: #2563eb;
}

/* Loading Spinner */
.bg-loading {
  text-align: center;
  padding: 2rem;
}

.bg-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e2e8f0;
  border-top: 4px solid #f2d397;
  border-radius: 50%;
  animation: bg-spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

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

.bg-loading p {
  color: #6b7280;
  font-weight: 500;
}

/* Preview */
.bg-preview {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.bg-preview-item {
  flex: 1;
  min-width: 250px;
  max-width: 400px;
  text-align: center;
}

.bg-preview-item h4 {
  margin-bottom: 0.5rem;
  color: #374151;
  font-size: 0.95rem;
}

.bg-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;
}

/* Error */
.bg-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;
}

.bg-error i {
  font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 600px) {
  .bg-tool-box {
    padding: 1.25rem;
  }

  .bg-mode-tabs {
    gap: 0.3rem;
  }

  .bg-tab {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .bg-preview {
    flex-direction: column;
    align-items: center;
  }

  .bg-preview-item {
    min-width: unset;
    max-width: 100%;
  }

  .bg-upload-area {
    padding: 1.25rem;
  }

  .bg-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #bg-process-btn, #bg-download-btn {
    width: 100%;
  }
}
