/*
 * Pingdex HelpScout Docs Custom Stylesheet
 * A modern, clean design for help.pingdex.app
 *
 * To use: Upload this file to HelpScout Docs
 * Manage > Docs > [Your Site] > Custom Code > External CSS
 */

/* ============================================
   CSS Variables & Base Styles
   ============================================ */
:root {
  --primary: #3a0ca3;
  --primary-light: #5a2fd4;
  --primary-dark: #2a0878;
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  --success: #10b981;
  --warning: #f59e0b;
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --bg-white: #ffffff;
  --bg-light: #f9fafb;
  --bg-subtle: #f3f4f6;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
}

/* Base body styling */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-white) 100%);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Navigation Bar
   ============================================ */
.navbar .navbar-inner {
  background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
  border: none;
  box-shadow: none;
  padding: 12px 0;
  border-radius: 0;
}

.navbar .brand {
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  transition: opacity var(--transition-fast);
}

.navbar .brand:hover {
  opacity: 0.9;
}

.navbar .nav li a {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.navbar .nav li a:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

/* ============================================
   Search Section
   ============================================ */
#docsSearch {
  background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 60%, var(--primary-light) 100%);
  padding: 80px 20px 90px;
  position: relative;
  overflow: hidden;
}

#docsSearch::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

#docsSearch h1 {
  color: #ffffff;
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 30px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 1;
}

#searchBar {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}

#searchBar .search-query {
  width: 100%;
  padding: 18px 24px;
  padding-right: 60px;
  font-size: 1.1rem;
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), 0 0 0 4px rgba(255, 255, 255, 0.2);
  transition: all var(--transition-normal);
  background: var(--bg-white);
  color: var(--text-primary);
}

#searchBar .search-query:focus {
  outline: none;
  box-shadow: var(--shadow-xl), 0 0 0 4px rgba(255, 255, 255, 0.4);
  transform: scale(1.02);
}

#searchBar .search-query::placeholder {
  color: var(--text-muted);
}

#searchBar button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 500;
}

#searchBar button:hover {
  background: var(--bg-subtle);
  color: var(--primary);
  transform: translateY(-50%);
}

/* ============================================
   Content Wrapper & Layout
   ============================================ */
.contentWrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 50px 24px 80px;
}

/* Popular Articles Section */
.contentWrapper h2,
.contentWrapper h3 {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.contentWrapper h2 {
  font-size: 1.75rem;
}

/* Article Links */
.popularArticles li,
.category-list .category ul li {
  margin-bottom: 8px;
}

.popularArticles a,
.category-list .category ul li a,
#fullArticle a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition-fast);
  border-bottom: 2px solid transparent;
}

.popularArticles a:hover,
.category-list .category ul li a:hover,
#fullArticle a:hover {
  color: var(--primary-dark);
  border-bottom-color: var(--accent-light);
}

/* ============================================
   Category Cards
   ============================================ */
.category-list,
.twoCol,
.threeCol {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

.category-list .category,
.twoCol .collection,
.threeCol .collection {
  flex: 0 1 calc(50% - 12px);
  max-width: 450px;
  margin-bottom: 0;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.category-list .category::before,
.twoCol .collection::before,
.threeCol .collection::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.category-list .category:hover,
.twoCol .collection:hover,
.threeCol .collection:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-light);
}

.category-list .category:hover::before,
.twoCol .collection:hover::before,
.threeCol .collection:hover::before {
  opacity: 1;
}

.category-list .category h4,
.collection h4 {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-list .category h4 a,
.collection h4 a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.category-list .category h4 a:hover,
.collection h4 a:hover {
  color: var(--primary);
}

/* ============================================
   Full Article Page
   ============================================ */
#fullArticle {
  background: var(--bg-white);
  padding: 48px 56px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  max-width: 900px;
  margin: 40px auto;
}

#fullArticle h1 {
  color: var(--text-primary);
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
  line-height: 1.3;
  border-bottom: 3px solid var(--accent-light);
  padding-bottom: 20px;
}

#fullArticle h2 {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

#fullArticle h3 {
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 16px;
}

#fullArticle h4 {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 14px;
}

#fullArticle p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 20px;
}

#fullArticle ul,
#fullArticle ol {
  margin-bottom: 24px;
  padding-left: 24px;
}

#fullArticle li {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 10px;
  position: relative;
}

#fullArticle ul li::marker {
  color: var(--primary);
}

#fullArticle ol li::marker {
  color: var(--primary);
  font-weight: 600;
}

#fullArticle strong,
#fullArticle b {
  color: var(--text-primary);
  font-weight: 600;
}

#fullArticle hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, var(--border-color) 0%, var(--accent-light) 50%, var(--border-color) 100%);
  margin: 40px 0;
  border-radius: 1px;
}

/* Images in articles */
#fullArticle img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin: 24px 0;
  border: 1px solid var(--border-color);
}

/* Code blocks */
#fullArticle code {
  background: var(--bg-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.9em;
  color: var(--primary-dark);
}

#fullArticle pre {
  background: var(--text-primary);
  color: #e5e7eb;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 24px 0;
}

#fullArticle pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* Blockquotes */
#fullArticle blockquote {
  border-left: 4px solid var(--accent);
  background: var(--bg-light);
  padding: 20px 24px;
  margin: 24px 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

#fullArticle blockquote p {
  margin-bottom: 0;
  font-style: italic;
  color: var(--text-secondary);
}

/* Tables */
#fullArticle table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

#fullArticle th {
  background: var(--primary);
  color: white;
  padding: 14px 18px;
  text-align: left;
  font-weight: 600;
}

#fullArticle td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
}

#fullArticle tr:nth-child(even) {
  background: var(--bg-light);
}

#fullArticle tr:hover {
  background: var(--bg-subtle);
}

/* Article footer */
.articleFoot {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.articleFoot time.lu {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* ============================================
   Sidebar & Related Articles
   ============================================ */
.relatedArticles {
  background: var(--bg-light);
  padding: 24px;
  border-radius: var(--radius-md);
  margin-top: 32px;
}

.relatedArticles h4 {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   Breadcrumbs
   ============================================ */
.breadcrumb {
  background: transparent;
  padding: 16px 0;
  margin-bottom: 0;
  font-size: 0.9rem;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

.breadcrumb .divider {
  color: var(--border-color);
  margin: 0 10px;
}

.breadcrumb .active {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============================================
   Footer
   ============================================ */
footer {
  background: var(--text-primary);
  color: rgba(255, 255, 255, 0.7);
  padding: 40px 24px;
  text-align: center;
  margin-top: 60px;
}

footer a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: color var(--transition-fast);
}

footer a:hover {
  color: var(--accent-light);
}

/* ============================================
   Animations & Micro-interactions
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.contentWrapper,
#fullArticle {
  animation: fadeInUp 0.5s ease-out;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
  #docsSearch {
    padding: 50px 16px 60px;
  }

  #docsSearch h1 {
    font-size: 1.75rem;
  }

  #searchBar .search-query {
    padding: 14px 20px;
    padding-right: 55px;
    font-size: 1rem;
  }

  .contentWrapper {
    padding: 30px 16px 50px;
  }

  #fullArticle {
    padding: 28px 24px;
    margin: 20px 12px;
    border-radius: var(--radius-md);
  }

  #fullArticle h1 {
    font-size: 1.75rem;
  }

  #fullArticle h2 {
    font-size: 1.3rem;
  }

  .category-list .category,
  .twoCol .collection,
  .threeCol .collection {
    padding: 20px;
    margin-bottom: 0;
    flex: 0 1 100%;
    max-width: 100%;
  }

  .category-list,
  .twoCol,
  .threeCol {
    gap: 16px;
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .navbar,
  #docsSearch,
  footer,
  .relatedArticles {
    display: none;
  }

  #fullArticle {
    box-shadow: none;
    border: none;
    padding: 0;
  }

  body {
    background: white;
  }
}

/* ============================================
   Accessibility Improvements
   ============================================ */
*:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
