/* Accessibility Enhancements */

/* Focus styles */
:focus {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  z-index: 100;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
}

/* ARIA-enhanced elements */
[role="button"],
[role="tab"],
[role="link"] {
  cursor: pointer;
}

/* Enhanced form accessibility */
.form-control:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(21, 152, 149, 0.3);
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

/* Required field indication */
.required-field::after {
  content: "*";
  color: #d32f2f;
  margin-left: 4px;
}

/* Form validation messages */
.form-error-message {
  color: #d32f2f;
  font-size: 0.875rem;
  margin-top: 4px;
  display: block;
}

/* Enhanced button accessibility */
.btn {
  min-height: 44px; /* Minimum touch target size */
  min-width: 44px;
}

/* Color contrast improvements */
.high-contrast-text {
  color: var(--dark-color);
}

.high-contrast-bg {
  background-color: white;
}

/* Accessible tables */
.accessible-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.accessible-table caption {
  font-weight: 700;
  text-align: left;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.accessible-table th {
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
  text-align: left;
  padding: 12px;
}

.accessible-table td {
  padding: 12px;
  border-bottom: 1px solid #ddd;
}

.accessible-table tr:hover td {
  background-color: rgba(87, 197, 182, 0.1);
}

/* Accessible tooltips */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltip-text {
  visibility: hidden;
  width: 200px;
  background-color: var(--dark-color);
  color: white;
  text-align: center;
  border-radius: 6px;
  padding: 10px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--dark-color) transparent transparent transparent;
}

.tooltip:hover .tooltip-text,
.tooltip:focus .tooltip-text,
.tooltip:focus-within .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Keyboard accessible dropdown */
.accessible-dropdown {
  position: relative;
}

.accessible-dropdown-button {
  background-color: var(--primary-color);
  color: white;
  padding: 12px;
  border: none;
  cursor: pointer;
  min-width: 160px;
  text-align: left;
}

.accessible-dropdown-button::after {
  content: "▼";
  margin-left: 10px;
  font-size: 0.8em;
}

.accessible-dropdown-content {
  display: none;
  position: absolute;
  background-color: white;
  min-width: 160px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  z-index: 1;
}

.accessible-dropdown-content a {
  color: var(--text-color);
  padding: 12px;
  text-decoration: none;
  display: block;
}

.accessible-dropdown-content a:hover,
.accessible-dropdown-content a:focus {
  background-color: #f1f1f1;
}

.accessible-dropdown:hover .accessible-dropdown-content,
.accessible-dropdown:focus-within .accessible-dropdown-content {
  display: block;
}

/* Accessible accordion */
.accessible-accordion {
  width: 100%;
  margin-bottom: 20px;
}

.accordion-item {
  border: 1px solid #ddd;
  margin-bottom: 5px;
}

.accordion-header {
  background-color: #f5f5f5;
  padding: 0;
  margin: 0;
}

.accordion-button {
  width: 100%;
  background: none;
  border: none;
  padding: 15px;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accordion-button::after {
  content: "+";
  font-size: 1.5rem;
}

.accordion-button[aria-expanded="true"]::after {
  content: "-";
}

.accordion-content {
  padding: 0 15px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion-content[aria-hidden="false"] {
  max-height: 500px;
  padding: 15px;
}

/* Accessible tabs */
.accessible-tabs {
  width: 100%;
}

.tabs-list {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  border-bottom: 2px solid #ddd;
}

.tab-item {
  margin-right: 5px;
}

.tab-button {
  padding: 10px 15px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
}

.tab-button[aria-selected="true"] {
  border-bottom-color: var(--accent-color);
  font-weight: 600;
}

.tab-panel {
  padding: 20px 0;
  display: none;
}

.tab-panel[aria-hidden="false"] {
  display: block;
}

/* Accessible modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 1000;
  overflow: auto;
}

.modal-content {
  background-color: white;
  margin: 10% auto;
  padding: 20px;
  border-radius: 5px;
  max-width: 500px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  background: none;
  border: none;
  padding: 5px 10px;
}

/* Accessible carousel */
.accessible-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.carousel-container {
  display: flex;
  transition: transform 0.5s ease;
}

.carousel-slide {
  flex: 0 0 100%;
}

.carousel-controls {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.carousel-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
}

.carousel-indicators {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.carousel-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #ddd;
  margin: 0 5px;
  cursor: pointer;
}

.carousel-indicator.active {
  background-color: var(--accent-color);
}

/* Accessible form elements */
fieldset {
  border: 1px solid #ddd;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 5px;
}

legend {
  padding: 0 10px;
  font-weight: 600;
}

/* Accessible checkboxes and radio buttons */
.accessible-checkbox,
.accessible-radio {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.accessible-checkbox input,
.accessible-radio input {
  margin-right: 10px;
}

/* High contrast mode */
.high-contrast-mode {
  --primary-color: #000;
  --secondary-color: #000;
  --accent-color: #000;
  --light-color: #fff;
  --dark-color: #000;
  --text-color: #000;
  --light-text: #fff;
  
  background-color: white;
  color: black;
}

.high-contrast-mode a {
  color: #000;
  text-decoration: underline;
}

.high-contrast-mode button,
.high-contrast-mode .btn {
  background-color: #000;
  color: #fff;
  border: 2px solid #000;
}

.high-contrast-mode img {
  filter: grayscale(100%) contrast(120%);
}

/* Text resize controls */
.text-resize-controls {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.text-resize-controls span {
  margin-right: 10px;
}

.text-resize-button {
  background: none;
  border: 1px solid #ddd;
  padding: 5px 10px;
  margin-right: 5px;
  cursor: pointer;
}

.text-resize-button:hover {
  background-color: #f5f5f5;
}

/* Font size classes */
.font-size-small {
  font-size: 0.9em;
}

.font-size-medium {
  font-size: 1em;
}

.font-size-large {
  font-size: 1.2em;
}

.font-size-xlarge {
  font-size: 1.4em;
}

/* Screen reader only text */
.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;
}

/* Accessible icons */
.icon-with-text {
  display: flex;
  align-items: center;
}

.icon-with-text i {
  margin-right: 8px;
}

/* Accessible links */
a:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}

/* Accessible images */
img {
  max-width: 100%;
  height: auto;
}

.accessible-image {
  position: relative;
}

.accessible-image figcaption {
  margin-top: 8px;
  font-style: italic;
  color: #666;
}

/* Accessible video controls */
.accessible-video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.accessible-video-container iframe,
.accessible-video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-controls {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.video-control-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
}

/* Accessible progress indicator */
.accessible-progress {
  width: 100%;
  height: 20px;
  background-color: #f5f5f5;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar {
  height: 100%;
  background-color: var(--accent-color);
  border-radius: 10px;
  transition: width 0.3s ease;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9em;
}

/* Accessible notification */
.accessible-notification {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 5px;
  border-left: 5px solid var(--accent-color);
  background-color: rgba(87, 197, 182, 0.1);
}

.accessible-notification.success {
  border-left-color: #4caf50;
  background-color: rgba(76, 175, 80, 0.1);
}

.accessible-notification.warning {
  border-left-color: #ff9800;
  background-color: rgba(255, 152, 0, 0.1);
}

.accessible-notification.error {
  border-left-color: #f44336;
  background-color: rgba(244, 67, 54, 0.1);
}

/* Accessible breadcrumbs */
.breadcrumbs {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin: 0 10px;
  color: #666;
}

.breadcrumbs a {
  color: var(--accent-color);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs .current {
  color: #666;
}

/* Accessible pagination */
.pagination {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.pagination li {
  margin-right: 5px;
}

.pagination a {
  display: block;
  padding: 8px 12px;
  border: 1px solid #ddd;
  color: var(--text-color);
  text-decoration: none;
}

.pagination a:hover,
.pagination a:focus {
  background-color: #f5f5f5;
}

.pagination .active a {
  background-color: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.pagination .disabled a {
  color: #999;
  pointer-events: none;
}

/* Accessible data tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.data-table caption {
  font-weight: 700;
  text-align: left;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.data-table th,
.data-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.data-table th {
  background-color: var(--primary-color);
  color: white;
}

.data-table tbody tr:hover {
  background-color: rgba(87, 197, 182, 0.1);
}

/* Responsive tables for accessibility */
@media (max-width: 768px) {
  .responsive-table {
    display: block;
    width: 100%;
    overflow-x: auto;
  }
}

/* Print accessibility */
@media print {
  body {
    font-size: 12pt;
    line-height: 1.5;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
  }
  
  abbr[title]:after {
    content: " (" attr(title) ")";
  }
  
  .no-print {
    display: none !important;
  }
  
  .page-break {
    page-break-before: always;
  }
}
