/* === Free Online Tools - Shared Styles === */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
}

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

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

/* Header */
.site-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}
.site-header .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}
.site-header nav { display: flex; gap: 1.25rem; }
.site-header nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .9rem;
  transition: color .15s;
}
.site-header nav a:hover { color: var(--primary); }

/* Main */
.main { flex: 1; max-width: 1200px; width: 100%; margin: 0 auto; padding: 2rem 1.5rem; }

/* Hero */
.hero { text-align: center; padding: 3rem 1rem 2rem; }
.hero h1 { font-size: 2.25rem; margin-bottom: .75rem; }
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 600px; margin: 0 auto 1.5rem; }

/* Search */
.search-wrap {
  max-width: 480px;
  margin: 0 auto 1rem;
  position: relative;
}
.search-wrap input {
  width: 100%;
  padding: .75rem 1rem .75rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.search-wrap .search-icon {
  position: absolute; left: .75rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Tool Grid */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}
.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .2s, border-color .2s;
}
.tool-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary);
}
.tool-card h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.tool-card p { color: var(--text-muted); font-size: .88rem; line-height: 1.45; }

/* Tool page */
.tool-container { max-width: 720px; margin: 0 auto; }
.tool-container h2 { font-size: 1.5rem; margin-bottom: .5rem; }
.tool-container .tool-desc { color: var(--text-muted); margin-bottom: 1.5rem; }
.tool-card-inner {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* Form elements */
label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .9rem; }
input, textarea, select {
  width: 100%;
  padding: .6rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
textarea { resize: vertical; min-height: 120px; }
button, .btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: .65rem 1.25rem;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
button:hover, .btn:hover { background: var(--primary-hover); }
button:active { transform: scale(.98); }

.form-group { margin-bottom: 1rem; }
.result-box {
  margin-top: 1.25rem;
  padding: 1rem;
  background: #f1f5f9;
  border-radius: var(--radius);
  font-size: 1.05rem;
  min-height: 2.5rem;
  word-break: break-word;
}

/* Ko-fi button */
.kofi-wrap { text-align: center; margin-top: 2rem; }

/* Footer */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .85rem;
}
.site-footer a { color: var(--text-muted); text-decoration: underline; }
.site-footer a:hover { color: var(--text); }

/* Utility */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }

@media (max-width: 600px) {
  .site-header { padding: 1rem; }
  .main { padding: 1.5rem 1rem; }
  .hero h1 { font-size: 1.6rem; }
  .tool-grid { grid-template-columns: 1fr; }
}
