/* Import Source font family */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;600;700&family=Source+Serif+Pro:wght@400;600&family=Source+Code+Pro:wght@400;500&display=swap');

/* Modern CSS Reset and improved base styles
-------------------------------------------------- */

* {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #1f2937;
  background-color: #ffffff;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Modern flexbox layout instead of negative margins */
#wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
}

/* Modern footer */
#footer {
  background-color: #f8fafc;
  border-top: 1px solid #e5e7eb;
  padding: 2rem 0;
  margin-top: auto;
}

/* Responsive improvements */
@media (max-width: 768px) {
  #footer {
    padding: 1.5rem 1rem;
  }
}

/* Container improvements */
#wrap > .container {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.container .credit {
  margin: 1.5rem 0;
  color: #6b7280;
  font-size: 0.875rem;
}

/* Modern alert/banner styling */
.help-banner {
  display: inline-block;
  text-align: center;
  border-radius: 0.75rem;
  border: 2px solid #2563eb;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white !important;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  transition: all 0.2s ease;
}

.help-banner:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  color: white !important;
  text-decoration: none;
}

/* Improved typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: #111827;
  margin-bottom: 1rem;
  margin-top: 2rem;
}

h1:first-child,
h2:first-child,
h3:first-child {
  margin-top: 0;
}

p {
  margin-bottom: 1.25rem;
  line-height: 1.7;
  font-size: 1.125rem;
  text-align: justify;
  color: #374151;
}

/* Modern link styling */
a {
  color: #2563eb;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Improved code styling */
code {
  font-family: 'Source Code Pro', 'SF Mono', Monaco, Inconsolata, 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 0.875em;
  color: #dc2626;
  background-color: #fef2f2;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  border: 1px solid #fecaca;
}

pre {
  background-color: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

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

/* Modern image improvements */
img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

/* Modern table styling */
table {
  border-collapse: collapse;
  margin: 2rem 0;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  border-radius: 0.5rem;
  overflow: hidden;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

th {
  background-color: #f8fafc;
  font-weight: 600;
  color: #111827;
}

tr:hover {
  background-color: #f1f5f9;
}

/* Modern blockquote */
blockquote {
  border-left: 4px solid #2563eb;
  background-color: #f1f5f9;
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: italic;
}

blockquote p {
  margin-bottom: 0;
  color: #374151;
}

/* Focus improvements for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  body {
    color: #f9fafb;
    background-color: #111827;
  }
  
  h1, h2, h3, h4, h5, h6 {
    color: #f9fafb;
  }
  
  p {
    color: #d1d5db;
  }
  
  #footer {
    background-color: #1f2937;
    border-top-color: #374151;
  }
  
  .container .credit {
    color: #9ca3af;
  }
  
  code {
    color: #f87171;
    background-color: #451a03;
    border-color: #92400e;
  }
  
  pre {
    background-color: #1f2937;
    border-color: #374151;
  }
  
  pre code {
    color: #d1d5db;
  }
  
  th {
    background-color: #374151;
    color: #f9fafb;
  }
  
  td {
    border-bottom-color: #4b5563;
  }
  
  tr:hover {
    background-color: #374151;
  }
  
  blockquote {
    background-color: #374151;
  }
  
  blockquote p {
    color: #d1d5db;
  }
}

/* Print styles */
@media print {
  .help-banner {
    background: #000 !important;
    color: #fff !important;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
}
