/* Enhanced Color Contrast Checker Styles */
.ccchecker-container {
  max-width: 800px;
  margin: 2rem auto;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
}

.ccchecker-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  padding: 2.5rem;
  border: 1px solid #e5e7eb;
}

.ccchecker-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 2rem;
  text-align: center;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Presets Section */
.ccchecker-presets {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.ccchecker-presets-title {
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ccchecker-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.75rem;
}

.ccchecker-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
}

.ccchecker-preset-btn:hover {
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.ccchecker-preset-preview {
  width: 32px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Input Section */
.ccchecker-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
  align-items: stretch;
}

.ccchecker-color-input {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.ccchecker-label {
  font-weight: 600;
  color: #374151;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ccchecker-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  box-sizing: border-box;
}

.ccchecker-color-picker {
  width: 100%;
  height: 50px;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.ccchecker-color-picker:hover {
  border-color: #2563eb;
}

.ccchecker-color-picker:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ccchecker-color-formats {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.ccchecker-color-format {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.2s ease;
  display: none;
}

.ccchecker-color-format.active {
  display: block;
}

.ccchecker-color-format:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ccchecker-format-tabs {
  display: flex;
  gap: 0.25rem;
}

.ccchecker-format-tab {
  flex: 1;
  padding: 0.5rem;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  transition: all 0.2s ease;
}

.ccchecker-format-tab:hover {
  background: #e5e7eb;
  color: #374151;
}

.ccchecker-format-tab.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.ccchecker-copy-btn {
  padding: 0.75rem;
  background: #f3f4f6;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ccchecker-copy-btn:hover {
  background: #e5e7eb;
  color: #374151;
  border-color: #9ca3af;
}

.ccchecker-copy-btn:active {
  transform: translateY(1px);
}

/* Swap Button */
.ccchecker-swap-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 1.5rem;
}

.ccchecker-swap-btn {
  width: 48px;
  height: 48px;
  background: #2563eb;
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.ccchecker-swap-btn:hover {
  background: #1d4ed8;
  transform: rotate(180deg) scale(1.1);
}

.ccchecker-swap-btn:active {
  transform: rotate(180deg) scale(0.95);
}

/* Tooltip */
.ccchecker-tooltip {
  position: relative;
  cursor: help;
  color: #6b7280;
  font-weight: normal;
}

.ccchecker-tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ccchecker-tooltip:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  border: 4px solid transparent;
  border-top-color: #1f2937;
  z-index: 1000;
}

/* Preview Section */
.ccchecker-preview {
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.ccchecker-preview-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.ccchecker-preview-title {
  font-weight: 600;
  color: #374151;
  font-size: 1rem;
}

.ccchecker-colorblind-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.ccchecker-colorblind-select {
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  font-size: 0.875rem;
}

.ccchecker-preview-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ccchecker-text-sample {
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: inherit;
}

.ccchecker-text-small { font-size: 12px; }
.ccchecker-text-normal { font-size: 16px; }
.ccchecker-text-large { font-size: 20px; }
.ccchecker-text-xlarge { font-size: 24px; }

.ccchecker-weight-normal { font-weight: 400; }
.ccchecker-weight-bold { font-weight: 700; }

/* Results Section */
.ccchecker-results {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.ccchecker-ratios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.ccchecker-ratio-item {
  padding: 1.5rem;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  text-align: center;
}

.ccchecker-ratio-label {
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.ccchecker-ratio-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1e293b;
  font-family: 'Courier New', monospace;
}

.ccchecker-compliance {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.ccchecker-compliance-section {
  padding: 1.5rem;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.ccchecker-compliance-title {
  font-weight: 700;
  color: #334155;
  margin-bottom: 1rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ccchecker-compliance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.ccchecker-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.ccchecker-status-pass {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.ccchecker-status-fail {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.ccchecker-check {
  font-weight: 700;
  font-size: 1rem;
}

/* Recommendations */
.ccchecker-recommendations {
  padding: 1.5rem;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 12px;
  margin-top: 1rem;
}

.ccchecker-recommendations-title {
  font-weight: 600;
  color: #92400e;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.ccchecker-recommendations-content {
  color: #92400e;
  font-size: 0.875rem;
  line-height: 1.5;
}

.ccchecker-recommendation-item {
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 6px;
}

.ccchecker-recommendation-colors {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.ccchecker-suggestion-color {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.ccchecker-suggestion-color:hover {
  transform: scale(1.05);
}

/* Usage Examples */
.ccchecker-usage-examples {
  padding: 1.5rem;
  background: #f0f9ff;
  border: 1px solid #0ea5e9;
  border-radius: 12px;
}

.ccchecker-usage-title {
  font-weight: 600;
  color: #0c4a6e;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.ccchecker-usage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.ccchecker-usage-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ccchecker-usage-level {
  background: #0ea5e9;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.75rem;
  min-width: 40px;
  text-align: center;
}

.ccchecker-usage-desc {
  color: #0c4a6e;
  font-size: 0.875rem;
}

/* Color Vision Simulation Filters */
.ccchecker-protanopia { filter: url(#protanopia); }
.ccchecker-deuteranopia { filter: url(#deuteranopia); }
.ccchecker-tritanopia { filter: url(#tritanopia); }
.ccchecker-protanomaly { filter: url(#protanomaly); }
.ccchecker-deuteranomaly { filter: url(#deuteranomaly); }
.ccchecker-tritanomaly { filter: url(#tritanomaly); }
.ccchecker-achromatopsia { filter: grayscale(100%); }

/* Responsive Design */
@media (max-width: 768px) {
  .ccchecker-container {
    margin: 1rem;
    max-width: none;
  }
  
  .ccchecker-card {
    padding: 1.5rem;
  }
  
  .ccchecker-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .ccchecker-inputs {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .ccchecker-swap-container {
    order: 2;
    padding-top: 0;
  }
  
  .ccchecker-swap-btn {
    transform: rotate(90deg);
  }
  
  .ccchecker-swap-btn:hover {
    transform: rotate(270deg) scale(1.1);
  }
  
  .ccchecker-ratios {
    grid-template-columns: 1fr;
  }
  
  .ccchecker-compliance-grid {
    grid-template-columns: 1fr;
  }
  
  .ccchecker-usage-grid {
    grid-template-columns: 1fr;
  }
  
  .ccchecker-presets-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .ccchecker-preview-controls {
    flex-direction: column;
    align-items: stretch;
  }
}