/* =============================================
   CLCU Online – Main Stylesheet
   ============================================= */

:root {
  --primary:       #2563eb;
  --primary-dk:    #1d4ed8;
  --primary-lt:    #eff6ff;
  --secondary:     #10b981;
  --secondary-dk:  #059669;
  --dark:          #1e293b;
  --gray:          #64748b;
  --light:         #f8fafc;
  --border:        #e2e8f0;
  --white:         #ffffff;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:     0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 25px -5px rgba(0,0,0,.15);
  --radius:        8px;
  --radius-lg:     14px;
  --font:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition:    .2s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font); color: var(--dark); background: var(--white); line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dk); text-decoration: underline; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font); }

/* ---- Layout ---- */
.container { max-width: 1240px; margin: 0 auto; padding: 0 1.5rem; }

/* ---- Navbar ---- */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 2rem;
}
.logo {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -.3px;
  flex-shrink: 0;
}
.logo span { color: var(--primary); }
.logo:hover { text-decoration: none; }
.nav-links {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
}
.nav-links a {
  color: var(--gray);
  font-size: .9rem;
  font-weight: 500;
  padding: .25rem 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover {
  color: var(--primary);
  text-decoration: none;
  border-color: var(--primary);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--dark);
  margin-left: auto;
}

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 45%, #2563eb 100%);
  color: var(--white);
  padding: 5.5rem 0 4rem;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.75rem, 4.5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -.5px;
}
.hero-sub {
  font-size: clamp(1rem, 2vw, 1.25rem);
  opacity: .9;
  margin-bottom: 2.25rem;
}
.hero-search-wrap {
  display: flex;
  max-width: 660px;
  margin: 0 auto 1rem;
  background: var(--white);
  border-radius: 50px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero-search-wrap input {
  flex: 1;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  color: var(--dark);
  outline: none;
  min-width: 0;
}
.btn-search {
  background: var(--secondary);
  color: var(--white);
  border: none;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 0 50px 50px 0;
  transition: background var(--transition);
  flex-shrink: 0;
}
.btn-search:hover { background: var(--secondary-dk); }
.hero-hint { font-size: .82rem; opacity: .7; }

/* ---- Sections ---- */
.section { padding: 4.5rem 0; }
.bg-light { background: var(--light); }
.section h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: .5rem;
  letter-spacing: -.2px;
}
.section-sub { text-align: center; color: var(--gray); margin-bottom: 2.5rem; font-size: .95rem; }

/* ---- Featured Grid ---- */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.feat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: block;
}
.feat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  text-decoration: none;
}
.feat-icon { font-size: 2.2rem; margin-bottom: .75rem; display: block; }
.feat-name { font-size: .9rem; font-weight: 700; color: var(--dark); margin-bottom: .4rem; line-height: 1.3; }
.feat-vol { font-size: .75rem; color: var(--gray); }

/* ---- Category Grid ---- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1rem;
}
.cat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  text-decoration: none;
}
.cat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  text-decoration: none;
}
.cat-emoji { font-size: 2rem; flex-shrink: 0; width: 44px; text-align: center; }
.cat-info { flex: 1; }
.cat-name { font-size: .95rem; font-weight: 700; color: var(--dark); margin-bottom: .15rem; }
.cat-desc { font-size: .78rem; color: var(--gray); }
.cat-badge {
  background: var(--primary-lt);
  color: var(--primary);
  font-size: .75rem;
  font-weight: 700;
  padding: .25rem .6rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- Table Controls ---- */
.table-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.search-wrap {
  flex: 1;
  min-width: 220px;
  position: relative;
}
.search-icon {
  position: absolute;
  left: .85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray);
  font-size: .9rem;
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  padding: .75rem 1rem .75rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
#cat-filter {
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  outline: none;
  background: var(--white);
  color: var(--dark);
  cursor: pointer;
  transition: border-color var(--transition);
}
#cat-filter:focus { border-color: var(--primary); }

/* ---- Results bar ---- */
.results-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: .75rem;
}
#results-count { font-size: .85rem; color: var(--gray); }
.btn-clear {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .2rem .75rem;
  font-size: .8rem;
  color: var(--gray);
  transition: all var(--transition);
}
.btn-clear:hover { border-color: #ef4444; color: #ef4444; background: #fef2f2; }

/* ---- Tools Table ---- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.tools-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.tools-table thead { background: var(--dark); color: var(--white); }
.tools-table th {
  padding: .85rem 1rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
}
.tools-table th:hover { background: #334155; }
.tools-table th:first-child { cursor: default; }
.sort-arrow { opacity: .5; font-size: .75rem; }
.col-num   { width: 3.5rem; }
.col-name  { min-width: 220px; }
.col-cat   { min-width: 180px; }
.col-vol   { width: 160px; text-align: right; }
.col-intent{ width: 160px; }

.tools-table tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
.tools-table tbody tr:last-child { border-bottom: none; }
.tools-table tbody tr:hover { background: var(--primary-lt); }

.tools-table td { padding: .65rem 1rem; vertical-align: middle; }
.tools-table td:first-child { color: #94a3b8; font-size: .8rem; }
.tools-table td:nth-child(4) { text-align: right; font-family: monospace; font-size: .82rem; color: var(--gray); }

.tool-link { font-weight: 600; color: var(--primary); }
.tool-link:hover { color: var(--primary-dk); }

.cat-pill {
  display: inline-block;
  background: var(--light);
  color: var(--gray);
  padding: .15rem .55rem;
  border-radius: 4px;
  font-size: .75rem;
  border: 1px solid var(--border);
}

.intent-pill {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 500;
}
.intent-info          { background: #dbeafe; color: #1e40af; }
.intent-commercial    { background: #d1fae5; color: #065f46; }
.intent-transactional { background: #fef3c7; color: #92400e; }
.intent-navigational  { background: #ede9fe; color: #5b21b6; }
.intent-mixed         { background: #fce7f3; color: #9d174d; }

/* ---- No Results ---- */
.no-results { text-align: center; padding: 4rem 1rem; }
.no-results-icon { font-size: 3rem; margin-bottom: 1rem; }
.no-results p { color: var(--gray); margin-bottom: 1.25rem; font-size: 1rem; }
.btn-primary {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: .6rem 1.5rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  transition: background var(--transition);
}
.btn-primary:hover { background: var(--primary-dk); }

/* ---- Trust ---- */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.5rem;
}
.trust-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.trust-card:hover { box-shadow: var(--shadow-md); }
.trust-icon { font-size: 2.75rem; margin-bottom: 1rem; display: block; }
.trust-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; }
.trust-card p { color: var(--gray); font-size: .875rem; }

/* ---- Footer ---- */
.footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 3.5rem 0 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.footer-logo { color: var(--white); display: block; margin-bottom: .75rem; }
.footer-brand p { font-size: .85rem; line-height: 1.7; }
.footer-col h4 { color: var(--white); font-size: .85rem; font-weight: 700; margin-bottom: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.footer-col li { margin-bottom: .4rem; }
.footer-col a { color: #94a3b8; font-size: .85rem; transition: color var(--transition); }
.footer-col a:hover { color: var(--white); text-decoration: none; }
.footer-bottom { border-top: 1px solid #1e293b; padding-top: 1.5rem; text-align: center; font-size: .8rem; }
.footer-bottom a { color: #94a3b8; }
.footer-bottom a:hover { color: var(--white); }

/* ---- Back to Top ---- */
.back-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.4rem;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 100;
  transition: background var(--transition), transform var(--transition);
}
.back-top.show { display: flex; }
.back-top:hover { background: var(--primary-dk); transform: translateY(-2px); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---- Static Tools Grid (crawlable by search engines) ---- */
.top-tools-static { background: #f8fafc; }
.static-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem 2.5rem;
  margin-top: 1.5rem;
}
.stg-col h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: .75rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--primary);
}
.stg-col ul { list-style: none; padding: 0; margin: 0; }
.stg-col li { margin-bottom: .4rem; }
.stg-col li a {
  font-size: .88rem;
  color: #374151;
  text-decoration: none;
  display: block;
  padding: .15rem 0;
  transition: color .15s;
}
.stg-col li a:hover { color: var(--primary); }
.stg-col li:last-child a { font-weight: 600; color: var(--primary); margin-top: .4rem; }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: .75rem;
    box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-inner { position: relative; }

  .hero { padding: 3.5rem 0 3rem; }
  .hero-search-wrap { flex-direction: column; background: transparent; box-shadow: none; gap: .5rem; max-width: 100%; }
  .hero-search-wrap input { border-radius: 50px; box-shadow: var(--shadow-md); }
  .btn-search { border-radius: 50px; }

  .table-controls { flex-direction: column; }
  .search-wrap { width: 100%; }
  #cat-filter { width: 100%; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .static-tools-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem 1.25rem; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .feat-card { padding: 1.25rem .75rem; }
  .back-top { bottom: 1rem; right: 1rem; width: 40px; height: 40px; }
  .static-tools-grid { grid-template-columns: 1fr; }
}
