/* ============================================
   Clearme.in — Core Styles
   ============================================ */

:root {
  --primary: #0891b2;
  --primary-dark: #0e7490;
  --primary-light: #22d3ee;
  --primary-bg: #ecfeff;
  --accent: #0284c7;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --max-width: 1200px;
  --header-height: 60px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ============================================
   Header & Navigation
   ============================================ */

.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.logo svg { width: 32px; height: 32px; }
.logo span { color: var(--primary); }

/* Desktop Nav */
.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

.nav-desktop a {
  padding: 0.5rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--primary);
  background: var(--primary-bg);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  color: var(--text-muted);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--border-light);
  color: var(--text);
}

.btn-icon svg { width: 20px; height: 20px; }

.menu-toggle { display: flex; }

/* Mobile Nav */
.nav-mobile {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100vh;
  background: var(--bg-card);
  z-index: 200;
  transition: right 0.3s ease;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  padding: 1rem;
}

.nav-mobile.open { right: 0; }

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 199;
  display: none;
}

.nav-overlay.open { display: block; }

.nav-mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.nav-mobile a {
  display: block;
  padding: 0.75rem 0.5rem;
  color: var(--text);
  font-weight: 500;
  border-radius: var(--radius);
}

.nav-mobile a:hover { background: var(--border-light); }

.nav-mobile .nav-category-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  padding: 1rem 0.5rem 0.25rem;
}

/* Search Overlay */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

.search-overlay.open { display: flex; }

.search-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
}

.search-input-wrap svg { width: 20px; height: 20px; color: var(--text-muted); flex-shrink: 0; }

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  background: none;
  color: var(--text);
}

.search-results {
  max-height: 320px;
  overflow-y: auto;
  padding: 0.5rem;
}

.search-results a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  color: var(--text);
  border-radius: var(--radius);
  font-size: 0.9375rem;
}

.search-results a:hover { background: var(--border-light); }
.search-results .search-empty { padding: 1.5rem; text-align: center; color: var(--text-muted); font-size: 0.875rem; }

/* Search suggestions */
.search-suggestions { padding: 0.25rem 0; border-bottom: 1px solid var(--border); }
.search-suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-size: 0.875rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s;
}
.search-suggestion-item:hover { background: var(--border-light); color: var(--text); }

/* ============================================
   Hero Section
   ============================================ */

.hero {
  padding: 2rem 0 1.5rem;
}

.hero-content {
  text-align: center;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.hero .subtitle {
  font-size: 1.0625rem;
  color: var(--text-muted);
}

/* ============================================
   Section Styles
   ============================================ */

.section {
  padding: 3rem 0;
}

.section-alt { background: var(--bg-card); }

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.section-subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ============================================
   Tool Grid / Cards
   ============================================ */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text);
}

.tool-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: var(--text);
}

.tool-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.tool-card-icon svg { width: 20px; height: 20px; }

.tool-card h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}

.tool-card p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Category Cards */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.category-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text);
}

.category-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  color: var(--text);
}

.category-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  color: var(--primary);
}

.category-card-icon svg { width: 24px; height: 24px; }
.category-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
.category-card p { font-size: 0.8125rem; color: var(--text-muted); }

/* ============================================
   Why Clearme / Features
   ============================================ */

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.feature-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}

.feature-icon svg { width: 20px; height: 20px; }
.feature-item h3 { font-size: 0.9375rem; font-weight: 600; margin-bottom: 0.125rem; }
.feature-item p { font-size: 0.8125rem; color: var(--text-muted); }

/* ============================================
   FAQ Section
   ============================================ */

.faq-list { list-style: none; }

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  background: none;
  border: none;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  gap: 1rem;
}

.faq-question svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.2s;
  color: var(--text-muted);
}

.faq-item.open .faq-question svg { transform: rotate(180deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer-inner {
  padding-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
  background: var(--text);
  color: #cbd5e1;
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand p { font-size: 0.875rem; margin-top: 0.5rem; line-height: 1.6; color: #94a3b8; }

.footer-col h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.footer-col a {
  display: block;
  padding: 0.25rem 0;
  color: #94a3b8;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--primary-light); }

.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #64748b;
}

/* ============================================
   Breadcrumb
   ============================================ */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  padding: 1rem 0 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .separator { color: var(--text-light); }

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  transition: all 0.2s;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-bg);
}

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ============================================
   Category Listing Page
   ============================================ */

.category-page { padding: 1.5rem 0 3rem; }
.category-page h1 { font-size: 1.75rem; font-weight: 800; margin-bottom: 0.5rem; }
.category-page > p { color: var(--text-muted); margin-bottom: 1.5rem; }

.category-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* ============================================
   Responsive
   ============================================ */

@media (min-width: 640px) {
  .hero h1 { font-size: 2.25rem; }
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .category-tool-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .tool-grid { grid-template-columns: repeat(4, 1fr); }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .features-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
}

@media (min-width: 1024px) {
  .container { padding: 0 2rem; }
  .hero h1 { font-size: 2.5rem; }
  .nav-desktop { display: flex; }
  .menu-toggle { display: none; }
  .category-tool-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================
   Utility
   ============================================ */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
