/* ============================================================
   Clear Text Tools  —  Crisp White + Emerald #10B981
   ============================================================ */

:root {
  --green:        #10B981;
  --green-light:  #D1FAE5;
  --green-mid:    #A7F3D0;
  --green-dark:   #059669;
  --white:        #FFFFFF;
  --bg:           #F9FAFB;
  --surface:      #FFFFFF;
  --border:       #E5E7EB;
  --border-light: #F3F4F6;
  --text:         #111827;
  --text-2:       #374151;
  --text-3:       #6B7280;
  --text-4:       #9CA3AF;
  --text-5:       #D1D5DB;
  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    14px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:       0 4px 16px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html, body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── MudBlazor reset to match our theme ── */
.mud-theme-provider { background: transparent !important; }
.mud-layout { background: var(--bg) !important; }
.mud-main-content { background: var(--bg) !important; }

/* Snackbar */
.mud-snackbar {
  font-family: var(--font) !important;
  font-size: 13px !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 500 !important;
}
.mud-snackbar-success {
  background: var(--green) !important;
  color: #fff !important;
}

/* ── App Shell ── */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ── */
.app-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.app-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.app-logo img { height: 34px; width: auto; }

.header-tagline {
  font-size: 12px;
  color: var(--text-4);
  margin-left: 20px;
  padding-left: 20px;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}

@media (max-width: 600px) { .header-tagline { display: none; } }

/* ── Page body ── */
.page-body {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 32px 20px 60px;
}

.page-center {
  width: 100%;
  max-width: 960px;
}

/* ── Home: Hero ── */
.home-hero {
  text-align: center;
  padding: 40px 0 36px;
}

.home-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.8px;
  margin-bottom: 10px;
  line-height: 1.15;
}

.home-title span { color: var(--green); }

.home-sub {
  font-size: 15px;
  color: var(--text-3);
  font-weight: 400;
}

/* ── Home Ad strip (leaderboard) ── */
.ad-leaderboard {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 68px;
  margin-bottom: 28px;
  position: relative;
}

.ad-label {
  position: absolute;
  top: 6px;
  left: 10px;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-5);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.ad-placeholder-text {
  font-size: 12px;
  color: var(--text-5);
  text-align: center;
}

/* ── Tool card grid ── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 720px) { .tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .tool-grid { grid-template-columns: 1fr 1fr; gap: 8px; } }

.tool-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 16px 16px;
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  box-shadow: var(--shadow-sm);
  outline: none;
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--green);
  opacity: 0;
  transition: opacity 0.15s;
}

.tool-card:hover {
  border-color: var(--green);
  box-shadow: 0 6px 20px rgba(16,185,129,0.12), var(--shadow-sm);
  transform: translateY(-2px);
}
.tool-card:hover::before { opacity: 1; }

.tool-card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
  color: var(--green-dark);
}

.tool-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.1px;
}

.tool-card-desc {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.4;
}

/* ── Tool page layout ── */
.tool-page {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.tool-main { flex: 1; min-width: 0; }

/* ── Tool header ── */
.tool-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.tool-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-3);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--white);
  transition: all 0.1s;
  font-weight: 500;
  flex-shrink: 0;
}
.tool-back:hover { color: var(--text); border-color: var(--text-4); }

.tool-header-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  color: var(--green-dark);
}

.tool-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.4px;
  line-height: 1;
}

.tool-desc {
  font-size: 12px;
  color: var(--text-4);
  margin-top: 3px;
}

/* ── Mode selector ── */
.mode-strip {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  width: fit-content;
  max-width: 100%;
}

.mode-btn {
  padding: 5px 13px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-3);
  background: transparent;
  transition: all 0.1s;
  white-space: nowrap;
}
.mode-btn:hover { color: var(--text); background: var(--white); }
.mode-btn.active {
  background: var(--white);
  color: var(--green-dark);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ── I/O Panel ── */
.io-panel {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.io-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-4);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.io-textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  padding: 14px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  min-height: 180px;
  display: block;
}
.io-textarea::placeholder { color: var(--text-5); }

.io-divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 0;
}

.io-actions {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-top: 1px solid var(--border-light);
}

.io-meta {
  font-size: 11.5px;
  color: var(--text-4);
  margin-left: auto;
}

.io-output {
  padding: 14px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
  min-height: 100px;
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
  background: var(--white);
}

.io-output-empty { color: var(--text-5); font-style: italic; }

/* ── Options row ── */
.options-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  font-weight: 500;
}
.check-label input[type=checkbox] { accent-color: var(--green); width: 14px; height: 14px; cursor: pointer; }
.check-label input[type=radio]    { accent-color: var(--green); width: 14px; height: 14px; cursor: pointer; }

.select-inline {
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
}
.select-inline:focus { border-color: var(--green); }

.options-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-4);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.1s;
  outline: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 1px 3px rgba(16,185,129,0.35);
}
.btn-primary:hover { background: var(--green-dark); box-shadow: 0 2px 8px rgba(16,185,129,0.4); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: var(--white);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--text-4); background: var(--bg); }

.btn-ghost {
  background: transparent;
  color: var(--text-3);
  padding: 7px 10px;
}
.btn-ghost:hover { color: var(--text); background: var(--border-light); border-radius: var(--radius-sm); }

.btn-copy {
  background: var(--green-light);
  color: var(--green-dark);
  border: 1px solid var(--green-mid);
  font-size: 12px;
  padding: 5px 12px;
}
.btn-copy:hover { background: var(--green-mid); }

/* ── Stats grid ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.stat-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s;
}
.stat-card:hover { border-color: var(--green-mid); }

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -0.5px;
  line-height: 1;
  display: block;
}

.stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 5px;
  display: block;
}

/* ── Summary diff (remove dupes) ── */
.diff-row {
  display: flex;
  gap: 20px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
}
.diff-item { text-align: center; }
.diff-num { font-size: 20px; font-weight: 800; display: block; }
.diff-sub { font-size: 10px; font-weight: 600; color: var(--text-4); text-transform: uppercase; letter-spacing: 0.8px; }

/* ── Platform limits ── */
.limits-list { padding: 0 14px; }
.limit-row { padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.limit-row:last-child { border-bottom: none; }
.limit-name { font-size: 12px; font-weight: 500; color: var(--text-2); }
.limit-count { font-size: 12px; font-weight: 700; }
.limit-bar-bg { height: 3px; background: var(--border); border-radius: 2px; margin-top: 4px; }
.limit-bar-fill { height: 3px; border-radius: 2px; transition: width 0.25s; }

/* ── Ad Sidebar (desktop only) ── */
.tool-sidebar {
  width: 260px;
  flex-shrink: 0;
}

@media (max-width: 840px) { .tool-sidebar { display: none; } }

.ad-sidebar-unit {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
}

.ad-sidebar-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-5);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
}

.ad-sidebar-body {
  padding: 14px 12px;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ad-sidebar-note {
  font-size: 10px;
  color: var(--text-5);
  text-align: center;
  padding: 8px 12px;
  border-top: 1px solid var(--border-light);
  background: var(--bg);
}

/* ── Ad Bottom Strip (mobile only) ── */
.ad-mobile-strip {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 8px 16px;
  z-index: 200;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.07);
}

@media (max-width: 840px) {
  .ad-mobile-strip { display: flex; }
  .page-body { padding-bottom: 80px; }
}

.ad-mobile-label {
  position: absolute;
  top: 3px; right: 8px;
  font-size: 8px;
  color: var(--text-5);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ── Tip card in sidebar ── */
.tip-card {
  background: var(--green-light);
  border: 1px solid var(--green-mid);
  border-radius: var(--radius);
  padding: 14px 12px;
  margin-bottom: 14px;
}
.tip-header {
  font-size: 10px;
  font-weight: 800;
  color: var(--green-dark);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.tip-body {
  font-size: 12px;
  color: var(--green-dark);
  line-height: 1.5;
  font-weight: 500;
}

/* ── Misc ── */
.not-found { padding: 60px 20px; text-align: center; color: var(--text-3); font-size: 15px; }
.not-found a { color: var(--green); text-decoration: none; display: inline-block; margin-top: 12px; font-weight: 600; }

#blazor-error-ui {
  background: #FEF2F2; color: #991B1B;
  bottom: 0; left: 0; right: 0;
  display: none; padding: 10px 20px;
  position: fixed; z-index: 9999;
  font-size: 13px; border-top: 1px solid #FECACA;
}
#blazor-error-ui .dismiss { cursor: pointer; float: right; }
#blazor-error-ui .reload { color: var(--green); font-weight: 600; text-decoration: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-5); }

/* ============================================================
   Footer
   ============================================================ */
.app-footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 20px 32px;
  display: flex;
  gap: 48px;
  align-items: flex-start;
}

@media (max-width: 640px) {
  .footer-inner { flex-direction: column; gap: 28px; }
}

.footer-brand { flex-shrink: 0; max-width: 220px; }

.footer-logo img { height: 32px; width: auto; display: block; margin-bottom: 12px; }

.footer-tagline {
  font-size: 12.5px;
  color: var(--text-4);
  line-height: 1.6;
}

.footer-links-group {
  display: flex;
  gap: 40px;
  flex: 1;
}

@media (max-width: 480px) {
  .footer-links-group { flex-direction: column; gap: 24px; }
}

.footer-link-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-4);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.footer-link-col a {
  font-size: 13px;
  color: var(--text-3);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.1s;
}
.footer-link-col a:hover { color: var(--green); }

.footer-bottom {
  border-top: 1px solid var(--border-light);
  padding: 14px 20px;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--text-4);
}

@media (max-width: 480px) {
  .footer-bottom { flex-direction: column; gap: 6px; text-align: center; }
}

.footer-bottom-links { display: flex; gap: 16px; }
.footer-bottom-links a { color: var(--text-4); text-decoration: none; font-weight: 500; }
.footer-bottom-links a:hover { color: var(--green); }

/* ============================================================
   Cookie Banner
   ============================================================ */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 500;
  background: var(--white);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.08);
  padding: 14px 20px;
}

.cookie-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cookie-text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  flex: 1;
  min-width: 0;
}

.cookie-icon { font-size: 18px; flex-shrink: 0; }

.cookie-text a { color: var(--green); font-weight: 600; text-decoration: none; }
.cookie-text a:hover { text-decoration: underline; }

.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }

.cookie-btn-sm { padding: 6px 14px !important; font-size: 12px !important; }

/* ============================================================
   Legal pages (Privacy Policy, Terms, About)
   ============================================================ */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
}

.legal-header {
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 32px;
}

.legal-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  margin: 12px 0 8px;
  line-height: 1.2;
}

.legal-meta {
  font-size: 12px;
  color: var(--text-4);
  margin: 0;
}

.legal-body {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text-2);
}

.legal-intro {
  font-size: 15px;
  color: var(--text);
  background: var(--green-light);
  border-left: 3px solid var(--green);
  padding: 14px 16px;
  margin-bottom: 28px;
  line-height: 1.6;
}

.legal-body h2 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin: 32px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
  letter-spacing: -0.2px;
}

.legal-body h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 8px;
}

.legal-body p { margin-bottom: 14px; }

.legal-body ul {
  margin: 8px 0 16px 20px;
  padding: 0;
}

.legal-body ul li {
  margin-bottom: 7px;
  padding-left: 4px;
}

.legal-body a {
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
}
.legal-body a:hover { text-decoration: underline; }

.legal-body strong { color: var(--text); font-weight: 700; }

.legal-contact {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.8;
}

.legal-contact p { margin: 0; }

/* ============================================================
   Tool Disclaimer
   ============================================================ */
.tool-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #92400E;
  line-height: 1.5;
}

.tool-disclaimer-icon {
  flex-shrink: 0;
  font-size: 13px;
  margin-top: 1px;
  color: #D97706;
}

.tool-disclaimer a {
  color: #92400E;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tool-disclaimer a:hover { color: #78350F; }

/* ── Toast notification (replaces MudBlazor Snackbar) ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--green);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  box-shadow: 0 4px 16px rgba(16,185,129,0.35);
  z-index: 9999;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s, transform 0.18s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Active nav link ── */
.tool-card:focus { outline: none; }

/* ── Remove blazor error UI if any ── */
#blazor-error-ui { display: none !important; }
