/* ===== CSS VARIABLES ===== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #4f46e5;
  --dark: #0f172a;
  --darker: #020617;
  --light: #f8fafc;
  --gray: #64748b;
  --light-gray: #e2e8f0;
  --card-bg: #ffffff;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 12px;
  --radius-lg: 16px;
  --transition: all 0.3s ease;
}

/* ===== RESET & BASE ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--light);
  color: var(--dark);
  line-height: 1.6;
  font-size: 16px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
ul { list-style: none; }

/* ===== UTILITIES ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.btn {
  display: inline-block;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-size: 1rem;
}
.btn.primary {
  background: var(--primary);
  color: white;
}
.btn.primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.btn.secondary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn.secondary:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

/* ===== HEADER ===== */
header {
  background: var(--dark);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}
.logo {
  color: white;
  font-size: 1.375rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.nav-links a {
  color: #cbd5e1;
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}
.nav-links a:hover,
.nav-links a.active {
  color: white;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
}
.nav-links a:hover::after {
  width: 100%;
}
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== HERO SECTION ===== */
.hero {
  background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
}
.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.hero p {
  font-size: 1.25rem;
  color: #cbd5e1;
  max-width: 600px;
  margin: 0 auto 2rem;
}
.hero-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.hero-note {
  color: #94a3b8;
  font-size: 0.9375rem;
}

/* ===== AD BANNERS ===== */
.ad-banner {
  margin: 2rem auto;
  text-align: center;
  min-height: 90px;
  background: var(--light-gray);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  font-size: 0.875rem;
}

/* ===== TOOLS SECTION ===== */
.tools-section {
  padding: 4rem 0;
}
.tools-section h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.section-desc {
  text-align: center;
  color: var(--gray);
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.tool-card {
  background: var(--card-bg);
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--dark);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}
.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  color: var(--primary);
}
.tool-icon {
  font-size: 2rem;
}
.tool-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
}
.tool-card p {
  color: var(--gray);
  font-size: 0.9375rem;
  flex-grow: 1;
}
.tool-tag {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
}

/* ===== FEATURES SECTION ===== */
.features-section {
  padding: 4rem 0;
  background: white;
}
.features-section h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2.5rem;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}
.feature {
  text-align: center;
  padding: 1.5rem;
}
.feature-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
}
.feature h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.feature p {
  color: var(--gray);
  font-size: 0.9375rem;
}

/* ===== BLOG PREVIEW ===== */
.blog-preview {
  padding: 4rem 0;
}
.blog-preview h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2.5rem;
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.blog-card {
  background: var(--card-bg);
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--dark);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.blog-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
}
.blog-card p {
  color: var(--gray);
  font-size: 0.9375rem;
  flex-grow: 1;
}
.read-more {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9375rem;
}
.center-btn {
  text-align: center;
}

/* ===== FOOTER ===== */
footer {
  background: var(--dark);
  color: #cbd5e1;
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
}
.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand h3 {
  color: white;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}
.footer-brand p {
  font-size: 0.9375rem;
  color: #94a3b8;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-links h4 {
  color: white;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.footer-links a {
  color: #94a3b8;
  font-size: 0.9375rem;
}
.footer-links a:hover {
  color: white;
}
.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid #334155;
  font-size: 0.875rem;
  color: #64748b;
}
.footer-bottom p {
  margin-bottom: 0.25rem;
}
.ads-note {
  font-size: 0.8125rem;
}

/* ===== TOOL PAGES COMMON STYLES ===== */
.tool-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  text-align: center;
}
.tool-container h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}
.tool-container > p {
  color: var(--gray);
  margin-bottom: 2rem;
}
.upload-area {
  border: 3px dashed var(--light-gray);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  cursor: pointer;
  transition: var(--transition);
  background: white;
  margin-bottom: 1.5rem;
}
.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary);
  background: #eff6ff;
}
.upload-area p {
  color: var(--gray);
  margin: 0;
}
.click-here {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}
#loading {
  color: var(--primary);
  font-weight: 500;
  margin: 1rem 0;
}
#result img {
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  margin-bottom: 1rem;
}
.tool-options {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
  text-align: left;
}
.tool-options label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}
.tool-options input,
.tool-options select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--light-gray);
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 1rem;
}
.tool-options .row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.tool-options .row > div {
  flex: 1;
  min-width: 120px;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}
.checkbox-row input {
  width: auto;
  margin: 0;
}
.preset-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}
.preset-btns button {
  padding: 0.5rem 1rem;
  background: var(--light-gray);
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}
.preset-btns button:hover {
  background: var(--primary);
  color: white;
}

/* ===== BLOG POST STYLES ===== */
article {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}
article .meta {
  color: var(--gray);
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--light-gray);
  padding-bottom: 1rem;
}
article h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}
article h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
}
article h3 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem;
}
article p {
  margin-bottom: 1rem;
}
article ul, article ol {
  margin: 1rem 0 1rem 1.5rem;
}
article li {
  margin-bottom: 0.5rem;
}
article a {
  font-weight: 500;
}
article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
article th, article td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--light-gray);
}
article th {
  background: var(--light);
  font-weight: 600;
}
.related-posts {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--light-gray);
}
.related-posts h3 {
  margin-bottom: 1rem;
}
.related-posts ul {
  list-style: disc;
  margin-left: 1.5rem;
}
.related-posts li {
  margin-bottom: 0.5rem;
}

/* ===== COMPLIANCE PAGES ===== */
.compliance-page {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}
.compliance-page h1 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}
.compliance-page h2 {
  font-size: 1.375rem;
  margin: 1.5rem 0 0.75rem;
}
.compliance-page p {
  margin-bottom: 1rem;
}
.compliance-page ul {
  margin: 1rem 0 1rem 1.5rem;
}
.compliance-page li {
  margin-bottom: 0.5rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .mobile-toggle {
    display: block;
  }
  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--dark);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    transform: translateY(-150%);
    transition: var(--transition);
    z-index: 99;
  }
  .nav-links.active {
    transform: translateY(0);
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1.125rem;
  }
  .tools-grid,
  .blog-grid,
  .features-grid {
    grid-template-columns: 1fr;
  }
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-links {
    align-items: center;
  }
  article h1 {
    font-size: 1.75rem;
  }
  .tool-options .row {
    flex-direction: column;
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
