/* ===== SpamFoo Help Center - Documentation Theme ===== */

:root {
  /* Light theme colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-elevated: #ffffff;

  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-tertiary: #9ca3af;
  --text-link: #10b981;
  --text-link-hover: #059669;

  --border-color: #e5e7eb;
  --border-subtle: #f3f4f6;

  --accent-primary: #10b981;
  --accent-secondary: #059669;
  --accent-tertiary: #34d399;

  --code-bg: #f3f4f6;
  --code-text: #1f2937;

  --nav-active-bg: rgba(16, 185, 129, 0.1);
  --nav-hover-bg: rgba(16, 185, 129, 0.05);

  --alert-info-bg: rgba(59, 130, 246, 0.1);
  --alert-info-border: #3b82f6;
  --alert-warning-bg: rgba(245, 158, 11, 0.1);
  --alert-warning-border: #f59e0b;
  --alert-danger-bg: rgba(239, 68, 68, 0.1);
  --alert-danger-border: #ef4444;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
}

[data-theme="dark"] {
  /* Dark theme colors */
  --bg-primary: #23272f;
  --bg-secondary: #1c1e24;
  --bg-tertiary: #16181d;
  --bg-elevated: #2d333b;

  --text-primary: #f7f7f7;
  --text-secondary: #99a1b3;
  --text-tertiary: #6d7280;
  --text-link: #34d399;
  --text-link-hover: #10b981;

  --border-color: #343a46;
  --border-subtle: #2d333b;

  --accent-primary: #34d399;
  --accent-secondary: #10b981;
  --accent-tertiary: #059669;

  --code-bg: #1c1e24;
  --code-text: #d6deeb;

  --nav-active-bg: rgba(52, 211, 153, 0.1);
  --nav-hover-bg: rgba(52, 211, 153, 0.05);

  --alert-info-bg: rgba(59, 130, 246, 0.15);
  --alert-info-border: #3b82f6;
  --alert-warning-bg: rgba(245, 158, 11, 0.15);
  --alert-warning-border: #f59e0b;
  --alert-danger-bg: rgba(239, 68, 68, 0.15);
  --alert-danger-border: #ef4444;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
}

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

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== Links ===== */

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

a:hover {
  color: var(--text-link-hover);
  text-decoration: underline;
  text-decoration-color: var(--accent-tertiary);
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}

/* ===== Lists ===== */

ul, ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ===== Top Navigation ===== */

.top-nav {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  height: 60px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-content {
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  transition: color 0.2s ease;
}

.logo-text {
  font-size: 1.25rem;
  color: var(--accent-primary);
  font-weight: 700;
}

.logo-subtext {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.logo:hover {
  text-decoration: none;  
}

.logo:hover .logo-text {
  color: var(--accent-secondary);
}

/* Theme Toggle Button */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background-color: var(--nav-hover-bg);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.theme-toggle .sun-icon {
  display: none;
}

.theme-toggle .moon-icon {
  display: block;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  display: none;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 8px;
  transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
  background-color: var(--nav-hover-bg);
  border-color: var(--accent-primary);
}

.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--text-secondary);
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover span {
  background-color: var(--accent-primary);
}

/* ===== Main Container ===== */

.main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ===== Sidebar Navigation ===== */

.sidebar {
  width: 280px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.sidebar-content {
  padding: 1.5rem 0;
}

.nav-section {
  margin-bottom: 2rem;
}

.nav-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  padding: 0 1.5rem;
  margin-bottom: 0.5rem;
}

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

.nav-item {
  margin: 0;
}

.nav-link {
  display: block;
  padding: 0.5rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  text-decoration-color: var(--accent-tertiary);
  font-size: 0.9375rem;
  line-height: 1.5;
  transition: all 0.2s ease;
  border-left: 2px solid transparent;
}

.nav-link:hover {
  color: var(--text-primary);
  background-color: var(--nav-hover-bg);
  border-left-color: var(--accent-primary);
}

.nav-link.active {
  color: var(--accent-primary);
  background-color: var(--nav-active-bg);
  border-left-color: var(--accent-primary);
  font-weight: 500;
}

.nav-item-nested .nav-link {
  padding-left: 2.5rem;
  font-size: 0.875rem;
}

/* ===== Main Content Area ===== */

.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--bg-primary);
  transition: background-color 0.3s ease;
  display: flex;
  flex-direction: column;
}

.content-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem;
  flex: 1;
}

/* ===== Footer ===== */

.doc-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
  padding: 3rem 0 2rem;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.footer-section a:hover {
  color: var(--accent-primary);
  text-decoration: none;
}

.footer-bottom {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 2rem 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer-bottom p {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin: 0;
}

/* ===== Table of Contents Sidebar (Right) ===== */

.toc-sidebar {
  width: 260px;
  background-color: var(--bg-primary);
  border-left: 1px solid var(--border-color);
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  display: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.toc-nav {
  padding: 2rem 1.25rem;
  position: sticky;
  top: 0;
}

.toc-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
  padding: 0 0.5rem;
}

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

.toc-item {
  margin: 0;
}

.toc-item-nested {
  padding-left: 1rem;
}

.toc-link {
  display: block;
  padding: 0.375rem 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.4;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.toc-link:hover {
  color: var(--text-primary);
  background-color: var(--nav-hover-bg);
  text-decoration: none;
  border-left-color: var(--accent-primary);
}

.toc-link.active {
  color: var(--accent-primary);
  background-color: var(--nav-active-bg);
  border-left-color: var(--accent-primary);
  font-weight: 500;
}

/* Adjust main container for three-column layout */
@media (min-width: 1400px) {
  .toc-sidebar {
    display: block;
  }
}

@media (min-width: 1200px) and (max-width: 1399px) {
  .toc-sidebar {
    width: 220px;
  }

  .toc-nav {
    padding: 1.5rem 1rem;
  }
}

/* ===== Typography ===== */

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

h5 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

h6 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

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

.lead {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* ===== Code Blocks ===== */

code {
  background-color: var(--code-bg);
  color: var(--code-text);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.875em;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  border: 1px solid var(--border-subtle);
}

pre {
  background-color: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

pre code {
  background-color: transparent;
  padding: 0;
  border: none;
  font-size: 0.875rem;
}

/* ===== Tables ===== */

table {
  width: 100%;
  margin-bottom: 2rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  overflow: hidden;
}

thead {
  background-color: var(--bg-elevated);
}

th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
}

td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background-color: var(--nav-hover-bg);
}

/* ===== Alert Boxes ===== */

.alert {
  border-left: 4px solid;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.alert strong {
  font-weight: 600;
  display: block;
  margin-bottom: 0.25rem;
}

.alert-info {
  background-color: var(--alert-info-bg);
  border-left-color: var(--alert-info-border);
  color: var(--text-secondary);
}

.alert-info strong {
  color: var(--alert-info-border);
}

.alert-warning {
  background-color: var(--alert-warning-bg);
  border-left-color: var(--alert-warning-border);
  color: var(--text-secondary);
}

.alert-warning strong {
  color: var(--alert-warning-border);
}

.alert-danger {
  background-color: var(--alert-danger-bg);
  border-left-color: var(--alert-danger-border);
  color: var(--text-secondary);
}

.alert-danger strong {
  color: var(--alert-danger-border);
}

/* ===== Feature Cards ===== */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.feature-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.2s ease;
  display: block;
  text-decoration: none;
  cursor: pointer;
}

.feature-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.feature-card h3 {
  margin-top: 0;
  color: var(--accent-primary);
  font-size: 1.25rem;
}

.feature-card:hover h3 {
  color: var(--accent-secondary);
}

.feature-card p {
  margin-bottom: 0;
  color: var(--text-secondary);
}

/* ===== Search Box (Placeholder) ===== */

.search-box {
  position: relative;
  margin-bottom: 2rem;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--nav-active-bg);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

/* ===== Scrollbar Styling ===== */

.sidebar::-webkit-scrollbar,
.main-content::-webkit-scrollbar,
.toc-sidebar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.sidebar::-webkit-scrollbar-track,
.main-content::-webkit-scrollbar-track,
.toc-sidebar::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.sidebar::-webkit-scrollbar-thumb,
.main-content::-webkit-scrollbar-thumb,
.toc-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.main-content::-webkit-scrollbar-thumb:hover,
.toc-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ===== Responsive Design ===== */

@media (max-width: 1199px) {
  .toc-sidebar {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .sidebar {
    position: fixed;
    left: -280px;
    top: 60px;
    bottom: 0;
    z-index: 50;
    transition: left 0.3s ease;
  }

  .sidebar.open {
    left: 0;
  }

  .content-wrapper {
    padding: 2rem 1rem;
  }

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

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .nav-content {
    padding: 0 1rem;
  }

  .logo-text {
    font-size: 1.125rem;
  }

  .logo-subtext {
    display: none;
  }

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

  h1 {
    font-size: 1.75rem;
  }

  .content-wrapper {
    padding: 1.5rem 1rem;
  }
}
