* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #0066cc;
  --primary-dark: #0052a3;
  --gray-50: #fafbfc;
  --gray-100: #f6f8fa;
  --gray-200: #eaeef2;
  --gray-300: #d0d7de;
  --gray-400: #b1bac4;
  --gray-500: #8b949e;
  --gray-600: #6e7681;
  --gray-700: #57606a;
  --gray-800: #424a53;
  --gray-900: #24292f;
  --success: #1a7f0f;
  --error: #da3633;
  --warning: #d29922;
  --secondary: #2c5282;
  --secondary-hover: #1e3a5f;
}

html.dark-mode {
  --primary: #3b82f6;
  --primary-dark: #1d4ed8;
  --gray-50: #1a1a1a;
  --gray-100: #242424;
  --gray-200: #3a3a3a;
  --gray-300: #4a4a4a;
  --gray-400: #666;
  --gray-500: #888;
  --gray-600: #aaa;
  --gray-700: #ccc;
  --gray-800: #ddd;
  --gray-900: #f0f0f0;
  --secondary: #4f9df9;
  --secondary-hover: #2e7de1;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background-color: #fff;
  color: var(--gray-900);
  line-height: 1.5;
  font-size: 14px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

html.dark-mode body {
  background-color: #1a1a1a;
  color: var(--gray-900);
}

header {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

html.dark-mode header {
  background: #242424;
  border-bottom-color: #3a3a3a;
}

header .container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
}

header h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.15rem;
  letter-spacing: -0.5px;
}

header p {
  font-size: 0.8rem;
  color: var(--gray-600);
  font-weight: 400;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
}

main {
  min-height: calc(100vh - 180px);
  padding: 1rem 0;
}

h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--gray-900);
}

h2 {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: var(--gray-800);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tools section grid */
.tools-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

.tools-section > div {
  /* each div is a column containing h2 + list */
}

.tools-section h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--gray-900);
}

h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-800);
}

p {
  margin-bottom: 0.75rem;
  color: var(--gray-700);
  line-height: 1.6;
}

.intro {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-bottom: 0.75rem;
}

/* Forms & Inputs */
input, textarea, select {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  background: #fff;
  color: var(--gray-900);
}

input::placeholder, textarea::placeholder, select::placeholder {
  color: var(--gray-500);
  opacity: 1;
}

html.dark-mode input, html.dark-mode textarea, html.dark-mode select {
  background: #2a2a2a;
  color: #e0e0e0;
  border-color: #3a3a3a;
}

html.dark-mode input::placeholder, html.dark-mode textarea::placeholder, html.dark-mode select::placeholder {
  color: #666;
  opacity: 1;
}

html.dark-mode select option {
  background: #2a2a2a;
  color: #e0e0e0;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

textarea {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  resize: vertical;
  min-height: 120px;
  width: 100%;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--gray-800);
  font-size: 0.85rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

/* Buttons */
button, .btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s ease;
  text-decoration: none;
}

button:hover, .btn:hover {
  background: var(--primary-dark);
}

button:active, .btn:active {
  opacity: 0.9;
}

button.secondary {
  background: var(--secondary);
  color: white;
}

button.secondary:hover {
  background: var(--secondary-hover);
}

button.small {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

button.copy {
  background: var(--gray-700);
}

button.copy:hover {
  background: var(--gray-800);
}

button.preset {
  background: var(--gray-50);
  color: var(--primary);
  border: 1px solid var(--gray-300);
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
}

button.preset:hover {
  background: var(--gray-100);
  border-color: var(--primary);
}

button.preset:active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}


/* Output / Result Display */
.output {
  background: var(--gray-50);
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  padding: 1.25rem;
  margin-top: 1rem;
}

.output-label {
  font-weight: 700;
  color: var(--gray-700);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.5rem;
}

.output-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  word-break: break-all;
  line-height: 1.4;
}

.output-secondary {
  font-size: 0.9rem;
  color: var(--gray-700);
  margin-top: 0.75rem;
  line-height: 1.5;
}

/* Tools List */
.tools-list {
  list-style: none;
  margin: 0 0 0.5rem 0;
}

.tools-list li {
  margin-bottom: 0;
}

.tools-list a {
  display: block;
  padding: 0.6rem 0.75rem;
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.9rem;
  transition: background-color 0.15s ease;
  line-height: 1.3;
  font-weight: 500;
}

.tools-list a:hover {
  background-color: var(--gray-50);
  padding-left: 1rem;
}

.tools-list a span {
  font-size: 0.8rem;
  color: var(--gray-600);
  display: block;
  margin-top: 0.2rem;
  line-height: 1.3;
  font-weight: 400;
}

/* Footer */
footer {
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 1rem 1rem 0.75rem;
  margin-top: 2rem;
  border-top: 1px solid var(--gray-200);
  font-size: 0.85rem;
}

html.dark-mode footer {
  background: #242424;
  border-top-color: #3a3a3a;
  color: var(--gray-600);
}

.footer-content {
  max-width: 1000px;
  margin: 0 auto 0.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.footer-section h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--gray-900);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

html.dark-mode .footer-section h4 {
  color: var(--gray-700);
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section li {
  margin-bottom: 0.3rem;
}

.footer-section a {
  color: var(--primary);
  text-decoration: none;
  transition: text-decoration 0.2s;
  font-size: 0.9rem;
}

.footer-section a:hover {
  text-decoration: underline;
}

.footer-bottom {
  max-width: 1000px;
  margin: 0 auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--gray-600);
  font-size: 0.75rem;
}

html.dark-mode .footer-bottom {
  border-top-color: #3a3a3a;
  color: var(--gray-500);
}

.footer-bottom p {
  flex: 1;
  margin: 0;
}

.footer-bottom a {
  color: var(--primary);
  text-decoration: none;
}

.footer-bottom a:hover {
  text-decoration: underline;
}

.footer-support {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.65rem;
  color: var(--gray-600);
  white-space: nowrap;
}

html.dark-mode .footer-support {
  color: var(--gray-500);
}

.footer-support img {
  height: 24px !important;
  width: 90px !important;
}

.footer-support a {
  display: inline-block;
  text-decoration: none;
}

@media (max-width: 600px) {
  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-support {
    align-items: center;
  }

  .footer-support img {
    height: 20px !important;
    width: 75px !important;
  }
}

/* Navigation back link */
.nav-back {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.nav-back:hover {
  text-decoration: underline;
}

/* Tool page indicator */
.tool-header {
  border-bottom: 1px solid var(--gray-300);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.tool-header h1 {
  margin-bottom: 0.25rem;
  font-size: 1.25rem;
}

.tool-header p {
  margin-bottom: 0;
  font-size: 0.85rem;
  color: var(--gray-600);
}

/* Explanations & Additional Info */
.explanation {
  background: var(--gray-50);
  border-left: 3px solid var(--gray-300);
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
  border-radius: 2px;
}

.explanation h3 {
  margin-bottom: 0.5rem;
  color: var(--gray-900);
}

.explanation p {
  font-size: 0.9rem;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.explanation ul,
.explanation ol {
  margin-left: 1.5rem;
  margin-bottom: 0.5rem;
}

.explanation li {
  font-size: 0.9rem;
  color: var(--gray-700);
  margin-bottom: 0.3rem;
}

/* Warnings */
.warning {
  background: #fff8e1;
  border-left: 3px solid var(--warning);
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  border-radius: 2px;
  font-size: 0.9rem;
  color: var(--gray-800);
}

html.dark-mode .warning {
  background: #2a2a1a;
  color: #e8e8b0;
  border-left-color: #f59e0b;
}

/* Checkboxes */
.checkbox-group {
  margin: 1rem 0;
}

.checkbox-item {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-right: 0.5rem;
  cursor: pointer;
}

.checkbox-item label {
  margin-bottom: 0;
  cursor: pointer;
  font-weight: 400;
}

/* Progress Bar */
.progress-bar {
  background: var(--gray-200);
  height: 24px;
  border-radius: 3px;
  overflow: hidden;
  margin: 0.75rem 0;
}

.progress-fill {
  background: var(--primary);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  transition: width 0.3s ease;
}
/* AdSense Ad Slots */
.ad-slot {
  margin: 2rem 0;
  text-align: center;
  min-height: 250px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 0.85rem;
  padding: 1rem;
}

html.dark-mode .ad-slot {
  background: #1a1a1a;
  border-color: #3a3a3a;
}

/* Ad compliance: Clear spacing around ads */
.ad-container {
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: 4px;
}

html.dark-mode .ad-container {
  background: #1a1a1a;
}

/* Discourage clicking: Ad label styling */
.ad-label {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

html.dark-mode .ad-label {
  color: var(--gray-600);
}

/* Accessibility: Skip to content link */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-to-main:focus {
  top: 0;
}

/* Quality content indicators */
.quality-badge {
  display: inline-block;
  background: var(--success);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  margin-right: 0.5rem;
  font-weight: 600;
}