/* ==========================================================================
   Global Reset & Base
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f8fafc;
  color: #1e293b;
  line-height: 1.5;
  min-height: 100vh;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.page-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* ==========================================================================
   Header
   ========================================================================== */

.header {
  text-align: center;
  margin-bottom: 2.5rem;
}

h1 {
  color: #2563eb;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: #64748b;
  font-size: 1.125rem;
}

/* ==========================================================================
   Tool Area
   ========================================================================== */

.tool-section {
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  padding: 2rem;
  margin-bottom: 2rem;
}

.drop-zone {
  border: 3px dashed #cbd5e1;
  border-radius: 12px;
  padding: 5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-bottom: 1.5rem;
}

.drop-zone:hover,
.drop-zone.active {
  border-color: #3b82f6;
  background: #eff6ff;
}

.drop-content p {
  font-size: 1.25rem;
  margin: 0.5rem 0;
}

.drop-content small {
  color: #64748b;
}

/* Previews */

.preview-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.preview-box {
  text-align: center;
}

.preview-box h3 {
  margin-bottom: 0.75rem;
  color: #475569;
  font-size: 1.1rem;
}

.preview-box img,
.preview-box canvas {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  background: #f1f5f9;
}

/* Controls */

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.control-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.control-item label {
  font-weight: 500;
  color: #334155;
}

input[type="number"],
input[type="range"] {
  padding: 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 1rem;
}

.range-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#quality-value {
  font-weight: 600;
  min-width: 3.5rem;
  text-align: right;
}

.checkbox label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

/* Button & Result */

.action-bar {
  text-align: center;
  margin: 2rem 0;
}

button {
  padding: 0.9rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: #1d4ed8;
}

.result-message {
  text-align: center;
  font-weight: 600;
  color: #15803d;
  min-height: 1.5rem;
}

/* Privacy & FAQ */

.privacy-notice {
  text-align: center;
  font-size: 0.95rem;
  color: #475569;
  background: #eff6ff;
  padding: 1.25rem;
  border-radius: 10px;
  margin-top: 2rem;
}

.faq-section {
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  padding: 2rem;
  margin-bottom: 2rem;
}

.faq-section h2 {
  color: #2563eb;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
}

.faq-section ol {
  list-style-position: inside;
  margin-bottom: 1.5rem;
}

.faq-section li {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.faq-section p {
  font-size: 1.1rem;
}

/* Footer */

.footer {
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
  margin-top: 3rem;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .preview-container {
    grid-template-columns: 1fr;
  }
  
  h1 {
    font-size: 2rem;
  }
}

.batch-info {
  text-align: center;
  font-size: 1.1rem;
  color: #475569;
  margin: 1rem 0;
  font-weight: 500;
}

.batch-info span {
  color: #2563eb;
  font-weight: 700;
}

.secondary {
  margin-left: 1rem;
  background: #6b7280;
  color: white;
}

.secondary:hover {
  background: #4b5563;
}

#clear-btn {
  display: none;
}

.ad-container {
  background: #f8fafc;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  margin: 2rem auto;
  max-width: 728px; /* keeps it neat */
  text-align: center;
}

.bottom-ad {
  margin-top: 4rem;
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.footer-nav a {
  color: #64748b;
  text-decoration: none;
  font-size: 0.95rem;
}

.footer-nav a:hover {
  color: #2563eb;
  text-decoration: underline;
}

.footer {
  text-align: center;
  padding: 2rem 0;
  color: #64748b;
  border-top: 1px solid #e2e8f0;
  margin-top: 4rem;
}
