:root {
  --primary: #8a2be2;
  --primary-hover: #7b1fa2;
  --secondary: #ff4500;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666666;
  --border: #e2e8f0;
  --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
  --header-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --ads-bg: #e2e8f0;
  --radius: 12px;
  --transition: all 0.3s ease;
}

[data-theme="dark"] {
  --primary: #9d4edd;
  --primary-hover: #7b2cbf;
  --secondary: #ff5400;
  --bg: #0f1115;
  --surface: #1a1d24;
  --text: #f8f9fa;
  --text-muted: #a0aec0;
  --border: #2d333b;
  --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --header-bg: rgba(26, 29, 36, 0.7);
  --glass-border: rgba(255, 255, 255, 0.05);
  --ads-bg: #2d333b;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

/* Header & Nav */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}

.logo img {
  height: 32px;
  width: auto;
}

.logo span {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--primary);
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.5rem;
  border-radius: 50%;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: var(--border);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Main Content */
main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.hero {
  text-align: center;
  margin-bottom: 3.5rem;
  padding: 2rem 0;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.search-bar {
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: 1rem 1.5rem 1rem 3rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  outline: none;
}

.search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(138, 43, 226, 0.2);
}

.search-icon {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

.tool-icon {
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.1), rgba(255, 69, 0, 0.1));
  color: var(--primary);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.tool-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.tool-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
}

/* Specific Tool UI elements */
.tool-container {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--glass-border);
  padding: 2rem;
  margin-bottom: 2rem;
}

.tool-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.tool-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.tool-header p {
  color: var(--text-muted);
}

textarea, .input-field {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  resize: vertical;
  min-height: 150px;
  outline: none;
  transition: var(--transition);
}

textarea:focus, .input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

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

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

/* Controls row */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
  align-items: center;
}

/* Stats boxes */
.stats-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.stat-box {
  flex: 1;
  min-width: 120px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

/* AdSense Placeholders */
.ads-container {
  margin: 2rem auto;
  text-align: center;
  width: 100%;
  display: none; /* Hidden until AdSense is approved */
}

.ads-placeholder {
  background: var(--ads-bg);
  border: 1px dashed var(--text-muted);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 auto;
}

.ad-horizontal {
  width: 100%;
  max-width: 728px;
  height: 90px;
}

.ad-rectangle {
  width: 300px;
  height: 250px;
}

/* Blog UI */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}
.blog-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}
.blog-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.blog-card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.blog-card-content h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.blog-card-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  flex: 1;
}
.read-more {
  color: var(--primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.blog-post-content {
  max-width: 800px;
  margin: 0 auto;
  background: var(--surface);
  padding: 3rem 2rem;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}
.blog-post-content h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.blog-post-content img {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 2rem;
}
.blog-post-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}
.blog-post-content p {
  margin-bottom: 1.2rem;
  font-size: 1.1rem;
  color: var(--text);
  line-height: 1.8;
}

/* Footer */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: 3rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.copyright {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.2rem;
  }
  .hamburger {
    display: block;
  }
  .nav-container {
    flex-direction: row;
    justify-content: space-between;
    position: relative;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--surface);
    padding: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 101;
  }
  .nav-links.active {
    display: flex;
  }
}
