/* UTILITY SEO Micro Tools - Global Styles */
/* Bright & Friendly Design System */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  /* Light Theme Base */
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-result: #f0fdf4;
  
  /* Text Colors */
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  /* Accent Colors */
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: #eff6ff;
  --success: #22c55e;
  --success-light: #f0fdf4;
  --error: #ef4444;
  --error-light: #fef2f2;
  
  /* Borders & Shadows */
  --border: #e2e8f0;
  --border-result: #bbf7d0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  
  /* Tool-specific accent colors */
  --tool-tip: #16a34a;
  --tool-tip-bg: #f0fdf4;
  --tool-tip-border: #bbf7d0;
  --tool-salary: #2563eb;
  --tool-salary-bg: #eff6ff;
  --tool-salary-border: #bfdbfe;
  --tool-bmi: #d97706;
  --tool-bmi-bg: #fffbeb;
  --tool-bmi-border: #fde68a;
  --tool-json: #7c3aed;
  --tool-json-bg: #f5f3ff;
  --tool-json-border: #ddd6fe;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Layout */
.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.container-wide {
  max-width: 900px;
}

@media (min-width: 640px) {
  .container {
    padding: 3rem 1.5rem;
  }
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

header p {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Tool Card */
.tool-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

@media (min-width: 640px) {
  .tool-card {
    padding: 2rem;
  }
}

/* Form Elements */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

input[type="text"],
input[type="number"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 48px;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #cbd5e1;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  min-height: 48px;
}

.btn-primary {
  background: var(--accent);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
  border-color: #cbd5e1;
}

/* Result Display - Highlight Zone */
.result {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-result);
  border: 2px solid var(--border-result);
  border-radius: var(--radius);
  display: none;
  position: relative;
}

.result.show {
  display: block;
  animation: resultReveal 0.25s ease-out;
}

@keyframes resultReveal {
  from { 
    opacity: 0.8; 
    transform: scale(0.98); 
  }
  to { 
    opacity: 1; 
    transform: scale(1); 
  }
}

.result-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.result-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--success);
  line-height: 1.1;
  margin-bottom: 0.25rem;
  transition: transform 0.15s ease-out, opacity 0.15s ease-out;
}

.result-value.updating {
  transform: scale(0.98);
  opacity: 0.85;
}

.result-detail {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  line-height: 1.5;
}

/* Grid for inputs */
.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 480px) {
  .input-row {
    grid-template-columns: 1fr;
  }
}

/* Tool List (Home) */
.tool-list {
  display: grid;
  gap: 0.75rem;
}

.tool-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.tool-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.tool-item:active {
  transform: translateY(0);
}

.tool-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  margin-right: 1rem;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.tool-info h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.tool-info p {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Ad Placeholder - Subtle & Blended */
.ad-slot {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Footer */
footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

footer a:hover {
  color: var(--accent);
}

/* Utilities */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-small { font-size: 0.875rem; }

/* Copy Button */
.copy-btn {
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.copy-btn:hover {
  background: var(--border);
  color: var(--text-primary);
}

.copy-btn.copied {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

/* Textarea for tools like JSON formatter */
textarea {
  min-height: 150px;
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 0.875rem;
  resize: vertical;
  line-height: 1.5;
}

/* Category badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 100px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.badge-finance { background: var(--tool-salary-bg); color: var(--tool-salary); }
.badge-health { background: var(--tool-tip-bg); color: var(--tool-tip); }
.badge-text { background: var(--tool-json-bg); color: var(--tool-json); }
.badge-dev { background: var(--tool-bmi-bg); color: var(--tool-bmi); }

/* Tool-specific result colors */
.result--tip { 
  --bg-result: var(--tool-tip-bg); 
  --border-result: var(--tool-tip-border); 
}
.result--tip .result-value { color: var(--tool-tip); }

.result--salary { 
  --bg-result: var(--tool-salary-bg); 
  --border-result: var(--tool-salary-border); 
}
.result--salary .result-value { color: var(--tool-salary); }

.result--bmi { 
  --bg-result: var(--tool-bmi-bg); 
  --border-result: var(--tool-bmi-border); 
}
.result--bmi .result-value { color: var(--tool-bmi); }

.result--json { 
  --bg-result: var(--tool-json-bg); 
  --border-result: var(--tool-json-border); 
}

/* Icon labels */
.icon-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-label .icon {
  font-size: 1rem;
}

/* Lighter description section */
.tool-card--info {
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: 1.25rem 0 0 0;
  margin-top: 1.5rem;
}

.tool-card--info h2 {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.tool-card--info p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Status messages (for JSON formatter etc.) */
.status {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
  display: none;
}

.status.show {
  display: block;
  animation: statusReveal 0.2s ease-out;
}

@keyframes statusReveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.status.success { 
  background: var(--success-light); 
  color: var(--success); 
  border: 1px solid var(--tool-tip-border); 
}

.status.error { 
  background: var(--error-light); 
  color: var(--error); 
  border: 1px solid #fecaca; 
}

/* Pill buttons (for tip percentage selection etc.) */
.pill-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill-btn {
  flex: 1;
  min-width: 60px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 100px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 48px;
}

.pill-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.pill-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.pill-btn:active {
  transform: scale(0.98);
}
