/* Custom CSS to extend Tailwind */

/* Global styles */
body {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  color: #111827;
  background-color: #f9fafb;
  overflow-x: hidden;
}

body.dark {
  color: #e5e7eb;
  background-color: #111827;
}

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

/* Link styles with better contrast */
a {
  color: #1d4ed8; /* Darker blue for better contrast */
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

a:hover {
  color: #1e40af; /* Even darker on hover for better contrast */
}

.dark a {
  color: #60a5fa; /* Lighter blue in dark mode for better contrast */
}

.dark a:hover {
  color: #93c5fd; /* Even lighter on hover in dark mode */
}

/* GitHub error banner */
#github-error-banner {
  display: none;
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: auto;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  background: #FEE2E2;
  color: #B91C1C;
  text-align: center;
  z-index: 1001;
}

#github-error-banner .github-error-close {
  position: absolute;
  top: 0.25rem;
  right: 0.5rem;
  background: transparent;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: inherit;
}

#github-error-banner a {
  text-decoration: underline;
}

/* Button contrast improvements */
.btn-primary {
  background-color: #1d4ed8 !important; /* Darker blue for better contrast */
  color: white !important;
}

.btn-primary:hover {
  background-color: #1e40af !important; /* Even darker on hover */
}

.dark .btn-primary {
  background-color: #3b82f6 !important; /* Lighter in dark mode */
  color: #111827 !important; /* Dark text on light button for contrast */
}

.dark .btn-primary:hover {
  background-color: #60a5fa !important; /* Even lighter on hover */
}

/* High contrast text alternatives */
.text-high-contrast {
  color: #111827 !important; /* Near black for light mode */
}

.dark .text-high-contrast {
  color: #f9fafb !important; /* Near white for dark mode */
}

.text-high-contrast-muted {
  color: #374151 !important; /* Darker gray for light mode */
}

.dark .text-high-contrast-muted {
  color: #d1d5db !important; /* Lighter gray for dark mode */
}

/* Accessibility helpers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus indicators for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.dark a:focus,
.dark button:focus,
.dark input:focus,
.dark select:focus,
.dark textarea:focus {
  outline: 2px solid #60a5fa;
}

/* Skip to main content link - hidden until focused */
.skip-to-content {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.5rem 1rem;
  background-color: #1d4ed8;
  color: white;
  z-index: 999;
  transform: translateY(-100%);
  transition: transform 0.3s;
}

.skip-to-content:focus {
  transform: translateY(0);
}

/* ARIA live region styling */
[aria-live="polite"],
[aria-live="assertive"] {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  width: auto;
}

/* Make visually hidden elements visible when they have a visible class */
[aria-live="polite"].visible,
[aria-live="assertive"].visible {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  width: auto;
}

/* Custom utility classes */
.transition-all {
  transition: all 0.3s ease;
}

/* Link animations */
a {
  position: relative;
}

a.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: #60a5fa; /* Changed from currentColor to a light blue */
  transition: width 0.3s ease;
}

a.nav-link:hover::after {
  width: 100%;
}

/* Add hover text color change for better visibility */
a.nav-link:hover {
  color: #60a5fa !important; /* Light blue that's visible on dark backgrounds */
}

.dark a.nav-link::after {
  background-color: #60a5fa; /* Light blue for dark mode */
}

.dark a.nav-link:hover {
  color: #60a5fa !important;
}

/* Custom card styling */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Custom container width */
@media (min-width: 1280px) {
  .container {
    max-width: 1200px;
  }
}

/* Aspect ratio utilities for video embeds */
.aspect-w-16 {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
}

.aspect-h-9 {
  position: relative;
}

.aspect-w-16 iframe,
.aspect-h-9 iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Logo toggle styles */
#logo .logo-text { display: none; }
#logo:hover .logo-img, #logo.clicked .logo-img { display: none; }
#logo:hover .logo-text, #logo.clicked .logo-text { display: inline; }
