/* Professional theme centered around #0D5257 */
:root {
  --primary-color: #0d5257;
  --primary-dark: #092e32;
  --primary-light: #157a82;
  --primary-lighter: #e8f4f5;
  --accent-color: #d8262c;
  --text-dark: #2c3e50;
  --text-medium: #5a6c7d;
  --text-light: #8695a8;
  --bg-white: #ffffff;
  --bg-light: #f8f9fa;
  --bg-lighter: #fafbfc;
  --border-color: #e1e4e8;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

html {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  color: var(--text-dark);
  background-color: var(--bg-lighter);
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  font-size: 16px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

main {
  margin: 0 auto;
  padding: 30px 20px;
  background-color: var(--bg-white);
  min-height: calc(100vh - 220px);
  box-shadow: var(--shadow-sm);
}

/* Header Styling */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--primary-color);
  color: var(--bg-white);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  padding: 0;
}

.header-content {
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  gap: 20px;
}

.header-title {
  display: flex;
  align-items: center;
  color: var(--bg-white);
  text-decoration: none;
  font-size: 22px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-title:hover {
  color: var(--bg-white);
  text-decoration: none;
  opacity: 0.9;
}

.header-title img {
  width: 32px;
  height: 32px;
  margin-right: 12px;
  vertical-align: middle;
}

/* Search Container */
.search-container {
  position: relative;
  flex: 1;
  max-width: 500px;
  display: flex;
  align-items: center;
}

#searchInput {
  width: 100%;
  padding: 10px 40px 10px 16px;
  border: 2px solid transparent;
  border-radius: 6px;
  font-size: 15px;
  font-family: var(--font-family);
  background-color: rgba(255, 255, 255, 0.95);
  color: var(--text-dark);
  transition: all 0.2s ease;
  outline: none;
}

#searchInput:focus {
  border-color: var(--primary-light);
  background-color: var(--bg-white);
  box-shadow: 0 0 0 3px rgba(13, 82, 87, 0.1);
}

#searchInput::placeholder {
  color: var(--text-light);
}

.clear-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-medium);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.clear-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--text-dark);
}

/* Domain Navigation Bar */
.domain-nav {
  position: fixed;
  top: 74px;
  left: 0;
  right: 0;
  background-color: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  z-index: 999;
  box-shadow: var(--shadow-sm);
}

.nav-content {
  margin: 0 auto;
  display: flex;
  overflow-x: auto;
  padding: 0 20px;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.nav-content::-webkit-scrollbar {
  height: 4px;
}

.nav-content::-webkit-scrollbar-track {
  background: transparent;
}

.nav-content::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 2px;
}

.nav-link {
  display: inline-block;
  padding: 12px 16px;
  color: var(--text-medium);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-link:hover {
  color: var(--primary-color);
  background-color: var(--primary-lighter);
}

.nav-link.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  font-weight: 600;
}

/* General link styling */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Main content area */
#main-content {
  padding-top: 142px;
}

/* Content sections */
.content-section {
  margin-bottom: 40px;
}

.error-codes-section {
  margin-top: 50px;
  padding-top: 40px;
  border-top: 3px solid var(--primary-color);
  background: linear-gradient(to bottom, var(--primary-lighter) 0%, var(--bg-white) 100px);
  padding: 40px 30px 40px;
  margin-left: -20px;
  margin-right: -20px;
  border-radius: 8px;
}

.error-codes-section h2 {
  color: var(--primary-dark);
}

@media (max-width: 768px) {
  .error-codes-section {
    padding: 30px 15px 30px;
    margin-left: -15px;
    margin-right: -15px;
  }
  
  .content-section {
    margin-bottom: 30px;
  }
}

/* Markdown body styling */
.markdown-body,
.md-html {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-dark);
}

.markdown-body h1,
.md-html h1 {
  color: var(--primary-color);
  font-size: 32px;
  font-weight: 700;
  margin-top: 30px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
  line-height: 1.3;
}

.markdown-body h2,
.md-html h2 {
  color: var(--primary-color);
  font-size: 26px;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  line-height: 1.35;
}

.markdown-body h3,
.md-html h3 {
  color: var(--primary-dark);
  font-size: 20px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 12px;
  line-height: 1.4;
}

.markdown-body p,
.md-html p {
  margin-bottom: 16px;
  line-height: 1.7;
}

.markdown-body ul,
.markdown-body ol,
.md-html ul,
.md-html ol {
  margin-bottom: 16px;
  padding-left: 28px;
}

.markdown-body li,
.md-html li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.markdown-body code,
.md-html code {
  background-color: var(--bg-light);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--primary-dark);
  border: 1px solid var(--border-color);
}

.markdown-body pre,
.md-html pre {
  background-color: var(--bg-light);
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.markdown-body pre code,
.md-html pre code {
  background: none;
  border: none;
  padding: 0;
}

.markdown-body table,
.md-html table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 20px;
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.markdown-body th,
.md-html th {
  background-color: var(--primary-lighter);
  color: var(--primary-dark);
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--primary-color);
}

.markdown-body td,
.md-html td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.markdown-body tr:last-child td,
.md-html tr:last-child td {
  border-bottom: none;
}

.markdown-body tr:hover,
.md-html tr:hover {
  background-color: var(--bg-lighter);
}

/* Search highlight */
.search-highlight {
  background-color: #fff3cd;
  padding: 2px 4px;
  border-radius: 2px;
  font-weight: 500;
}

.search-no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-medium);
  font-size: 18px;
}

.search-no-results p {
  margin: 10px 0;
}

/* Hide items that don't match search */
.search-hidden {
  display: none !important;
}

/* Footer styling */
.footer {
  background-color: var(--bg-light);
  color: var(--text-medium);
  text-align: center;
  padding: 24px 20px;
  border-top: 1px solid var(--border-color);
  font-size: 14px;
}

.footer p {
  margin: 0;
  line-height: 1.6;
}

.footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 15px;
  }

  .header-title {
    font-size: 18px;
    justify-content: center;
  }

  .header-title img {
    width: 28px;
    height: 28px;
    margin-right: 10px;
  }

  .search-container {
    max-width: 100%;
  }

  #searchInput {
    font-size: 14px;
    padding: 9px 36px 9px 14px;
  }

  .domain-nav {
    top: auto;
    position: sticky;
  }

  #main-content {
    padding-top: 20px;
  }

  main {
    padding: 20px 15px;
    min-height: calc(100vh - 180px);
  }

  .nav-content {
    padding: 0 15px;
  }

  .nav-link {
    padding: 10px 12px;
    font-size: 13px;
  }

  .markdown-body h1,
  .md-html h1 {
    font-size: 26px;
  }

  .markdown-body h2,
  .md-html h2 {
    font-size: 22px;
  }

  .markdown-body h3,
  .md-html h3 {
    font-size: 18px;
  }

  .markdown-body table,
  .md-html table {
    font-size: 14px;
  }

  .markdown-body th,
  .markdown-body td,
  .md-html th,
  .md-html td {
    padding: 10px 12px;
  }
}

@media (max-width: 480px) {
  .header-title {
    font-size: 16px;
  }

  .header-title span {
    font-size: 14px;
  }

  .nav-link {
    padding: 10px;
    font-size: 12px;
  }
}
