/* ===== Solve It For Me — Shared Stylesheet ===== */

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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f9fafb;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

/* ===== HEADER ===== */
header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.3px;
}
.logo span { color: var(--text); }
nav { display: flex; gap: 4px; }
nav a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
nav a:hover { background: var(--bg); color: var(--text); }

/* ===== AD SLOTS ===== */
.ad-leaderboard {
  background: #f3f4f6;
  border: 1px dashed #d1d5db;
  width: 100%;
  max-width: 728px;
  height: 90px;
  margin: 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #9ca3af;
  border-radius: 6px;
}
.ad-rectangle {
  background: #f3f4f6;
  border: 1px dashed #d1d5db;
  width: 300px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #9ca3af;
  border-radius: 6px;
  flex-shrink: 0;
}
.ad-in-content {
  background: #f3f4f6;
  border: 1px dashed #d1d5db;
  width: 100%;
  max-width: 728px;
  height: 90px;
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #9ca3af;
  border-radius: 6px;
}
.ad-mobile {
  background: #f3f4f6;
  border: 1px dashed #d1d5db;
  width: 320px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #9ca3af;
  border-radius: 6px;
  margin: 0 auto;
}

/* ===== LAYOUT ===== */
.page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 48px;
}
.tool-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-top: 24px;
}
.tool-main { flex: 1; min-width: 0; }
.tool-sidebar { width: 300px; flex-shrink: 0; position: sticky; top: 24px; align-self: flex-start; }

/* ===== HERO (homepage) ===== */
.hero {
  text-align: center;
  padding: 48px 24px 32px;
}
.hero h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.5px; }
.hero p { color: var(--muted); margin-top: 8px; font-size: 17px; }

/* Search bar */
.search-wrap { position: relative; max-width: 480px; margin: 24px auto 0; }
.search-wrap input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 15px;
  background: var(--white);
  box-shadow: var(--shadow-md);
  outline: none;
  transition: border-color .2s;
}
.search-wrap input:focus { border-color: var(--primary); }
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

/* ===== TOOL GRID ===== */
.section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 12px;
  margin-top: 32px;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.tool-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .15s, border-color .15s;
  display: block;
}
.tool-card:hover { box-shadow: var(--shadow-md); border-color: #c7d2fe; }
.tool-card-icon { font-size: 24px; margin-bottom: 8px; }
.tool-card h3 { font-size: 14px; font-weight: 600; }
.tool-card p { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ===== TOOL PAGE ===== */
.tool-header { padding: 28px 0 0; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.tool-header h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.3px; }
.tool-header p { color: var(--muted); margin-top: 4px; }

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* Form elements */
.field { margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
input[type=text],
input[type=number],
input[type=email],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 15px;
  outline: none;
  transition: border-color .2s;
  background: var(--white);
  color: var(--text);
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }

.row { display: flex; gap: 12px; }
.row .field { flex: 1; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, transform .1s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--border); }

/* Result block */
.result {
  display: none;
  margin-top: 18px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 16px 18px;
}
.result.show { display: block; }
.result-label { font-size: 12px; color: #3b82f6; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.result-value { font-size: 28px; font-weight: 700; color: var(--primary); margin-top: 2px; }
.result-breakdown { margin-top: 10px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.result-breakdown strong { color: var(--text); }

/* Scientific calc */
.calc-display {
  background: #1e293b;
  border-radius: 8px;
  padding: 16px;
  text-align: right;
  font-family: monospace;
  margin-bottom: 12px;
}
.calc-display .expr { color: #94a3b8; font-size: 13px; min-height: 18px; }
.calc-display .val { color: #f1f5f9; font-size: 28px; font-weight: 700; word-break: break-all; }
.calc-keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.calc-keys button {
  padding: 13px 0;
  border: none;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg);
  color: var(--text);
  transition: background .1s;
}
.calc-keys button:hover { background: #e5e7eb; }
.calc-keys .k-op { background: #dbeafe; color: var(--primary); }
.calc-keys .k-eq { background: var(--primary); color: #fff; }
.calc-keys .k-eq:hover { background: var(--primary-dark); }
.calc-keys .k-fn { background: #f3f4f6; color: #374151; font-size: 13px; }
.calc-keys .k-clear { background: #fee2e2; color: #dc2626; }

/* Word tools */
.word-output { margin-top: 16px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag {
  background: #eff6ff;
  color: var(--primary);
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 500;
}
.stats-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.stat-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  text-align: center;
  flex: 1;
  min-width: 90px;
}
.stat-box .n { font-size: 24px; font-weight: 700; color: var(--primary); }
.stat-box .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

/* Password */
.pass-output {
  background: #1e293b;
  color: #f1f5f9;
  border-radius: 8px;
  padding: 14px 16px;
  font-family: monospace;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  word-break: break-all;
  display: none;
}
.pass-output.show { display: flex; }
.copy-btn {
  background: none;
  border: 1px solid #475569;
  color: #94a3b8;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 12px;
}
.copy-btn:hover { background: #334155; }

/* Converter tabs */
.tabs { display: flex; border-bottom: 1.5px solid var(--border); margin-bottom: 20px; gap: 4px; }
.tab {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Currency flag */
.currency-pair { display: flex; align-items: center; gap: 12px; }
.currency-pair select { width: 120px; }
.swap-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: background .15s;
}
.swap-btn:hover { background: var(--bg); }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  background: var(--white);
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 48px;
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .tool-layout { flex-direction: column; }
  .tool-sidebar { width: 100%; }
  .ad-rectangle { width: 100%; max-width: 300px; margin: 0 auto; }
  .ad-leaderboard { display: none; }
  .ad-mobile { display: flex; }
  nav { display: none; }
  .hero h1 { font-size: 24px; }
  .calc-keys { grid-template-columns: repeat(4, 1fr); }
  .calc-keys .k-fn:nth-child(n+6):nth-child(-n+10) { display: none; }
}
@media (min-width: 769px) {
  .ad-mobile { display: none; }
}
