/* Global Variables */
:root {
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --bg: #F8FAFC;
  --bg-card: #FFFFFF;
  --text: #0F172A;
  --text-light: #64748B;
  --border: #E2E8F0;
  --max-width: 1200px;
}

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

body {
  font-family: -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;
}

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

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

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

main {
  flex: 1;
}

/* Header & Nav */
header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 30px;
}

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

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

.btn {
  display: inline-block;
  background-color: var(--primary);
  color: white;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  text-align: center;
}

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

.btn:disabled {
  background-color: var(--border);
  color: var(--text-light);
  cursor: not-allowed;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 80px 20px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

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

.hero p {
  font-size: 1.25rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto 30px;
}

/* Sections */
section {
  padding: 60px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-header h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.section-header p {
  color: var(--text-light);
}

/* Cards Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.card h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.card p {
  color: var(--text-light);
  margin-bottom: 20px;
}

/* Application UI */
.app-container {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-card);
  padding: 30px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.app-input {
  width: 100%;
  min-height: 300px;
  padding: 20px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1.1rem;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 20px;
}

.app-input:focus {
  outline: none;
  border-color: var(--primary);
}

.app-results {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

.stat-box {
  background: var(--bg);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid var(--border);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 5px;
}

.stat-label {
  color: var(--text-light);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* Page Layouts */
.page-content {
  background: var(--bg-card);
  padding: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  max-width: 800px;
  margin: 60px auto;
}

.page-content h1 {
  margin-bottom: 20px;
  font-size: 2.5rem;
}

.page-content h2 {
  margin-top: 30px;
  margin-bottom: 15px;
}

.page-content p, .page-content ul {
  margin-bottom: 20px;
  color: var(--text);
}

.page-content ul {
  padding-left: 20px;
  list-style: disc;
}

/* Form */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
}

/* Article Styling */
article.page-content {
  font-size: 1.1rem;
}

article h1 { font-size: 2.5rem; line-height: 1.2; margin-bottom: 24px; }
article h2 { font-size: 1.8rem; margin: 40px 0 16px; }
article h3 { font-size: 1.4rem; margin: 30px 0 16px; }
article p { margin-bottom: 24px; line-height: 1.8; color: #334155; }
article strong { font-weight: 600; color: #0F172A; }

/* Footer */
footer {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 40px 0 20px;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

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

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

.copyright {
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* Adsense Placeholder (for user) */
.ad-slot {
  width: 100%;
  min-height: 90px;
  background-color: #F1F5F9;
  border: 1px dashed #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  font-size: 0.875rem;
  margin: 30px 0;
  text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.2rem; }
  .app-results { grid-template-columns: 1fr; }
  .page-content { margin: 20px auto; padding: 20px; }
  .footer-content { flex-direction: column; text-align: center; }
  .nav-links { display: none; } /* Add a hamburger menu later if needed, kept hidden for extreme simplicity */
}
