/* CSS Variables for Theming */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --border-color: #e5e5e5;
  --link-color: #0066cc;
  --link-hover: #0052a3;
  --selection-bg: #e5f2ff;
}

[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --text-primary: #e5e5e5;
  --text-secondary: #b0b0b0;
  --border-color: #404040;
  --link-color: #4da6ff;
  --link-hover: #66b3ff;
  --selection-bg: #1a3d5c;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.6;
  font-size: 16px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Three Column Layout */
.main-layout {
  display: grid;
  grid-template-columns: 300px 1fr 250px;
  gap: 3rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  align-items: start;
}

.left-sidebar {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 1rem;
}

.center-content {
  min-width: 0;
}

.right-sidebar {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
}

.chatbot-sidebar {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.chatbot-sidebar h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.chatbot-sidebar p {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

/* Typography */
h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

p {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

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

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

/* Navigation */
.navbar {
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

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

.navbar .logo {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.navbar .logo:hover {
  color: var(--text-primary);
}

.navbar .nav-links {
  display: flex;
  gap: 2rem;
}

.navbar .nav-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
}

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

.navbar .social-icons {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--text-primary);
}

.navbar .social-icons a {
  color: var(--text-secondary);
  font-size: 1.2rem;
}

.navbar .social-icons a:hover {
  color: var(--text-primary);
}

/* Hero Section */
.hero {
  padding: 3rem 0 2rem;
  background-color: var(--bg-primary);
  transition: background-color 0.3s ease;
}

.hero-content {
  max-width: 100%;
}

.hero h1 {
  margin-bottom: 2rem;
}

.hero-subtitle {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

/* About Section */
.about-section {
  padding: 3rem 0;
  background-color: var(--bg-primary);
  transition: background-color 0.3s ease;
}

.about-section h2 {
  margin-bottom: 2rem;
}

.about-section p {
  max-width: 700px;
}

/* Chatbot Section */
/* Newsletter Sidebar */
.newsletter-sidebar {
  padding: 1.5rem;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.newsletter-sidebar h2 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.newsletter-intro {
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.newsletter-posts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.newsletter-post {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1rem;
  transition: all 0.3s ease;
}

.newsletter-post:hover {
  background-color: var(--bg-secondary);
}

.post-header {
  margin-bottom: 0.5rem;
}

.post-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
}

.post-header time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.post-content p {
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.post-content p:last-child {
  margin-bottom: 0;
}

.chatbot-section {
  padding: 3rem 0;
  background-color: var(--bg-primary);
  transition: background-color 0.3s ease;
}

.chatbot-section h2 {
  margin-bottom: 1rem;
}

.chatbot-section p {
  margin-bottom: 2rem;
}

.chatbot-container {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: border-color 0.3s ease;
  flex: 1;
  min-height: 0;
}

.chatbot-container iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 600px;
}

/* Contact Section */
.contact-section {
  padding: 3rem 0;
  background-color: var(--bg-primary);
  transition: background-color 0.3s ease;
}

.contact-section h2 {
  margin-bottom: 2rem;
}

.contact-email {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.contact-email a {
  color: var(--link-color);
  font-weight: 500;
}

.social-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.social-links a {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.social-links a i {
  font-size: 1.3rem;
}

/* Analytics Section */
.analytics-section {
  padding: 4rem 0;
  background-color: var(--bg-secondary);
  transition: background-color 0.3s ease;
}

.analytics-section h2 {
  text-align: center;
  margin-bottom: 0.5rem;
}

.analytics-section p {
  text-align: center;
  margin-bottom: 3rem;
}

.chart-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem;
  background-color: var(--bg-primary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .chart-container {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Footer */
footer {
  padding: 3rem 0;
  background-color: var(--bg-secondary);
  text-align: center;
  border-top: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

footer p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.visitor-counter {
  display: flex;
  justify-content: center;
  align-items: center;
}

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

/* Responsive Design */
@media (max-width: 1200px) {
  .main-layout {
    grid-template-columns: 250px 1fr 300px;
    gap: 1.5rem;
  }

  .right-sidebar {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
  }

  .chatbot-sidebar {
    max-width: 600px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  .navbar .container {
    flex-wrap: wrap;
  }

  .navbar .nav-links {
    order: 3;
    width: 100%;
    margin-top: 1rem;
    gap: 1.5rem;
  }

  .main-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 0 1rem;
  }

  .left-sidebar {
    position: static;
    max-height: none;
    padding-right: 0;
  }

  .right-sidebar {
    position: static;
    max-height: none;
  }

  .chatbot-sidebar {
    max-width: 100%;
  }

  .hero {
    padding: 2rem 0 1.5rem;
  }

  .about-section,
  .contact-section {
    padding: 2rem 0;
  }

  .chatbot-container iframe {
    min-height: 500px;
  }

  .social-links {
    flex-direction: column;
    gap: 1rem;
  }

  .chart-container {
    padding: 1rem;
  }

  .analytics-section {
    padding: 3rem 0;
  }
}

::-moz-selection {
  background: var(--selection-bg);
}

::selection {
  background: var(--selection-bg);
}