/* ============================================================
   Image Compressor — image-compressor.css
   Chedders Tools | Follows Chedders Bootstrap Core DNA
   ============================================================ */

/* --- Base / Variables --- */
:root {
  --primary: #0b1f3a;
  --primary-light: #16345f;
  --background: #ffffff;
  --surface: #f8f9fa;
  --text: #111111;
  --muted: #6c757d;
  --border: #e5e7eb;
  --shadow: rgba(0,0,0,0.05);
}

[data-theme="dark"] {
  --background: #081120;
  --surface: #0f1c2e;
  --text: #ffffff;
  --muted: #b0b7c3;
  --border: rgba(255,255,255,0.08);
  --shadow: rgba(0,0,0,0.3);
}

/* --- Layout Foundation --- */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Plus Jakarta Sans', 'Manrope', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--background);
  margin: 0;
  transition: background 0.25s ease, color 0.25s ease;
}

.container-xl {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Navbar --- */
.navbar {
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.navbar .container-xl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.navbar-brand { text-decoration: none; font-size: 16px; }
.brand-text { font-weight: 700; color: var(--primary); }
.brand-dot { color: var(--primary); font-weight: 700; }
.brand-tools { font-weight: 400; color: var(--muted); }

.nav-right { display: flex; align-items: center; gap: 16px; }

.nav-back {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-back:hover { color: var(--primary); }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.2s;
}
.theme-toggle:hover { border-color: var(--primary); }

/* --- Page Header --- */
.tool-header { padding: 40px 0 24px; }

.tool-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  line-height: 1.2;
  transition: color 0.25s ease;
}
[data-theme="dark"] .tool-title { color: #ffffff; }

.tool-description {
  font-size: 15px;
  color: var(--muted);
  margin: 6px 0 0;
}

/* --- Tool Main --- */
.tool-main { padding: 0 0 80px; }

/* --- Tool Card --- */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 8px var(--shadow);
  transition: background 0.25s ease, border-color 0.25s ease;
}

/* --- Upload Zone --- */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.upload-zone.dragover {
  border-style: solid;
  border-color: var(--primary);
  background: rgba(11,31,58,0.04);
}

.upload-icon {
  font-size: 32px;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1;
}

.upload-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}

.upload-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 16px;
}

.upload-btn-label {
  cursor: pointer;
  display: inline-block;
}

/* --- Options Row --- */
.options-row {
  margin-top: 20px;
}

.options-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-row .form-range {
  flex: 1;
  accent-color: var(--primary);
}

.slider-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  min-width: 28px;
  text-align: right;
  font-family: 'Courier New', monospace;
}

[data-theme="dark"] .slider-value { color: var(--muted); }

.helper-text {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
}

/* Select */
.form-select-chedders {
  width: 100%;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  appearance: auto;
  transition: border-color 0.2s, background 0.25s ease;
}

.form-select-chedders:focus {
  outline: 2px solid var(--primary);
  outline-offset: 0;
}

/* --- PNG Notice --- */
.png-notice {
  font-size: 13px;
  color: var(--muted);
  margin: 16px 0 0;
  padding: 10px 14px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* --- Preview Section --- */
.preview-section { margin-top: 24px; }

.preview-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
}

.preview-img-wrap {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
}

.preview-img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  display: block;
}

.size-info {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 0;
}

.savings-info {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin: 16px 0 0;
}

[data-theme="dark"] .savings-info { color: var(--muted); }

/* --- Buttons --- */
.btn-primary-chedders {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary-chedders:hover { background: var(--primary-light); color: #fff; }

.btn-secondary-chedders {
  background: var(--background);
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-secondary-chedders:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-group-row { display: flex; gap: 8px; flex-wrap: wrap; }

.w-100 { width: 100%; }

/* --- Error --- */
.error-msg {
  font-size: 13px;
  color: #dc3545;
  margin: 12px 0 0;
}

/* --- Footer --- */
.site-footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  transition: border-color 0.25s ease;
}

.footer-text {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin: 0;
}
.footer-text a { color: var(--primary); text-decoration: none; }
.footer-text a:hover { text-decoration: underline; }

/* --- Dark mode overrides --- */
[data-theme="dark"] .tool-card { background: var(--surface); }
[data-theme="dark"] .btn-secondary-chedders { background: var(--surface); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .btn-secondary-chedders:hover { background: var(--primary); color: #fff; }
[data-theme="dark"] .form-select-chedders { background: var(--surface); }

/* --- Responsive --- */
@media (max-width: 575px) {
  .tool-card { padding: 16px; }
  .tool-title { font-size: 22px; }
  .btn-primary-chedders,
  .btn-secondary-chedders { width: 100%; text-align: center; }
  .btn-group-row { flex-direction: column; }
  .upload-zone { padding: 32px 16px; }
}
