/* Cross-Language Comparison Tables - Industry-Relevant Reference */

/* Comparison Table Container */
.comparison-table-container {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.75rem;
  overflow-x: auto;
}

.comparison-table-container h3 {
  margin: 0 0 1.5rem 0;
  color: var(--md-default-fg-color);
  font-size: 1.3rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.comparison-table-container h3::before {
  content: "📊";
  font-size: 1.2rem;
}

/* Enhanced Comparison Table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.comparison-table th,
.comparison-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
  vertical-align: top;
}

.comparison-table th {
  background: linear-gradient(135deg, var(--md-primary-fg-color) 0%, var(--md-primary-fg-color--dark) 100%);
  color: var(--md-primary-bg-color);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.comparison-table tr:hover {
  background: var(--md-default-bg-color--light);
}

.comparison-table tr:nth-child(even) {
  background: var(--md-default-bg-color--lightest);
}

.comparison-table tr:hover:nth-child(even) {
  background: var(--md-default-bg-color--light);
}

/* Language Badges */
.language-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 60px;
  text-align: center;
}

.language-badge.sql {
  background: #f29111;
  color: white;
}

.language-badge.python {
  background: #3776ab;
  color: white;
}

.language-badge.java {
  background: #007396;
  code {
    color: white;
  }
}

.language-badge.c {
  background: #00599c;
  color: white;
}

.language-badge.javascript {
  background: #f7df1e;
  color: #323330;
}

.language-badge.html {
  background: #e34c26;
  color: white;
}

.language-badge.css {
  background: #1572b6;
  code {
    color: white;
  }
}

.language-badge.plsql {
  background: #f29111;
  color: white;
}

.language-badge.cpp {
  background: #00599c;
  color: white;
}

/* Code Examples in Tables */
.comparison-table code {
  background: var(--md-code-bg-color);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.85rem;
  font-family: var(--md-code-font-family);
  color: var(--md-code-color);
}

.comparison-table .code-block {
  background: var(--md-code-bg-color);
  padding: 0.5rem;
  border-radius: 0.25rem;
  margin: 0.25rem 0;
  display: block;
  font-size: 0.8rem;
  line-height: 1.4;
  overflow-x: auto;
}

.comparison-table .code-block pre {
  margin: 0;
  padding: 0;
  background: transparent;
}

.comparison-table .code-block code {
  background: transparent;
  padding: 0;
}

/* Syntax Highlighting for Comparison Tables */
.comparison-table .highlight .k {
  color: #ff6b6b;
  font-weight: 600;
}

.comparison-table .highlight .s {
  color: #4ecdc4;
}

.comparison-table .highlight .nf {
  color: #45b7d1;
  font-weight: 600;
}

.comparison-table .highlight .mi {
  color: #f7b731;
}

.comparison-table .highlight .c1 {
  color: #7f8c8d;
  font-style: italic;
}

/* Feature Comparison */
.feature-comparison {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feature-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.feature-available {
  color: #4caf50;
}

.feature-unavailable {
  color: #f44336;
}

.feature-partial {
  color: #ff9800;
}

/* Performance Metrics */
.performance-metrics {
  font-size: 0.8rem;
  color: var(--md-default-fg-color--light);
}

.performance-score {
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.8rem;
}

.performance-excellent {
  background: #4caf50;
  color: white;
}

.performance-good {
  background: #8bc34a;
  color: white;
}

.performance-average {
  background: #ff9800;
  color: white;
}

.performance-poor {
  background: #f44336;
  color: white;
}

/* Usage Examples */
.usage-example {
  margin: 0.5rem 0;
  padding: 0.5rem;
  0.5rem 0;
  background: var(--md-code-bg-color);
  border-radius: 0.25rem;
  font-size: 0.8rem;
  line-height: 1.4;
}

.usage-example pre {
  margin: 0;
  padding: 0;
}

.usage-example code {
  background: transparent;
  padding: 0;
  font-size: 0.8rem;
}

/* Quick Reference Cards */
.quick-reference {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.quick-reference-card {
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.5rem;
  padding: 1rem;
  transition: all 0.3s ease;
}

.quick-reference-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-color: var(--md-accent-fg-color--transparent);
}

.quick-reference-card h4 {
  margin: 0 0 0.5rem 0;
  color: var(--md-accent-fg-color);
  font-size: 1rem;
}

.quick-reference-card .languages {
  display: flex;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.quick-reference-card .syntax {
  font-family: var(--md-code-font-family);
  font-size: 0.8rem;
  line-height: 1.4;
  background: var(--md-code-bg-color);
  padding: 0.5rem;
  border-radius: 0.25rem;
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
  .comparison-table-container {
    padding: 1rem;
    margin: 1rem 0;
  }
  
  .comparison-table {
    font-size: 0.8rem;
  }
  
  .comparison-table th,
  .comparison-table td {
    padding: 0.75rem 0.5rem;
  }
  
  .comparison-table th {
    font-size: 0.8rem;
  }
  
  .language-badge {
    min-width: 50px;
    font-size: 0.6rem;
  }
  
  .comparison-table .code-block {
    font-size: 0.7rem;
  }
  
  .quick-reference {
    grid-template-columns: 1fr;
  }
  
  .feature-comparison {
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
  }
  
  .feature-icon {
    width: 20px;
    height: 20px;
    font-size: 0.8rem;
  }
}

/* Print Styles */
@media print {
  .comparison-table-container {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  
  .comparison-table {
    font-size: 0.8rem;
  }
  
  .comparison-table th {
    background: var(--md-default-fg-color) !important;
    color: var(--md-default-bg-color) !important;
  }
  
  .language-badge {
    background: var(--md-default-fg-color) !important;
    color: var(--md-default-bg-color) !important;
    border: 1px solid var(--md-default-fg-color) !important;
  }
}

/* Dark Mode Support */
[data-md-color-scheme="slate"] .comparison-table th {
  background: var(--md-default-fg-color);
  color: var(--md-default-bg-color);
}

[data-md-color-scheme="slate"] .language-badge {
  background: var(--md-default-fg-color);
  color: var(--md-default-bg-color);
  border-color: var(--md-default-fg-color);
}

[data-md-color-scheme="slate"] .comparison-table .code-block {
  background: var(--md-code-bg-color);
}

/* Accessibility */
.comparison-table th:focus {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: 2px;
}

.comparison-table td:focus {
  outline: 1px solid var(--md-accent-fg-color);
  outline-offset: 1px;
}

/* Tooltips for Tables */
.comparison-tooltip {
  position: relative;
  cursor: help;
}

.comparison-tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-accent-fg-color);
  border-radius: 0.25rem;
  padding: 0.5rem;
  font-size: 0.8rem;
  white-space: nowrap;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.comparison-tooltip:hover::after {
  opacity: 1;
  pointer-events: auto;
}

/* Animation for Table Rows */
@keyframes tableRowEntrance {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.comparison-table tbody tr {
  animation: tableRowEntrance 0.3s ease forwards;
}

.comparison-table tbody tr:nth-child(1) { animation-delay: 0.1s; }
.comparison-table tbody tr:nth-child(2) { animation-delay: 0.2s; }
.comparison-table tbody tr:nth-child(3) { animation-delay: 0.3s; }
.comparison-table tbody tr:nth-child(4) { animation-delay: 0.4s; }
.comparison-table tbody tr:nth-child(5) { animation-delay: 0.5s; }
