:root {
  --primary: #4361ee;
  --secondary: #3a0ca3;
  --accent: #f72585;
  --light: #f8f9fa;
  --dark: #212529;
  --success: #4cc9f0;
  --warning: #f7b801;
  --error: #ef233c;
  --text: #333;
  --text-light: #777;
  --border: #e0e0e0;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
  --container-width: 1200px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  color: var(--text);
  line-height: 1.6;
  background-color: var(--light);
}

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

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

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

h1, h2, h3, h4, h5, h6 {
  color: var(--dark);
  line-height: 1.3;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.5rem;
}

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

ul, ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 1rem 0;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  color: white;
  text-decoration: none;
}

.logo span {
  color: var(--accent);
}

nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav ul li {
  margin-left: 2rem;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

nav ul li a:hover {
  color: var(--accent);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero Section */
.hero {
  background-color: var(--primary);
  background-image: linear-gradient(135deg, rgba(67, 97, 238, 0.9), rgba(58, 12, 163, 0.9));
  color: white;
  text-align: center;
  padding: 5rem 0;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: white;
}

.hero p {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto 2rem;
}

.search-bar {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
}

.search-bar input {
  flex: 1;
  padding: 1rem;
  border: none;
  border-radius: 4px 0 0 4px;
  font-size: 1rem;
}

.search-bar button {
  padding: 1rem 1.5rem;
  background-color: var(--accent);
  color: white;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.search-bar button:hover {
  background-color: #d91a75;
}

/* Section styles */
.section {
  padding: 5rem 0;
}

.section-light {
  background-color: white;
}

.section-dark {
  background-color: #f5f7fa;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.section-title:after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background-color: var(--accent);
  margin: 1rem auto 0;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.card {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-icon {
  background-color: var(--primary);
  color: white;
  font-size: 2rem;
  padding: 1.5rem;
  text-align: center;
}

.card-content {
  padding: 1.5rem;
}

.card h3 {
  margin-bottom: 1rem;
  color: var(--secondary);
}

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

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background-color: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  text-align: center;
}

.btn:hover {
  background-color: var(--secondary);
}

.btn-accent {
  background-color: var(--accent);
}

.btn-accent:hover {
  background-color: #d91a75;
}

/* Article Content */
.article {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 0;
}

.article h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

.article h2 {
  font-size: 1.8rem;
  margin: 2.5rem 0 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.article h3 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
}

.article h4 {
  font-size: 1.2rem;
  margin: 1.5rem 0 1rem;
}

.article p {
  margin-bottom: 1.5rem;
}

.article ul, .article ol {
  margin: 0 0 1.5rem 1.5rem;
}

.article li {
  margin-bottom: 0.5rem;
}

.article img {
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.article blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--text-light);
}

.article code {
  background-color: #f5f7fa;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
}

.article pre {
  background-color: #f5f7fa;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 2rem 0;
}

.article pre code {
  background-color: transparent;
  padding: 0;
}

.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
}

.article th, .article td {
  padding: 0.75rem;
  border: 1px solid var(--border);
}

.article th {
  background-color: #f5f7fa;
  font-weight: 600;
}

.table-of-contents {
  background-color: #f5f7fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem 0;
}

.table-of-contents h4 {
  margin-top: 0;
}

.table-of-contents ol {
  margin-bottom: 0;
}

.breadcrumbs {
  margin-bottom: 2rem;
  color: var(--text-light);
}

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

.breadcrumbs span {
  margin: 0 0.5rem;
}

/* Footer */
footer {
  background-color: var(--dark);
  color: white;
  padding: 3rem 0;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: block;
  color: white;
  text-decoration: none;
}

.footer-logo span {
  color: var(--accent);
}

.footer-about p {
  margin-bottom: 1rem;
  color: #aaa;
}

.footer-title {
  margin-bottom: 1.5rem;
  position: relative;
  color: white;
}

.footer-title:after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background-color: var(--accent);
  margin-top: 0.5rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.7rem;
}

.footer-links a {
  color: #aaa;
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid #444;
  color: #aaa;
}

/* Schema.org Structured Data */
.schema-data {
  display: none;
}

/* Search Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 5px solid rgba(67, 97, 238, 0.2);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s ease-in-out infinite;
  margin: 2rem 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }

  nav ul {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background-color: var(--primary);
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
    transform: translateY(-150%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow);
  }

  nav ul.active {
    transform: translateY(0);
  }

  nav ul li {
    margin: 0.5rem 0;
  }

  .header-content {
    position: relative;
  }

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

  .hero p {
    font-size: 1rem;
  }

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

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --light: #121212;
    --dark: #f8f9fa;
    --text: #e0e0e0;
    --text-light: #aaaaaa;
    --border: #333333;
  }

  body {
    background-color: #1f1f1f;
  }

  .section-light {
    background-color: #1f1f1f;
  }

  .section-dark {
    background-color: #181818;
  }

  .card, .article pre, .table-of-contents, .article th {
    background-color: #2a2a2a;
  }

  .article code {
    background-color: #333;
  }
}