/* docs/_themes/custom.css - enhanced polish */
:root {
  --primary-color: #0b2240;
  --secondary-color: #1e4a7f;
  --accent-color: #2563eb;
  --text-color: #334155;
  --light-gray: #f8fafc;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
  --transition: all 0.2s ease-in-out;
}

/* Base styles */
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #ffffffff;
}

/* Header enhancements */
header {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: var(--transition);
}

header:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Main content area */
.main {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 24px;
  animation: fadeIn 0.5s ease-out;
}

/* Link styles */
a {
  text-decoration: none;
  color: var(--accent-color);
  transition: var(--transition);
  border-bottom: 1px solid transparent;
}

a:hover {
  color: var(--secondary-color);
  border-bottom-color: var(--accent-color);
}

/* Heading styles */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary-color);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: 0;
}

h2 {
  font-size: 2rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.5rem;
}

/* Code blocks */
pre, code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  background: var(--light-gray);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

code {
  padding: 0.2em 0.4em;
  font-size: 0.9em;
}

pre {
  padding: 1.5rem;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

pre code {
  background: none;
  border: none;
  padding: 0;
}

/* Loading state */
body:not(.ready) {
  overflow: auto;
  opacity: 0;
}

body.ready {
  opacity: 1;
  transition: opacity 0.3s ease-in;
}

/* Table styles */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
  border-radius: var(--border-radius);
  overflow: hidden;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: var(--light-gray);
  font-weight: 600;
  color: var(--primary-color);
}

tr:hover {
  background: #ecf0f0;
}

/* Blockquotes */
blockquote {
  border-left: 4px solid var(--accent-color);
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: var(--light-gray);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  font-style: italic;
}

/* Lists */
ul, ol {
  padding-left: 1.5rem;
}

li {
  margin: 0.5rem 0;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
}

/* Responsive design */
@media (max-width: 768px) {
  .main {
    margin: 16px auto;
    padding: 0 16px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  pre {
    padding: 1rem;
    margin: 1rem -16px;
    border-radius: 0;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Focus styles for accessibility */
a:focus,
button:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Selection color */
::selection {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-color);
}
