
/* Mobile-only thin search — must load after mobile-enhancements.css */
@media (max-width: 980px) {
  .header-row1 .search-box,
  #searchWrapper .search-box,
  .search-filter-container .search-box {
    height: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    padding: 0 3px !important;
    border-radius: 8px !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }
  .header-row1 #oldSearchInput,
  #searchWrapper #oldSearchInput,
  #oldSearchInput {
    height: 14px !important;
    min-height: 14px !important;
    line-height: 14px !important;
    font-size: 9px !important;
    padding: 0 2px !important;
  }
  .header-row1 #searchCategory,
  #searchCategory {
    height: 14px !important;
    min-height: 14px !important;
    font-size: 8px !important;
    padding: 0 2px !important;
  }
  .header-row1 .search-box .fa-search,
  .search-box .fa-search {
    font-size: 7px !important;
    margin-right: 2px !important;
  }
  .header-row1.mobile-header-row1 {
    min-height: 0 !important;
    height: auto !important;
  }
}

/* Accessibility Improvements */

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: #3b82f6;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100000;
    border-radius: 4px;
}

.skip-to-main:focus {
    top: 0;
}

/* Focus indicators */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Remove outline for mouse users, keep for keyboard users */
*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    * {
        border-color: currentColor !important;
    }

    a {
        text-decoration: underline;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Screen reader only content */
.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;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Ensure sufficient color contrast */
a {
    color: #2563eb;
    /* WCAG AA compliant */
}

a:hover {
    color: #1d4ed8;
}

/* Button contrast */
.btn-primary {
    background: #3b82f6;
    color: #fff;
    border: none;
}

.btn-secondary {
    background: #6b7280;
    color: #fff;
    border: none;
}

/* Form labels */
label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #374151;
}

/* Required field indicator */
.required::after {
    content: " *";
    color: #ef4444;
}

/* Error messages */
.error-message,
.form-error {
    color: #dc2626;
    font-size: 14px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.error-message::before {
    content: "⚠";
}

/* Success messages */
.success-message {
    color: #059669;
    font-size: 14px;
    margin-top: 4px;
}

/* Disabled state */
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading state */
[aria-busy="true"] {
    cursor: wait;
    opacity: 0.7;
}

/* Tooltips */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 4px;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus::after {
    opacity: 1;
}

/* Ensure images have alt text */
img:not([alt]) {
    outline: 2px solid #ef4444;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1f2937;
        --text-color: #f3f4f6;
        --border-color: #374151;
    }

    body {
        background: var(--bg-color);
        color: var(--text-color);
    }

    a {
        color: #60a5fa;
    }
}
/* Dark Mode Styles */

:root {
    /* Light mode colors (default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border-color: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    /* Dark mode colors */
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --bg-tertiary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --border-color: #4b5563;
    --shadow: rgba(0, 0, 0, 0.3);
}

/* Apply theme colors */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.card,
.section,
.modal-content {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.bg-secondary {
    background-color: var(--bg-secondary);
}

.text-secondary {
    color: var(--text-secondary);
}

/* Dark mode toggle button */
.dark-mode-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--shadow);
    transition: all 0.3s ease;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px var(--shadow);
}

/* Dark mode specific adjustments */
[data-theme="dark"] a {
    color: #60a5fa;
}

[data-theme="dark"] a:hover {
    color: #93c5fd;
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .btn-primary {
    background: #3b82f6;
    color: #fff;
}

[data-theme="dark"] .btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

[data-theme="dark"] .toast {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

[data-theme="dark"] .breadcrumb-nav {
    background: var(--bg-secondary);
}

[data-theme="dark"] .search-autocomplete {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .search-result-item:hover {
    background: var(--bg-secondary);
}

/* Smooth transitions for theme switch */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Respect user's system preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg-primary: #1f2937;
        --bg-secondary: #111827;
        --bg-tertiary: #374151;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-tertiary: #9ca3af;
        --border-color: #4b5563;
        --shadow: rgba(0, 0, 0, 0.3);
    }
}

