/* ===== BASE RESET ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary-green: #00c853;
  --primary-dark: #1b5e20;
  --gradient-main: linear-gradient(135deg, #00c853 0%, #1b5e20 100%);
  --gradient-nav: linear-gradient(90deg, #0a0a0a 0%, #1b5e20 50%, #0a0a0a 100%);
  --gradient-hero: linear-gradient(135deg, #0a0a0a 0%, #1a2e1a 50%, #0d1f0d 100%);
  --text-on-dark: #ffffff;
  --text-on-light: #1a1a1a;
  --bg-main: #ffffff;
  --bg-grey: #f4f9f4;
  --card-border: #e0efe0;
  --card-hover-border: #00c853;
  --footer-bg: #0a0a0a;
  --footer-text: #cccccc;
  --accent-glow: rgba(0, 200, 83, 0.15);
  --green-light-bg: #e8f5e9;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-on-light);
  background: var(--bg-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; outline: none; }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 999;
  height: 64px;
  background: var(--gradient-nav);
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-logo span { color: var(--primary-green); }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transition: color .2s;
}
.nav-links a:hover { color: var(--primary-green); }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}
.hamburger span {
  width: 24px;
  height: 2.5px;
  background: #fff;
  border-radius: 2px;
  transition: .3s;
}
.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: #0a0a0a;
  padding: 16px 24px;
  z-index: 998;
  border-bottom: 2px solid var(--primary-dark);
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  color: #fff;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 15px;
}
.mobile-menu a:hover { color: var(--primary-green); }

/* ===== HERO SECTION ===== */
.hero {
  background: var(--gradient-hero);
  padding: 80px 24px 64px;
  text-align: center;
}
.hero h1 {
  color: #fff;
  font-size: 44px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}
.hero h1 span { color: var(--primary-green); }
.hero p {
  color: #aaaaaa;
  font-size: 18px;
  max-width: 560px;
  margin: 0 auto 32px;
}
.hero-search {
  background: #fff;
  border-radius: 50px;
  display: flex;
  align-items: center;
  max-width: 520px;
  margin: 0 auto;
  padding: 6px;
  box-shadow: 0 8px 30px rgba(0,200,83,0.18);
}
.hero-search input {
  flex: 1;
  border: none;
  padding: 12px 20px;
  font-size: 15px;
  background: transparent;
  color: #1a1a1a;
}
.hero-search input:focus { outline: none; }
.hero-search button {
  background: var(--gradient-main);
  color: #fff;
  padding: 12px 26px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 14px;
  transition: transform .2s;
}
.hero-search button:hover { transform: scale(1.04); }
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.hero-stats div { text-align: center; }
.hero-stats strong {
  display: block;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
}
.hero-stats span {
  color: #888;
  font-size: 13px;
}

/* ===== FILTER SECTION ===== */
.filter-section {
  background: #fff;
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 64px;
  z-index: 90;
}
.filter-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-inner::-webkit-scrollbar { display: none; }
.filter-btn {
  padding: 8px 18px;
  border: 1.5px solid var(--card-border);
  border-radius: 50px;
  background: #fff;
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: all .25s;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--gradient-main);
  color: #fff;
  border-color: transparent;
}

/* ===== AD BANNER ===== */
.ad-banner {
  background: var(--bg-grey);
  border: 1.5px dashed var(--card-border);
  min-height: 100px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 12px;
  margin: 24px auto;
  max-width: 1200px;
  padding: 16px;
}

/* ===== TOOL CARDS ===== */
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #777;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--card-border);
  margin: 40px auto 20px;
  max-width: 1200px;
  padding-left: 24px;
  padding-right: 24px;
}
.tools-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.tool-card {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--card-border);
  border-radius: 12px;
  padding: 24px;
  transition: all .25s;
  overflow: hidden;
  display: block;
}
.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-main);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s;
}
.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--card-hover-border);
  box-shadow: 0 8px 28px rgba(0,200,83,0.18);
}
.tool-card:hover::before { transform: scaleX(1); }
.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
}
.cat-math .tool-icon { background: #fff3e0; }
.cat-doc .tool-icon { background: #e8f5e9; }
.cat-image .tool-icon { background: #e3f2fd; }
.cat-pdf .tool-icon { background: #fce4ec; }
.cat-text .tool-icon { background: #f3e5f5; }
.cat-student .tool-icon { background: #e0f7fa; }
.tool-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
}
.tool-card p {
  font-size: 12px;
  color: #777;
  line-height: 1.5;
}
.tool-arrow {
  position: absolute;
  bottom: 18px;
  right: 18px;
  color: var(--primary-green);
  font-size: 16px;
  opacity: 0;
  transition: opacity .25s;
}
.tool-card:hover .tool-arrow { opacity: 1; }
.tool-card.hidden { display: none; }
#noResults {
  text-align: center;
  padding: 60px 24px;
  color: #888;
  font-size: 16px;
  display: none;
}

/* ===== WHY SECTION ===== */
.why-section {
  background: var(--bg-grey);
  padding: 64px 24px;
  margin-top: 56px;
}
.why-inner { max-width: 1200px; margin: 0 auto; }
.why-section h2 {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 36px;
  color: #1a1a1a;
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.why-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  transition: all .25s;
}
.why-card:hover {
  border-color: var(--primary-green);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,200,83,0.12);
}
.why-card .icon {
  font-size: 32px;
  margin-bottom: 14px;
}
.why-card h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}
.why-card p {
  font-size: 13px;
  color: #777;
  line-height: 1.5;
}

/* ===== TOOL INNER PAGES ===== */
.breadcrumb {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  font-size: 13px;
  color: #888;
}
.breadcrumb a { color: var(--primary-dark); }
.breadcrumb a:hover { color: var(--primary-green); }
.tool-page-hero {
  background: var(--gradient-hero);
  text-align: center;
  padding: 48px 24px;
  color: #fff;
}
.tool-page-hero .icon-big { font-size: 44px; margin-bottom: 12px; }
.tool-page-hero h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 10px;
}
.tool-page-hero p {
  color: #bbb;
  max-width: 560px;
  margin: 0 auto;
  font-size: 15px;
}
.tool-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px;
}
.tool-box {
  background: #fff;
  border: 1.5px solid var(--card-border);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.input-group { margin-bottom: 18px; }
.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}
.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  border: 1.5px solid var(--card-border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  color: #1a1a1a;
  background: #fff;
  transition: all .2s;
}
.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(0,200,83,0.1);
}
.btn-primary {
  background: var(--gradient-main);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  padding: 12px 28px;
  transition: all .25s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,200,83,0.3); }
.btn-secondary {
  background: #fff;
  border: 1.5px solid var(--card-border);
  color: #333;
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  padding: 12px 24px;
  transition: all .25s;
}
.btn-secondary:hover { border-color: var(--primary-green); color: var(--primary-green); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.result-box {
  margin-top: 24px;
  padding: 24px;
  background: var(--green-light-bg);
  border-radius: 10px;
  border-left: 4px solid var(--primary-green);
}
.result-box .result-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-top: 6px;
}
.tool-section-title {
  font-size: 22px;
  font-weight: 700;
  margin: 36px 0 14px;
  color: #1a1a1a;
}
.tool-section-title span { color: var(--primary-green); }
.content-block { font-size: 14px; line-height: 1.7; color: #444; margin-bottom: 14px; }
.content-block ul { padding-left: 20px; margin: 8px 0; }
.content-block li { margin-bottom: 4px; }
.faq-item {
  border: 1px solid var(--card-border);
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-q {
  padding: 14px 18px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  background: #fafdfa;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-q::after { content: '+'; color: var(--primary-green); font-size: 18px; }
.faq-q.open::after { content: '−'; }
.faq-a {
  padding: 0 18px;
  font-size: 13px;
  color: #555;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s, padding .3s;
}
.faq-a.open { padding: 14px 18px; max-height: 300px; }
.related-tools {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--card-border);
}
.related-tools h4 { font-size: 16px; margin-bottom: 14px; }
.related-tools a {
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg-grey);
  border: 1px solid var(--card-border);
  border-radius: 50px;
  font-size: 12px;
  margin: 0 6px 6px 0;
  color: #333;
  transition: .2s;
}
.related-tools a:hover { background: var(--primary-green); color: #fff; border-color: transparent; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 22px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transform: translateY(20px);
  transition: all .3s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: #0a0a0a; color: var(--primary-green); border: 1px solid var(--primary-green); }
.toast.error { background: #2a0a0a; color: #ff5555; border: 1px solid #ff5555; }

/* ===== FOOTER ===== */
.footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 56px 24px 24px;
}
.footer-top {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-col h4 {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
}
.footer-col p {
  font-size: 13px;
  color: #999;
  line-height: 1.6;
  max-width: 260px;
  margin-top: 12px;
}
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a {
  color: #aaa;
  font-size: 13px;
  transition: color .2s;
}
.footer-col ul li a:hover { color: var(--primary-green); }
.footer-logo {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}
.footer-logo span { color: var(--primary-green); }
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #555;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-bottom a { color: #777; transition: color .2s; }
.footer-bottom a:hover { color: var(--primary-green); }

/* ===== CALCULATOR GRID ===== */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 320px;
  margin: 16px auto;
}
.calc-grid button {
  background: #f7faf7;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  transition: .15s;
}
.calc-grid button:hover { background: var(--primary-green); color: #fff; }
.calc-grid button.op { background: var(--green-light-bg); color: var(--primary-dark); }
.calc-grid button.eq { background: var(--gradient-main); color: #fff; grid-column: span 2; }
.calc-display {
  background: #0a0a0a;
  color: #fff;
  padding: 18px;
  border-radius: 8px;
  text-align: right;
  font-size: 22px;
  font-weight: 600;
  min-height: 64px;
  max-width: 320px;
  margin: 0 auto 12px;
  word-break: break-all;
}

/* ===== TABS ===== */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab-btn {
  padding: 8px 16px;
  border: 1.5px solid var(--card-border);
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  background: #fff;
  transition: .2s;
}
.tab-btn.active, .tab-btn:hover {
  background: var(--gradient-main);
  color: #fff;
  border-color: transparent;
}

/* ===== MISC ===== */
.formula-card {
  background: #fafdfa;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.formula-card .fname { font-size: 13px; font-weight: 600; color: #333; }
.formula-card .ftext { font-family: 'Courier New', monospace; font-size: 14px; color: var(--primary-dark); }
.formula-card button { font-size: 12px; color: var(--primary-green); padding: 4px 10px; border: 1px solid var(--primary-green); border-radius: 4px; }

.accordion-item { border: 1px solid var(--card-border); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.accordion-head { padding: 14px 18px; background: #fafdfa; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.accordion-head::after { content: '▼'; font-size: 10px; color: var(--primary-green); transition: .3s; }
.accordion-head.open::after { transform: rotate(180deg); }
.accordion-body { max-height: 0; overflow: hidden; transition: max-height .35s; padding: 0 18px; }
.accordion-body.open { max-height: 1000px; padding: 16px 18px; }

.task-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--card-border); border-radius: 8px;
  margin-bottom: 8px; background: #fff;
}
.task-item.high { border-left: 4px solid #e53935; }
.task-item.medium { border-left: 4px solid #fb8c00; }
.task-item.low { border-left: 4px solid var(--primary-green); }
.task-item.done { opacity: .55; text-decoration: line-through; }
.task-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary-green); }

table.styled-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
table.styled-table th, table.styled-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--card-border); font-size: 13px; }
table.styled-table th { background: var(--green-light-bg); color: var(--primary-dark); font-weight: 700; }
table.styled-table tr:nth-child(even) { background: #fafdfa; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 16px; }
.stat-card { background: #fafdfa; border: 1px solid var(--card-border); border-radius: 8px; padding: 16px; text-align: center; }
.stat-card strong { display: block; font-size: 24px; font-weight: 800; color: var(--primary-dark); }
.stat-card span { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: .5px; }

.preview-pane { border: 1.5px solid var(--card-border); border-radius: 8px; padding: 24px; background: #fff; min-height: 300px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 900px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .hero { padding: 56px 20px 44px; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 15px; }
  .hero-stats { gap: 28px; }
  .hero-stats strong { font-size: 22px; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: 1fr 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 28px; }
  .tool-page-hero h1 { font-size: 24px; }
  .tool-box { padding: 20px; }
  .calc-grid { max-width: 100%; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
@media (max-width: 380px) {
  .tools-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }
}