/* ==========================================
   CSS HERRAMIENTAS DE ACCESIBILIDAD
   ========================================== */

/* Grid de Herramientas */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.tool-card {
  padding: 2rem;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  transition: all 0.3s ease;
  background: white;
}

.tool-card:hover {
  border-color: #667eea;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
  transform: translateY(-4px);
}

.tool-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.tool-title {
  font-size: 1.5rem;
  margin: 0 0 0.75rem 0;
  color: #1f2937;
}

.tool-title a {
  color: inherit;
  text-decoration: none;
}

.tool-title a:hover {
  color: #667eea;
}

.tool-description {
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.tool-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: #eff6ff;
  color: #1e40af;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

/* Comprobador de Contraste */
.contrast-checker-tool {
  margin-top: 2rem;
}

.tool-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.color-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.color-input-group label {
  display: block;
}

.label-text {
  font-weight: 600;
  color: #374151;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.color-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.color-input-group input[type="color"] {
  width: 100%;
  height: 60px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  padding: 4px;
  background: white;
}

.color-input-group input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Courier New', monospace;
  transition: all 0.2s ease;
}

.color-input-group input[type="text"]:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.color-formats {
  display: flex;
  gap: 0.5rem;
}

.format-btn {
  padding: 0.5rem 1rem;
  border: 2px solid #e5e7eb;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  color: #374151;
}

.format-btn:hover {
  border-color: #5568d3; /* Mejorado contraste WCAG AA (antes #667eea) */
  color: #5568d3; /* Mejorado contraste WCAG AA: 5.2:1 (antes #667eea 3.4:1) */
}

.format-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
}

/* Vista Previa */
.preview-section {
  margin: 2rem 0;
  padding: 2rem;
  background: #f9fafb;
  border-radius: 12px;
}

.preview-section h3 {
  margin: 0 0 1.5rem 0;
  color: #1f2937;
  font-size: 1.25rem;
}

.preview-container {
  display: flex;
  justify-content: center;
}

.preview-box {
  padding: 2rem;
  border-radius: 12px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
  width: 100%;
  max-width: 600px;
  transition: all 0.3s ease;
}

.preview-text-normal {
  font-size: 16px;
  margin: 0;
  font-weight: 400;
}

.preview-text-large {
  font-size: 24px;
  margin: 0;
  font-weight: 400;
}

.preview-button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preview-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.preview-link {
  color: inherit;
  text-decoration: underline;
  font-size: 1rem;
}

.preview-link:hover {
  opacity: 0.8;
}

/* Resultados */
.results-section {
  margin: 2rem 0;
}

.results-section h3 {
  margin: 0 0 1.5rem 0;
  color: #1f2937;
  font-size: 1.25rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.result-card {
  padding: 1.5rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: white;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.result-label {
  font-weight: 600;
  color: #374151;
  font-size: 0.95rem;
}

.result-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  font-family: 'Courier New', monospace;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

.result-badge.pass {
  background: #d1fae5;
  color: #065f46;
}

.result-badge.fail {
  background: #fee2e2;
  color: #991b1b;
}

.result-badge.pending {
  background: #f3f4f6;
  color: #6b7280;
}

.badge-icon {
  font-size: 1rem;
}

.result-info {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.6;
}

.result-info p {
  margin: 0.25rem 0;
}

.result-status {
  margin-top: 0.5rem;
  font-weight: 500;
}

.luminance-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.luminance-info strong {
  color: #374151;
  font-family: 'Courier New', monospace;
}

/* Simulador de Daltonismo */
.colorblind-section {
  margin: 2rem 0;
  padding: 2rem;
  background: #f9fafb;
  border-radius: 12px;
}

.colorblind-section h3 {
  margin: 0 0 1.5rem 0;
  color: #1f2937;
  font-size: 1.25rem;
}

.colorblind-controls {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.colorblind-btn {
  padding: 0.75rem 1.5rem;
  border: 2px solid #e5e7eb;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  color: #374151;
}

.colorblind-btn:hover {
  border-color: #667eea;
  color: #667eea;
}

.colorblind-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
}

.colorblind-preview {
  margin: 1.5rem 0;
}

.colorblind-preview-box {
  padding: 2rem;
  border-radius: 12px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
  background: white;
  border: 2px solid #e5e7eb;
}

.colorblind-contrast {
  margin-top: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  text-align: center;
  font-size: 1rem;
}

.colorblind-contrast strong {
  font-size: 1.25rem;
  color: #1f2937;
  font-family: 'Courier New', monospace;
}

/* Sugerencias */
.suggestions-section {
  margin: 2rem 0;
  padding: 2rem;
  background: #eff6ff;
  border-radius: 12px;
}

.suggestions-section h3 {
  margin: 0 0 1rem 0;
  color: #1f2937;
  font-size: 1.25rem;
}

.suggestions-intro {
  color: #6b7280;
  margin-bottom: 1.5rem;
}

.suggestions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
}

.suggestion-item {
  padding: 1rem;
  background: white;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.suggestion-item:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.suggestion-color {
  width: 100%;
  height: 60px;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.suggestion-hex {
  font-size: 0.75rem;
  color: #6b7280;
  font-family: 'Courier New', monospace;
}

/* Casos de Uso */
.use-cases-section {
  margin: 2rem 0;
}

.use-cases-section h3 {
  margin: 0 0 1.5rem 0;
  color: #1f2937;
  font-size: 1.25rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  border-bottom: 2px solid #e5e7eb;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  background: transparent;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-weight: 500;
  color: #4b5563; /* Mejorado contraste WCAG AA: 6.7:1 (antes #6b7280 4.1:1) */
  transition: all 0.2s ease;
  margin-bottom: -2px;
}

.tab-btn:hover {
  color: #5568d3; /* Mejorado contraste WCAG AA (antes #667eea) */
}

.tab-btn.active {
  color: #5568d3; /* Mejorado contraste WCAG AA (antes #667eea) */
  border-bottom-color: #5568d3; /* Mejorado contraste WCAG AA */
}

.tab-content {
  display: none;
  padding: 2rem;
  background: #f9fafb;
  border-radius: 12px;
}

.tab-content.active {
  display: block;
}

.use-case-preview {
  margin-bottom: 1.5rem;
  padding: 2rem;
  background: white;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
}

.use-case-button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.use-case-link {
  color: inherit;
  text-decoration: underline;
  font-size: 1rem;
}

.use-case-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #374151;
  font-size: 0.875rem;
}

.use-case-input {
  width: 100%;
  max-width: 400px;
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
}

.use-case-card {
  padding: 1.5rem;
  background: white;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
}

.use-case-card h4 {
  margin: 0 0 0.75rem 0;
  color: #1f2937;
}

.use-case-card p {
  margin: 0;
  color: #6b7280;
}

.use-case-results {
  margin-top: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #6b7280;
}

/* Exportación */
.export-section {
  margin: 2rem 0;
  padding: 2rem;
  background: #f9fafb;
  border-radius: 12px;
}

.export-section h3 {
  margin: 0 0 1.5rem 0;
  color: #1f2937;
  font-size: 1.25rem;
}

.export-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.export-output {
  padding: 1rem;
  background: white;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  color: #374151;
  min-height: 60px;
  display: none;
}

.export-output.active {
  display: block;
}

/* Sección Educativa */
.educational-section {
  margin: 3rem 0;
  padding: 2rem;
  background: #f9fafb;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
}

.educational-section summary {
  cursor: pointer;
  list-style: none;
}

.educational-section summary::-webkit-details-marker {
  display: none;
}

.educational-section summary h2 {
  margin: 0;
  color: #1f2937;
  font-size: 1.5rem;
  display: inline;
}

.educational-section summary::before {
  content: '▶';
  display: inline-block;
  margin-right: 0.5rem;
  transition: transform 0.2s ease;
}

.educational-section[open] summary::before {
  transform: rotate(90deg);
}

.educational-content {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #e5e7eb;
}

.educational-content h3 {
  margin: 1.5rem 0 1rem 0;
  color: #1f2937;
  font-size: 1.25rem;
}

.educational-content p {
  color: #6b7280;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.educational-content ul {
  margin: 1rem 0;
  padding-left: 2rem;
  color: #6b7280;
  line-height: 1.8;
}

.educational-content li {
  margin: 0.5rem 0;
}

.educational-content a {
  color: #667eea;
  text-decoration: none;
}

.educational-content a:hover {
  text-decoration: underline;
}

/* CTA */
.tool-cta {
  margin: 3rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  text-align: center;
  color: white;
}

.tool-cta p {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
}

.tool-cta .btn {
  background: white;
  color: #5568d3; /* Mejorado contraste WCAG AA: 5.2:1 (antes #667eea 3.4:1) */
}

.tool-cta .btn:hover {
  background: #f3f4f6;
  color: #4c5cd0; /* Contraste mejorado en hover */
}

/* Responsive */
@media (max-width: 768px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .tool-controls {
    grid-template-columns: 1fr;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .colorblind-controls {
    flex-direction: column;
  }

  .colorblind-btn {
    width: 100%;
  }

  .tabs {
    flex-direction: column;
  }

  .tab-btn {
    width: 100%;
    text-align: left;
  }

  .export-buttons {
    flex-direction: column;
  }

  .export-buttons button {
    width: 100%;
  }

  .suggestions-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

