:root {
  --primary-color: #4F46E5;
  --primary-hover: #4338CA;
  --primary-gradient: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  --hover-gradient: linear-gradient(135deg, #4338CA 0%, #6D28D9 100%);
  --bg-color: #F8FAFC;
  --text-main: #0F172A;
  --text-muted: #475569; /* Darkened from #64748B for AA contrast */
  --card-bg: #FFFFFF;
  --border-color: #E2E8F0;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --container-max: 1200px;
}

[data-theme="dark"] {
  --bg-color: #0F172A;
  --text-main: #F1F5F9;
  --text-muted: #CBD5E1; /* Lightened for AA contrast on dark backgrounds */
  --card-bg: #1E293B;
  --border-color: #334155;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: var(--transition);
  margin-left: 10px;
}

.theme-toggle:hover { background: var(--border-color); }
.theme-toggle .moon-icon, .theme-toggle .moon-text { display: none; }
.theme-toggle .theme-text { font-size: 0.85rem; font-weight: 600; margin-left: 8px; }

[data-theme="dark"] .theme-toggle .sun-icon, [data-theme="dark"] .theme-toggle .sun-text { display: none; }
[data-theme="dark"] .theme-toggle .moon-icon, [data-theme="dark"] .theme-toggle .moon-text { display: block; }

@media (max-width: 600px) {
  .theme-toggle .theme-text { display: none; }
}
[data-theme="dark"] header { background: rgba(15, 23, 42, 0.85); border-bottom-color: rgba(51, 65, 85, 0.8); }
[data-theme="dark"] .tool-wrapper, [data-theme="dark"] .content-section { background: var(--card-bg); border-color: var(--border-color); }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { background: #111827 !important; border-color: #374151 !important; color: #fff !important; }


* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    background: var(--bg-color); 
    color: var(--text-main); 
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll from absolute shapes or long logos */
}
a { color: var(--primary-color); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }

/* Layout */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 20px; }
header { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 100; border-bottom: 1px solid rgba(226, 232, 240, 0.8); box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03); transition: var(--transition); }
.header-inner { display: flex; align-items: center; padding: 12px 0; gap: 20px; }
.logo { font-size: 1.5rem; font-weight: 800; color: var(--text-main); display: flex; align-items: center; gap: 10px; letter-spacing: -0.02em; flex-shrink: 0; margin-right: auto; }
.logo:hover { transform: scale(1.02); }
.logo span { background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.logo svg { color: var(--primary-color); transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.logo:hover svg { transform: rotate(15deg) scale(1.1); }
.hamburger { display: none; border: none; background: transparent; color: var(--text-main); cursor: pointer; }
.hamburger svg { width: 28px; height: 28px; transition: var(--transition); }
.nav-links { 
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px 12px;
    flex-grow: 1;
    max-width: 850px;
    margin-left: 20px;
    margin-right: 20px;
}

.nav-links a { 
    font-weight: 500; 
    color: var(--text-muted); 
    position: relative; 
    padding: 4px 6px; 
    font-size: 0.8rem; 
    white-space: nowrap; 
    text-align: center; 
    border-radius: 4px;
    transition: var(--transition);
}

.nav-links a.active-nav {
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.08);
}

.nav-links a::after { content: ''; position: absolute; bottom: 0; left: 50%; width: 0%; height: 2px; background: var(--primary-gradient); transition: all 0.3s ease; transform: translateX(-50%); border-radius: 4px; }
.nav-links a:hover { color: var(--text-main); background: rgba(0,0,0,0.03); }
[data-theme="dark"] .nav-links a:hover { background: rgba(255,255,255,0.05); }
.nav-links a:hover::after { width: 60%; }
.nav-links a.active-nav::after { width: 80%; }

/* Ads - Designed for native blending but distinct for policy */
.ad-container { background: #F1F5F9; border: 1px dashed #CBD5E1; text-align: center; color: var(--text-muted); padding: 20px; margin: 30px auto; border-radius: 8px; font-size: 0.9rem; clear: both; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.ad-container::before { content: "Advertisement"; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; color: #475569; }
.ad-top { max-width: 728px; height: 90px; }
.ad-box { width: 300px; height: 250px; }
.ad-responsive { min-height: 100px; width: 100%; }

/* Grid Cards */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; padding: 40px 0; }
.tool-card { background: var(--card-bg); border-radius: var(--radius); padding: 30px; text-align: center; box-shadow: var(--shadow); transition: var(--transition); border: 1px solid var(--border-color); display: flex; flex-direction: column; height: 100%; position: relative; overflow: hidden; }
.tool-card::after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: var(--primary-color); transform: scaleX(0); transform-origin: left; transition: transform 0.3s ease; }
.tool-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.tool-card:hover::after { transform: scaleX(1); }
.tool-card .icon { 
    width: 64px; 
    height: 64px; 
    margin: 0 auto 20px; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    border-radius: 18px;
    color: #fff; 
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.tool-card:nth-child(1n) .icon { background: linear-gradient(135deg, #FF6B6B, #FF8E53); box-shadow: 0 8px 16px rgba(255, 107, 107, 0.3); }
.tool-card:nth-child(2n) .icon { background: linear-gradient(135deg, #4facfe, #00f2fe); box-shadow: 0 8px 16px rgba(79, 172, 254, 0.3); }
.tool-card:nth-child(3n) .icon { background: linear-gradient(135deg, #43e97b, #38f9d7); box-shadow: 0 8px 16px rgba(67, 233, 123, 0.3); }
.tool-card:nth-child(4n) .icon { background: linear-gradient(135deg, #fa709a, #fee140); box-shadow: 0 8px 16px rgba(250, 112, 154, 0.3); }
.tool-card:nth-child(5n) .icon { background: linear-gradient(135deg, #667eea, #764ba2); box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3); }
.tool-card:nth-child(6n) .icon { background: linear-gradient(135deg, #f093fb, #f5576c); box-shadow: 0 8px 16px rgba(240, 147, 251, 0.3); }
.tool-card:nth-child(7n) .icon { background: linear-gradient(135deg, #0ba360, #3cba92); box-shadow: 0 8px 16px rgba(11, 163, 96, 0.3); }
.tool-card:nth-child(8n) .icon { background: linear-gradient(135deg, #ff0844, #ffb199); box-shadow: 0 8px 16px rgba(255, 8, 68, 0.3); }
.tool-card:nth-child(9n) .icon { background: linear-gradient(135deg, #96fbc4, #f9f586); color: #0f172a; box-shadow: 0 8px 16px rgba(150, 251, 196, 0.3); }
.tool-card:nth-child(10n) .icon { background: linear-gradient(135deg, #8E2DE2, #4A00E0); box-shadow: 0 8px 16px rgba(142, 45, 226, 0.3); }
.tool-card:nth-child(11n) .icon { background: linear-gradient(135deg, #FF416C, #FF4B2B); box-shadow: 0 8px 16px rgba(255, 65, 108, 0.3); }
.tool-card:nth-child(12n) .icon { background: linear-gradient(135deg, #11998e, #38ef7d); box-shadow: 0 8px 16px rgba(17, 153, 142, 0.3); }
.tool-card:nth-child(13n) .icon { background: linear-gradient(135deg, #ff9a9e, #fecfef); box-shadow: 0 8px 16px rgba(255, 154, 158, 0.3); }
.tool-card:nth-child(14n) .icon { background: linear-gradient(135deg, #a1c4fd, #c2e9fb); box-shadow: 0 8px 16px rgba(161, 196, 253, 0.3); }
.tool-card:nth-child(15n) .icon { background: linear-gradient(135deg, #D4FC79, #96E6A1); box-shadow: 0 8px 16px rgba(212, 252, 121, 0.3); }
.tool-card .icon svg { transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
.tool-card:hover .icon { transform: translateY(-5px) scale(1.05); }
.tool-card:hover .icon svg { transform: scale(1.15) rotate(12deg); }
.tool-card h3 { font-size: 1.3rem; margin-bottom: 12px; color: var(--text-main); font-weight: 700; letter-spacing: -0.01em; }
.tool-card p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 24px; flex-grow: 1; display: flex; align-items: center; justify-content: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--primary-gradient); color: #fff !important; padding: 12px 24px; border-radius: var(--radius); font-weight: 600; cursor: pointer; border: none; font-size: 1rem; transition: var(--transition); text-decoration: none; width: 100%; box-shadow: 0 4px 15px rgba(79, 70, 229, 0.25); }
.btn:hover { background: var(--hover-gradient); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4); }

/* Tool UI */
.tool-wrapper { max-width: 600px; margin: 40px auto; background: var(--card-bg); padding: 40px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border-color); }
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.95rem; color: var(--text-main); }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 14px; border: 1px solid #CBD5E1; border-radius: 8px; font-size: 1rem; font-family: inherit; transition: var(--transition); background: #F8FAFC; color: var(--text-main); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary-color); background: #fff; box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1); }
.row { display: flex; gap: 16px; }
.row .form-group { flex: 1; }

.result-box { display: none; margin-top: 24px; padding: 24px; background: #EEF2FF; border-left: 4px solid var(--primary-color); border-radius: 4px 8px 8px 4px; font-size: 1.25rem; font-weight: 600; text-align: center; color: var(--text-main); box-shadow: inner 0 2px 4px rgba(0,0,0,0.05); }
.result-box.error { background: #FEF2F2; border-left-color: #DC2626; color: #B91C1C; }

/* Content sections (SEO) */
.content-section { max-width: 800px; margin: 60px auto; background: var(--card-bg); padding: 40px; border-radius: var(--radius); border: 1px solid var(--border-color); }
.content-section * { max-width: 100%; }
.content-section h1 { font-size: 2.2rem; margin-bottom: 20px; line-height: 1.2; text-align: center; }
.content-section h2 { font-size: 1.8rem; margin: 40px 0 20px; border-bottom: 2px solid #F1F5F9; padding-bottom: 10px; }
.content-section h3 { font-size: 1.4rem; margin: 30px 0 16px; }
.content-section p { margin-bottom: 20px; font-size: 1.1rem; color: #334155; line-height: 1.7; }
.content-section ul, .content-section ol { margin-left: 24px; margin-bottom: 24px; color: #334155; font-size: 1.1rem; }
.content-section li { margin-bottom: 10px; }

/* FAQ Schema */
.faq-list { margin-top: 40px; }
.faq-item { margin-bottom: 24px; border: 1px solid var(--border-color); border-radius: 8px; padding: 20px; background: #F8FAFC; }
.faq-item h3 { margin: 0 0 12px 0; font-size: 1.2rem; color: var(--text-main); }
.faq-item p { margin: 0; font-size: 1rem; }

/* Trust & Blog Layout */
.hero { text-align: center; padding: 90px 0 50px; background: radial-gradient(circle at top right, rgba(124, 58, 237, 0.08) 0%, rgba(248, 250, 252, 1) 50%), radial-gradient(circle at top left, rgba(79, 70, 229, 0.05) 0%, rgba(248, 250, 252, 1) 50%); margin-bottom: 40px; position: relative; }
.hero h1 { font-size: 3.5rem; margin-bottom: 24px; line-height: 1.15; color: #0F172A; font-weight: 800; letter-spacing: -0.03em; }
.hero p { font-size: 1.25rem; color: var(--text-muted); max-width: 600px; margin: 0 auto; line-height: 1.7; }

/* Home Search */
.home-search { max-width: 600px; margin: 30px auto; position: relative; }
.home-search input { width: 100%; padding: 18px 24px 18px 56px; border: 2px solid #E2E8F0; border-radius: 50px; font-size: 1.1rem; box-shadow: var(--shadow); transition: var(--transition); }
.home-search input:focus { border-color: var(--primary-color); outline: none; box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.2); transform: scale(1.02); }
.home-search .search-icon { position: absolute; left: 24px; top: 50%; transform: translateY(-50%); color: #94A3B8; width: 22px; height: 22px; pointer-events: none; transition: var(--transition); }
.home-search input:focus + .search-icon { color: var(--primary-color); transform: translateY(-50%) scale(1.1); }

/* Features */
.features { display: flex; justify-content: center; gap: 40px; margin-top: 30px; flex-wrap: wrap; }
.feature-item { display: flex; align-items: center; gap: 8px; color: #475569; font-weight: 500; }
.feature-item svg { color: #10B981; width: 20px; height: 20px; }

/* Blog preview grid */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.blog-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 24px; transition: var(--transition); position: relative; overflow: hidden; }
.blog-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); border-color: var(--primary-color); }
.blog-card::before { content: ""; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--primary-gradient); opacity: 0; transition: var(--transition); }
.blog-card:hover::before { opacity: 1; }
.blog-card h3 { margin-bottom: 12px; }
.blog-card a { font-weight: 700; color: var(--text-main); }
.blog-card h3 a:hover { color: var(--primary-color); }

.section-title { text-align: center; margin: 60px 0 40px; font-size: 2.2rem; }

footer { background: #0F172A; color: #CBD5E1; padding: 60px 0 30px; margin-top: 80px; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 40px; margin-bottom: 40px; }
.footer-col h2 { color: #fff; font-size: 1.2rem; margin-bottom: 20px; } /* Changed from h4 to h2/h3 for sequential order */
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 12px; }
.footer-col a { color: #CBD5E1; }
.footer-col a:hover { color: #fff; }
.footer-bottom { text-align: center; padding-top: 30px; border-top: 1px solid #1E293B; font-size: 0.9rem; }

@media (max-width: 768px) {
  .hero { padding: 40px 0 20px; }
  .hero h1 { font-size: 2.2rem; }
  .tools-grid { grid-template-columns: 1fr; }
  
  .logo { font-size: 1.25rem; gap: 6px; }
  .logo img { width: 28px !important; height: 28px !important; }

  .header-inner { gap: 10px; }

  .hamburger { display: block; flex-shrink: 0; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 20px 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    gap: 16px;
    display: none;
    border-bottom: 1px solid var(--border-color);
  }
  .nav-links.active { display: flex; }
  .nav-links a { grid-column: auto !important; grid-row: auto !important; text-align: center; width: 100%; }

  
  .tool-wrapper, .content-section { padding: 24px; margin: 20px auto; }
  .row { flex-direction: column; gap: 0; }
  .footer-inner { flex-direction: column; }
  .footer-col { margin-bottom: 30px; }
}

@media (max-width: 400px) {
  .logo { font-size: 1.1rem; }
  .hero h1 { font-size: 1.8rem; }
  .container { padding: 0 15px; }
}

/* Animations */
@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(15deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

.anim-shape {
  pointer-events: none;
  position: absolute;
  z-index: 0;
  opacity: 0.15;
}
.anim-shape.s1 {
  top: -5%;
  right: 5%;
  max-width: 350px;
  animation: float 8s ease-in-out infinite;
  color: var(--primary-color);
}
.anim-shape.s2 {
  bottom: -15%;
  left: -5%;
  max-width: 250px;
  animation: float 12s ease-in-out infinite alternate-reverse;
  color: #8B5CF6;
}
