/* Reset & Base */
body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: #f7f9fc;
  color: #111827;
}

/* Header */
.top-banner {
  background-color: #3b82f6;
  color: white;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  text-align: center;
  font-weight: 500;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.tagline {
  font-size: 0.95rem;
  color: #e0e7ff;
}

/* Layout */
.main-grid {
  display: grid;
  grid-template-columns: 1fr minmax(0, 768px) 1fr;
  gap: 2rem;
  padding: 2rem;
  justify-content: center;
}

@media (max-width: 768px) {
  .main-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .ad.left-ad,
  .ad.right-ad {
    display: none;
  }

  .ad.bottom-ad {
    margin-bottom: 2rem;
  }

  .content {
    width: 100%;
  }
}

.ad {
  background-color: #f1f5f9;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: #6b7280;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
  height: fit-content;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.box {
  background-color: white;
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

/* Upload */
.upload-box {
  display: block;
  cursor: pointer;
}

.upload-area {
  border: 2px dashed #cbd5e1;
  padding: 2rem;
  text-align: center;
  border-radius: 8px;
  background-color: #f9fafb;
  color: #6b7280;
  transition: background-color 0.3s ease, transform 0.2s ease;
  position: relative;
}

.upload-area:hover {
  background-color: #e0e7ff;
  transform: scale(1.01);
}

.upload-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

/* Image Preview & Result */
.preview-box {
  min-height: 180px;
  background-color: #f1f5f9;
  border: 1px dashed #d1d5db;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #9ca3af;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.preview-box > div {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.preview-box img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

/* Remove button (X) */
.preview-box .remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #f87171;
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: background 0.2s ease, transform 0.2s ease;
}

.preview-box .remove-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
}

/* Pixelation Slider */
.range-wrapper {
  margin-top: 1rem;
}

.range-wrapper input[type="range"] {
  width: 100%;
  appearance: none;
  height: 6px;
  background: linear-gradient(to right, #3b82f6 0%, #3b82f6 100%);
  border-radius: 3px;
  outline: none;
  transition: background 0.3s;
}

.range-wrapper input[type="range"]:hover {
  background: linear-gradient(to right, #3b82f6 0%, #93c5fd 100%);
}

.range-wrapper input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  border: 2px solid #3b82f6;
}

.range-wrapper input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  border: 2px solid #3b82f6;
}

/* Buttons */
button {
  padding: 0.6rem 1.2rem;
  margin-top: 1rem;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  background-color: #3b82f6;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

button:hover {
  background-color: #2563eb;
  transform: scale(1.02);
}

.actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.actions button {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  background-color: #3b82f6;
  padding: 0.6rem 1rem;
}

.actions button:hover {
  transform: translateY(-2px);
}

/* Footer */
footer {
  margin-top: 3rem;
  background-color: white;
  border-top: 1px solid #e5e7eb;
  padding: 2rem 1rem;
  text-align: center;
}

.ad.bottom-ad {
  max-width: 1024px;
  margin: 0 auto 1rem;
  background-color: #f1f5f9;
  border: 1px dashed #cbd5e1;
  padding: 1.25rem;
  border-radius: 8px;
}

.footer-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.footer-info nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  justify-content: center;
}

.footer-info a {
  color: #3b82f6;
  text-decoration: none;
}

.footer-info a:hover {
  text-decoration: underline;
}

.logo-img {
  height: 40px;
  object-fit: contain;
  vertical-align: middle;
}