/* =============================================
   TOOLKIT PRO — COMPLETE SaaS STYLESHEET
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Syne:wght@700;800&display=swap');

:root {
  /* Modern Professional Palette */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-nav: rgba(255, 255, 255, 0.85);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-footer-muted: #94a3b8;

  --accent: #6366f1; /* Indigo */
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.1);
  
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --nav-height: 72px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  --bg-footer: #020617;
}

[data-theme="dark"] {
  --bg-primary: #020617;
  --bg-secondary: #0f172a;
  --bg-card: #1e293b;
  --bg-nav: rgba(2, 6, 23, 0.85);
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  
  --border: #334155;
  --border-strong: #475569;
  
  --bg-footer: #0f172a;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
img { max-width: 100%; display: block; }

h1, h2, h3 { font-family: 'Syne', sans-serif; line-height: 1.15; letter-spacing: -0.02em; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =============================================
   NAVIGATION
   ============================================= */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.brand-logo span { color: var(--accent); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-list { display: flex; align-items: center; gap: 4px; }

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--accent);
  background: var(--accent-glow);
}

/* Dropdown */
.nav-item.dropdown { position: relative; }

.dropdown-menu {
  position: absolute;
  top: 100%; left: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px;
  min-width: 240px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 200;
}

.nav-item.dropdown:hover .dropdown-menu,
.nav-item.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.dropdown-menu li a:hover {
  background: var(--accent-glow);
  color: var(--accent);
}

/* Theme & Menu Toggles */
.theme-toggle, .menu-toggle {
  background: transparent;
  border: 1px solid var(--border);
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-primary);
  transition: var(--transition);
  margin-left: 10px;
}

.theme-toggle:hover, .menu-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.menu-toggle { display: none; }

/* =============================================
   HERO & SEARCH
   ============================================= */
main { padding-top: var(--nav-height); }

.hero {
  padding: 100px 24px 60px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  margin-bottom: 20px;
}

.hero-title span { color: var(--accent); }

.hero-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
}

.search-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: 20px; top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.search-input {
  width: 100%;
  padding: 16px 20px 16px 50px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem;
  box-shadow: var(--shadow-md);
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 50;
  display: none;
  text-align: left;
}

.search-results-dropdown li a {
  display: block;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.search-results-dropdown li a:hover {
  background: var(--accent-glow);
  color: var(--accent);
}

/* =============================================
   GRIDS & CARDS
   ============================================= */
.category-section, .tool-list-section {
  padding: 60px 0;
}

.category-label {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.category-title { font-size: 2.2rem; margin-bottom: 10px; }
.category-subtitle { color: var(--text-secondary); margin-bottom: 40px; }

.category-grid, .tool-grid {
  display: grid;
  gap: 20px;
}

.category-grid { grid-template-columns: repeat(3, 1fr); }
.tool-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.category-card, .tool-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.tool-item { padding: 24px; }

.category-card:hover, .tool-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.icon-box, .tool-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-glow);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.tool-count {
  font-size: 0.75rem;
  background: var(--accent-glow);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  align-self: flex-start;
  margin-bottom: 10px;
  font-weight: bold;
}

.category-card h3, .tool-item h4 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.category-card p, .tool-item p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 15px;
  flex-grow: 1;
}

.explore-btn {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background: var(--bg-footer);
  color: #fff;
  padding: 60px 24px 20px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand h2 { color: #fff; margin-bottom: 10px; }
.footer-brand p { color: var(--text-footer-muted); font-size: 0.9rem; max-width: 300px; }

.footer-col h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 20px;
}

.footer-col ul li { margin-bottom: 10px; }
.footer-col a { color: var(--text-footer-muted); font-size: 0.9rem; }
.footer-col a:hover { color: #fff; }

.footer-bottom {
  display: flex; justify-content: space-between;
  padding-top: 20px;
  color: var(--text-footer-muted);
  font-size: 0.85rem;
}

.footer-bottom-links { display: flex; gap: 15px; }
.footer-bottom-links a:hover { color: #fff; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .category-grid, .footer-grid { grid-template-columns: 1fr; }
  .menu-toggle { display: flex; }
  
  .main-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--bg-card);
    padding: 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }
  
  .main-nav.active { display: flex; align-items: flex-start; }
  .nav-list { flex-direction: column; width: 100%; }
  .nav-item { width: 100%; }
  .nav-link { width: 100%; display: block; padding: 12px; }
  
  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 20px;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  
  .nav-item.dropdown.open .dropdown-menu { display: block; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; align-items: center; }
}