/* ═══════════════════════════════════════════════════════
   Easier AI Tools - Main Stylesheet
   ═══════════════════════════════════════════════════════ */

/* ─── CSS Variables ─── */
:root {
  --primary: #1F4E79;
  --primary-dark: #163A5C;
  --secondary: #2E75B6;
  --accent: #00B0A0;
  --accent-light: #E0F7F5;
  --bg-white: #FFFFFF;
  --bg-light: #F5F7FA;
  --bg-card: #FFFFFF;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-light: #999999;
  --border: #E2E8F0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --max-width: 1200px;
  --transition: 0.3s ease;
}

/* ─── Reset & Base ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
  background: var(--bg-light);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

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

ul, ol {
  list-style: none;
}

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

/* ─── Header ─── */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  font-weight: 800;
}

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

.nav a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding: 4px 0;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary);
  transition: width var(--transition);
}

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

.nav a:hover::after,
.nav a.active::after {
  width: 100%;
}

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

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.mobile-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* ─── Hero Section ─── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 60px 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.3;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

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

.hero-search input {
  width: 100%;
  padding: 14px 20px;
  padding-right: 50px;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  box-shadow: var(--shadow-lg);
  outline: none;
}

.hero-search input::placeholder {
  color: var(--text-light);
}

.hero-search button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  background: var(--secondary);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  transition: background var(--transition);
}

.hero-search button:hover {
  background: var(--primary);
}

/* ─── Category Tabs ─── */
.category-tabs {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  overflow-x: auto;
}

.category-tabs .container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-tabs .container::-webkit-scrollbar {
  display: none;
}

.cat-tab {
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text-secondary);
  background: var(--bg-light);
  border: 1px solid var(--border);
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
}

.cat-tab:hover,
.cat-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ─── Main Layout ─── */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  padding: 40px 0 60px;
}

/* ─── Article Cards ─── */
.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--secondary);
  border-radius: 2px;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.article-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  border: 1px solid var(--border);
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.article-card .card-image {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--bg-light), var(--accent-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
  font-size: 2.5rem;
  position: relative;
  overflow: hidden;
}

.article-card .card-image .card-category {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

.article-card .card-body {
  padding: 20px;
}

.article-card .card-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.article-card .card-body h3 a {
  color: inherit;
}

.article-card .card-body h3 a:hover {
  color: var(--secondary);
}

.article-card .card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--text-light);
}

.article-card .card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── Featured Article (Homepage) ─── */
.featured-article {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 40px;
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.featured-article .featured-image {
  min-height: 320px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 4rem;
}

.featured-article .featured-body {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-article .featured-label {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 16px;
  width: fit-content;
}

.featured-article h2 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.featured-article h2 a {
  color: inherit;
}

.featured-article h2 a:hover {
  color: var(--secondary);
}

.featured-article .excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 20px;
}

/* ─── Sidebar ─── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.sidebar-widget {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.sidebar-widget h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--bg-light);
  color: var(--text-primary);
}

.sidebar-widget ul li {
  padding: 8px 0;
  border-bottom: 1px solid var(--bg-light);
}

.sidebar-widget ul li:last-child {
  border-bottom: none;
}

.sidebar-widget ul li a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-widget ul li a:hover {
  color: var(--secondary);
}

.sidebar-widget ul li a .count {
  margin-left: auto;
  background: var(--bg-light);
  padding: 2px 8px;
  border-radius: 50px;
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Newsletter Widget */
.newsletter-widget {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
}

.newsletter-widget h3 {
  color: white;
  border-bottom-color: rgba(255,255,255,0.2);
}

.newsletter-widget p {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 16px;
  line-height: 1.6;
}

.newsletter-widget input {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 10px;
  outline: none;
}

.newsletter-widget button {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.newsletter-widget button:hover {
  background: #009688;
}

/* ─── Article Page ─── */
.article-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 24px;
}

.breadcrumb a {
  color: var(--text-light);
}

.breadcrumb a:hover {
  color: var(--secondary);
}

.breadcrumb .separator {
  color: var(--border);
}

.article-header {
  margin-bottom: 30px;
}

.article-header h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--text-light);
  font-size: 0.88rem;
  flex-wrap: wrap;
}

.article-meta .author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
}

.article-meta .meta-text {
  display: flex;
  flex-direction: column;
}

.article-meta .meta-text .author-name {
  font-weight: 600;
  color: var(--text-primary);
}

.article-featured-image {
  width: 100%;
  height: 400px;
  background: linear-gradient(135deg, var(--bg-light), var(--accent-light));
  border-radius: var(--radius-md);
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
  font-size: 4rem;
}

.article-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-primary);
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 36px 0 16px;
  color: var(--text-primary);
}

.article-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 28px 0 12px;
  color: var(--text-primary);
}

.article-content p {
  margin-bottom: 18px;
}

.article-content ul,
.article-content ol {
  margin: 16px 0;
  padding-left: 24px;
}

.article-content ul {
  list-style: disc;
}

.article-content ol {
  list-style: decimal;
}

.article-content li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.article-content blockquote {
  border-left: 4px solid var(--secondary);
  padding: 16px 20px;
  margin: 24px 0;
  background: var(--bg-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-secondary);
}

.article-content strong {
  font-weight: 600;
  color: var(--text-primary);
}

/* Ad Placeholder */
.ad-placeholder {
  background: var(--bg-light);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 30px;
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
  margin: 30px 0;
}

/* Author Bio */
.author-bio {
  display: flex;
  gap: 20px;
  padding: 24px;
  background: var(--bg-light);
  border-radius: var(--radius-md);
  margin-top: 40px;
  align-items: center;
}

.author-bio .avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.author-bio .bio-text h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.author-bio .bio-text p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Related Articles */
.related-articles {
  margin-top: 50px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.related-articles h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.related-card {
  display: block;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text-primary);
  cursor: pointer;
}

.related-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
}

.related-card .related-image {
  width: 100%;
  height: 100px;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
  font-size: 1.5rem;
}

.related-card h4 {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
}

.related-card h4 a {
  color: var(--text-primary);
}

.related-card h4 a:hover {
  color: var(--secondary);
}

/* ─── Static Pages (About, Privacy, Terms, Contact) ─── */
.static-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 50px 20px 60px;
}

.static-page h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.static-page .page-subtitle {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 36px;
}

.static-page h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 32px 0 14px;
  color: var(--text-primary);
}

.static-page h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--text-primary);
}

.static-page p {
  margin-bottom: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.static-page ul,
.static-page ol {
  margin: 12px 0 20px 24px;
  color: var(--text-secondary);
}

.static-page ul {
  list-style: disc;
}

.static-page ol {
  list-style: decimal;
}

.static-page li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.static-page a {
  color: var(--secondary);
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.contact-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-form label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.contact-form input,
.contact-form textarea {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--secondary);
}

.contact-form textarea {
  min-height: 150px;
  resize: vertical;
}

.contact-form button {
  padding: 14px 32px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  width: fit-content;
}

.contact-form button:hover {
  background: var(--primary-dark);
}

/* ─── Footer ─── */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.8);
  padding: 50px 0 0;
}

.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 .logo {
  color: white;
  margin-bottom: 14px;
}

.footer-brand p {
  font-size: 0.88rem;
  line-height: 1.7;
  opacity: 0.8;
}

.footer-col h4 {
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  color: rgba(255,255,255,0.7);
  font-size: 0.88rem;
  transition: color var(--transition);
}

.footer-col ul li a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  padding: 20px 0;
  font-size: 0.82rem;
  opacity: 0.6;
}

/* ─── Pagination ─── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination a,
.pagination span {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.pagination a:hover {
  background: var(--bg-light);
}

.pagination .active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg-white);
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .nav.open {
    display: flex;
  }

  .mobile-toggle {
    display: flex;
  }

  .hero h1 {
    font-size: 1.7rem;
  }

  .featured-article {
    grid-template-columns: 1fr;
  }

  .featured-article .featured-image {
    min-height: 200px;
  }

  .featured-article .featured-body {
    padding: 24px;
  }

  .articles-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .article-header h1 {
    font-size: 1.5rem;
  }

  .article-featured-image {
    height: 240px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 40px 0;
  }

  .hero h1 {
    font-size: 1.4rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}
