/* --- Base Resets & Typography --- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #f8fafc;
  color: #334155;
  line-height: 1.5;
}

/* --- Layout Containers --- */
.container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.tool-wrapper, .comments-section, .card {
  background: #ffffff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
}

.comments-section {
  margin-top: 2.5rem;
}

/* --- Header Component --- */
.site-header {
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-header .logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.site-header .logo-img {
  height: 38px;
  width: auto;
  display: block;
}

.site-header nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.site-header nav a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

.site-header nav a:hover {
  color: #ffffff;
}

/* --- Tool Components --- */
.drop-zone {
  border: 2px dashed #cbd5e1;
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  border-radius: 8px;
  background: #f8fafc;
  transition: border-color 0.2s, background-color 0.2s;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: #2563eb;
  background-color: #eff6ff;
}

.drop-zone p {
  margin: 0;
  font-weight: 500;
  color: #334155;
}

.controls-wrapper {
  margin-top: 2rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 1.5rem;
}

.btn-primary {
  display: inline-block;
  background: #2563eb;
  color: #ffffff;
  padding: 0.75rem 2rem;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #1d4ed8;
}

/* --- Cards Grid (Homepage) --- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.tool-card {
  text-decoration: none;
  color: inherit;
  display: block;
}

.tool-card:hover .card {
  border-color: #2563eb;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.tool-card h3 {
  margin-top: 0;
  color: #2563eb;
  font-size: 1.2rem;
}

/* --- Footer Component --- */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 3rem 1.5rem 2rem;
  margin-top: 4rem;
  border-top: 1px solid #1e293b;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  text-align: left;
  margin-bottom: 2.5rem;
}

.footer-col h3 {
  color: #fff;
  font-size: 1.2rem;
  margin: 0 0 0.75rem 0;
}

.footer-col h4 {
  color: #cbd5e1;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.75rem 0;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
  line-height: 2;
}

.footer-col a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #38bdf8;
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
}

.footer-bottom sub {
  display: block;
  margin-top: 0.4rem;
  color: #64748b;
  font-size: 0.8rem;
}

/* --- Utility & Form Classes --- */
.subtitle { color: #64748b; margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.hidden { display: none; }
.form-group { margin-bottom: 1.5rem; }
.form-label { font-weight: 600; color: #1e293b; display: block; }
.range-input { width: 100%; margin-top: 0.5rem; cursor: pointer; }
.preview-img {
  max-width: 100%;
  height: auto;
  display: none;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}


/* --- Hero Section --- */
.hero {
  text-align: center;
  margin-bottom: 3rem;
}

.hero h1 {
  font-size: 2.5rem;
  color: #0f172a;
  margin-bottom: 0.5rem;
  margin-top: 0;
}

.hero p {
  font-size: 1.15rem;
  color: #64748b;
  margin-top: 0;
}

/* --- Tool Cards --- */
.card p {
  color: #64748b;
  font-size: 0.95rem;
  margin-bottom: 0;
  line-height: 1.5;
}

/* --- Header Link Contrast Fix --- */
.site-header nav a {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.2s;
}

.site-header nav a:hover {
  color: #38bdf8;
}

/* --- Footer Text Contrast Fix --- */
.footer-col h3, 
.footer-col h4,
.footer-bottom strong {
  color: #ffffff;
}

.footer-col p,
.footer-bottom,
.footer-bottom sub {
  color: #cbd5e1;
}

.footer-col p {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #cbd5e1; /* High contrast replacement for #64748b */
}

.footer-col a {
  color: #e2e8f0;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #38bdf8;
}