/* Global font settings */
:root {
  --primary-color: #2E7D32;
  --primary-dark: #1B5E20;
  --primary-light: #4CAF50;
  --secondary-color: #558B2F;
  --accent-color: #00ACC1;
  --text-dark: #212529;
  --text-light: #6c757d;
  --bg-light: #f8f9fa;
  --border-color: #dee2e6;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.7;
  color: var(--text-dark);
  font-size: 16px;
  background-color: #ffffff;
}

/* Container width adjustment */
.container, .container-fluid {
  max-width: 1400px !important;
  padding-left: 2rem;
  padding-right: 2rem;
}

@media (min-width: 1200px) {
  .container {
    max-width: 1320px !important;
  }
}

/* Typography improvements */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  border-bottom: 3px solid var(--primary-light);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-top: 2.5rem;
}

h3 {
  font-size: 1.5rem;
  color: var(--secondary-color);
}

p {
  margin-bottom: 1.2rem;
}

/* Code styling */
code, pre {
  font-family: 'JetBrains Mono', 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.9em;
}

/* Navigation bar - clean design */
.navbar {
  background: white !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  padding: 1.2rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 3px solid var(--primary-light);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--primary-dark) !important;
}

.navbar-nav .nav-link {
  color: var(--text-dark) !important;
  font-weight: 500;
  font-size: 1.05rem;
  transition: all 0.3s ease;
  padding: 0.75rem 1.25rem !important;
  margin: 0 0.25rem;
  border-radius: 0.5rem;
  position: relative;
}

.navbar-nav .nav-link:hover {
  background-color: var(--primary-light);
  color: white !important;
  transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
  background-color: var(--primary-color);
  color: white !important;
}

/* Homepage - remove hero section, keep it clean */
.page-header {
  display: none !important;
}

.template-home .page-header {
  display: none !important;
}

/* Clean homepage title styling */
.template-home h1 {
  color: var(--primary-dark);
  font-size: 2.5rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-bottom: 3px solid var(--primary-light);
  padding-bottom: 0.5rem;
}

/* Main content area */
main {
  padding: 2rem 0;
  min-height: calc(100vh - 200px);
}

.row {
  margin-left: -1rem;
  margin-right: -1rem;
}

.col, [class*="col-"] {
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Card styling improvements */
.card {
  border: none;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 2rem;
  background: white;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.card-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-bottom: 3px solid var(--primary-light);
  font-weight: 600;
  font-size: 1.1rem;
  padding: 1rem 1.5rem;
}

.card-body {
  padding: 1.5rem;
}

/* Code block enhancement */
pre {
  background-color: #f6f8fa;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin: 1.5rem 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  position: relative;
  overflow-x: auto;
}

pre code {
  background-color: transparent;
  padding: 0;
  color: #24292e;
}

/* Inline code */
code:not(pre code) {
  background-color: #e9f5e9;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  color: var(--primary-dark);
  font-size: 0.9em;
  font-weight: 500;
}

/* Button enhancement */
.btn {
  border-radius: 0.5rem;
  padding: 0.75rem 2rem;
  font-weight: 500;
  font-size: 1.05rem;
  transition: all 0.3s ease;
  text-transform: none;
  letter-spacing: 0.025rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
  border: none;
  box-shadow: 0 3px 10px rgba(46, 125, 50, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0d3e10 0%, var(--primary-color) 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(46, 125, 50, 0.4);
}

/* Sidebar enhancement */
.sidebar, .toc {
  background-color: #fafafa;
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.sidebar .nav-link, .toc .nav-link {
  color: var(--text-light);
  padding: 0.625rem 1rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.sidebar .nav-link:hover, .toc .nav-link:hover {
  background-color: #e8f5e9;
  color: var(--primary-color);
  transform: translateX(3px);
  text-decoration: none;
}

.sidebar .nav-link.active, .toc .nav-link.active {
  background-color: var(--primary-light);
  color: white;
  font-weight: 600;
}

/* Table enhancement */
.table {
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border-radius: 0.75rem;
  overflow: hidden;
  margin: 2rem 0;
}

.table thead {
  background: linear-gradient(135deg, #f1f3f4 0%, #ffffff 100%);
}

.table thead th {
  border-bottom: 3px solid var(--primary-light);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
  padding: 1rem;
  color: var(--primary-dark);
}

.table td {
  padding: 0.875rem 1rem;
}

/* Search box enhancement */
.form-control {
  border-radius: 0.5rem;
  border: 2px solid var(--border-color);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.15);
  outline: none;
}

/* Footer enhancement */
footer {
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  color: #6c757d;
  padding: 2.5rem 0 2rem;
  margin-top: 4rem;
  font-size: 0.9rem;
}

footer .container {
  max-width: 1200px;
  margin: 0 auto;
}

footer .pkgdown-footer {
  text-align: center;
}

footer .pkgdown-footer-left {
  text-align: center;
  margin-bottom: 1rem;
}

footer .pkgdown-footer-right {
  text-align: center;
}

footer a {
  color: var(--primary-color);
  transition: all 0.3s ease;
  text-decoration: none;
  font-weight: 500;
}

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

/* Footer text styling */
footer p {
  margin: 0.5rem 0;
  line-height: 1.6;
}

/* Make footer links more prominent */
footer .pkgdown {
  color: #6c757d;
}

footer .pkgdown a {
  color: var(--primary-color);
  font-weight: 600;
}

/* Reference page improvements */
.ref-index section {
  margin-bottom: 3rem;
}

.ref-index h2 {
  color: var(--primary-color);
  border-bottom: 3px solid var(--primary-light);
  padding-bottom: 0.75rem;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
}

.ref-index .ref-items {
  list-style: none;
  padding-left: 0;
}

.ref-index .ref-items li {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s ease;
}

.ref-index .ref-items li:hover {
  background-color: var(--bg-light);
}

.ref-index .ref-items li:last-child {
  border-bottom: none;
}

/* Function arguments styling */
.ref-arguments dt {
  font-weight: 600;
  color: var(--primary-color);
  margin-top: 1.5rem;
  font-size: 1.05rem;
}

.ref-arguments dd {
  margin-left: 2rem;
  margin-bottom: 1rem;
  color: var(--text-light);
}

/* Example code sections */
.ref-examples {
  background-color: var(--bg-light);
  padding: 2rem;
  border-radius: 0.75rem;
  margin-top: 2rem;
  border-left: 4px solid var(--primary-light);
}

.ref-examples h3 {
  margin-top: 0;
}

/* Homepage features grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.feature {
  text-align: center;
  padding: 2rem;
}

.feature-icon {
  font-size: 3rem;
  color: var(--primary-light);
  margin-bottom: 1rem;
}

.feature h3 {
  color: var(--primary-dark);
  margin-bottom: 1rem;
}

/* Badges and labels */
.badge {
  padding: 0.375rem 0.75rem;
  font-weight: 500;
  border-radius: 2rem;
  font-size: 0.875rem;
}

.badge-primary {
  background-color: var(--primary-light);
  color: white;
}

.badge-secondary {
  background-color: var(--secondary-color);
  color: white;
}

/* Alert boxes */
.alert {
  border-radius: 0.75rem;
  border: none;
  padding: 1.25rem;
  margin: 2rem 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.alert-info {
  background-color: #E3F2FD;
  color: #0D47A1;
  border-left: 4px solid #2196F3;
}

.alert-success {
  background-color: #E8F5E9;
  color: var(--primary-dark);
  border-left: 4px solid var(--primary-light);
}

/* Copy button for code blocks */
.copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  opacity: 0;
  transition: opacity 0.3s;
  cursor: pointer;
}

pre:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  background-color: var(--primary-light);
  color: white;
  border-color: var(--primary-light);
}

/* Responsive improvements */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .page-header h1 {
    font-size: 2.5rem;
  }
  
  .navbar-brand {
    font-size: 1.5rem;
  }
  
  .sidebar {
    position: relative;
    top: 0;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
}

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

/* Loading animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Version label */
.version {
  display: inline-block;
  background-color: var(--primary-light);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  margin-left: 1rem;
}

/* Improve spacing */
section {
  margin-bottom: 3rem;
}

.contents > * {
  margin-bottom: 1.5rem;
}

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

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

/* Make content more readable */
.contents {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
}

@media (min-width: 1400px) {
  .row > .contents {
    max-width: 100%;
  }
}

/* Article styling */
.template-article .contents {
  font-size: 1.1rem;
  line-height: 1.8;
}

.template-article h1 {
  color: var(--primary-dark);
  margin-bottom: 2rem;
}

/* Improve list styling */
ul, ol {
  margin-bottom: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

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