/* Additional styles for enhanced interactivity */

/* Benchmarks container for side-by-side layout */
.benchmarks-container {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 2rem 0;
  padding: 0 3rem;
}

.benchmark-item {
  flex: 1;
  min-width: 450px;
  max-width: 800px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.benchmark-item img {
  border: none;
  box-shadow: none;
  background: transparent;
  transition: opacity 0.3s ease;
  object-position: center;
}

/* Use width-based sizing for consistent visual appearance */
.benchmark-item img[src*="3d-reasoning-benchmarks"] {
  width: 120%;
  height: auto;
  max-height: 536px;
  object-fit: contain;
}

.benchmark-item img[src*="objnav-benchmarks"] {
  width: 90%;
  height: auto;
  max-height: 536px;
  object-fit: contain;
  display: block;
  margin-left: auto;
  margin-right: 0;
}

/* Align the second benchmark item (objnav) to the right */
.benchmark-item:nth-child(2) {
  align-self: flex-end;
  text-align: right;
}

.benchmark-item:hover img {
  opacity: 0.95;
}

/* Responsive design for benchmarks */
@media (max-width: 900px) {
  .benchmarks-container {
    flex-direction: column;
    gap: 2rem;
    padding: 0 2rem;
  }
  
  .benchmark-item {
    min-width: auto;
    max-width: 100%;
  }
  
  .benchmark-item img[src*="3d-reasoning-benchmarks"] {
    width: 120%;
    max-height: 479px;
  }
  
  .benchmark-item img[src*="objnav-benchmarks"] {
    width: 90%;
    max-height: 479px;
    display: block;
    margin-left: auto;
    margin-right: 0;
  }
}

@media (max-width: 600px) {
  .benchmarks-container {
    padding: 0 1rem;
    gap: 1.5rem;
  }
  
  .benchmark-item img[src*="3d-reasoning-benchmarks"] {
    width: 110%;
    max-height: 385px;
  }
  
  .benchmark-item img[src*="objnav-benchmarks"] {
    width: 85%;
    max-height: 385px;
    display: block;
    margin-left: auto;
    margin-right: 0;
  }
}

/* Image styling for seamless integration - completely borderless */
.media-container {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  transition: all 0.3s ease;
}

.media-container img {
  border: none;
  box-shadow: none;
  background: transparent;
  transition: opacity 0.3s ease;
}

.media-container:hover img {
  opacity: 0.95;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #5a67d8;
}

/* Loading animation for images */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transform: translateX(-100%);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  100% {
    transform: translateX(100%);
  }
}

/* Hover effects for tables */
.interactive-table tbody tr {
  cursor: pointer;
  transition: all 0.3s ease;
}

.interactive-table tbody tr:hover {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  transform: scale(1.01);
}

/* Code blocks */
pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.5;
}

code {
  font-family: 'JetBrains Mono', monospace;
  background: #f1f5f9;
  color: #667eea;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Tooltip styles */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: #1e293b;
  color: #fff;
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  position: absolute;
  z-index: 1001;
  bottom: 125%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 14px;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* Progress bars */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 4px;
  transition: width 0.8s ease;
}

/* Badge styles */
.badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: #667eea;
  color: white;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0.2rem;
}

.badge.success {
  background: #10b981;
}

.badge.warning {
  background: #f59e0b;
}

.badge.error {
  background: #ef4444;
}

/* Enhanced animations */
@keyframes slideInFromLeft {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInFromRight {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in-left {
  animation: slideInFromLeft 0.6s ease-out;
}

.slide-in-right {
  animation: slideInFromRight 0.6s ease-out;
}

/* Print styles */
@media print {
  .nav, .hero, .footer {
    display: none;
  }
  
  .main-content {
    background: white;
  }
  
  .section {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }
}

/* Introduction Section Styles */
.intro-content {
  max-width: 100%;
}

.intro-main {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #374151;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 12px;
  border-left: 4px solid #667eea;
  text-align: justify;
  text-justify: inter-word;
}

.intro-main strong {
  color: #667eea;
  font-weight: 600;
}

.key-innovations-title {
  margin: 2.5rem 0 1.5rem 0;
  color: #1e293b;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.key-innovations-title i {
  color: #f59e0b;
}

.innovations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.innovation-item {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.innovation-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
  border-color: #667eea;
}

.innovation-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.innovation-header i {
  color: #667eea;
  font-size: 1.2rem;
}

.innovation-header h5 {
  margin: 0;
  color: #1e293b;
  font-size: 1.1rem;
  font-weight: 600;
}

.innovation-item p {
  margin: 0;
  line-height: 1.6;
  color: #4b5563;
}

/* Table sorting and highlighting styles */
.table-container {
  overflow-x: auto;
  margin: 1.5rem 0;
}

.interactive-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  border: 1px solid #e2e8f0;
  table-layout: fixed;
}

/* Special handling for the first column (Method) */
.interactive-table th:first-child,
.interactive-table td:first-child {
  min-width: 140px;
  max-width: 160px;
  text-align: left;
  padding-left: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.85rem;
}

/* Responsive table adjustments */
@media (max-width: 768px) {
  .interactive-table th {
    font-size: 0.7rem;
    padding: 0.6rem 0.4rem;
    min-width: 60px;
    max-width: 90px;
  }
  
  .interactive-table td {
    font-size: 0.75rem;
    padding: 0.6rem 0.4rem;
  }
  
  .interactive-table th:first-child,
  .interactive-table td:first-child {
    min-width: 100px;
    max-width: 120px;
    font-size: 0.75rem;
    padding-left: 0.6rem;
  }
  
  .interactive-table td:first-child {
    font-size: 0.7rem;
    letter-spacing: -0.2px;
  }
  
  .interactive-table td:first-child strong {
    font-size: 0.7rem;
    letter-spacing: -0.3px;
  }
  
  .interactive-table td.long-model-name {
    font-size: 0.65rem !important;
    letter-spacing: -0.4px;
    padding: 0.6rem 0.5rem;
  }
  
  .interactive-table td.long-model-name strong {
    font-size: 0.65rem !important;
    letter-spacing: -0.5px;
  }
}

.interactive-table th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.8rem 0.6rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.82rem;
  border-bottom: 2px solid #5a67d8;
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: all 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 80px;
  max-width: 120px;
}

.interactive-table th:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
  transform: translateY(-1px);
}

.interactive-table th.sortable::after {
  content: '⇅';
  position: absolute;
  right: 10px;
  opacity: 0.5;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

.interactive-table th.sort-asc::after {
  content: '↑';
  opacity: 1;
  color: #fbbf24;
  font-weight: bold;
}

.interactive-table th.sort-desc::after {
  content: '↓';
  opacity: 1;
  color: #fbbf24;
  font-weight: bold;
}

.interactive-table td {
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.85rem;
  text-align: center;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.interactive-table tbody tr {
  transition: all 0.3s ease;
}

.interactive-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.interactive-table tbody tr:hover {
  background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 100%);
  transform: scale(1.01);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Highlight results with gradient grayscale */
.rank-1 {
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%) !important;
  color: #374151 !important;
  font-weight: bold !important;
  position: relative;
}

.rank-1::before {
  content: '★';
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  color: #fbbf24;
  font-size: 0.8rem;
}

.rank-2 {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%) !important;
  color: #4b5563 !important;
  font-weight: 600 !important;
}

.rank-3 {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%) !important;
  color: #4b5563 !important;
  font-weight: 600 !important;
}

.rank-4 {
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%) !important;
  color: #6b7280 !important;
  font-weight: 500 !important;
}

.rank-5 {
  background: #ffffff !important;
  color: #6b7280 !important;
  font-weight: 500 !important;
}

.rank-6 {
  background: #ffffff !important;
  color: #9ca3af !important;
  font-weight: 400 !important;
}

.rank-7 {
  background: #ffffff !important;
  color: #9ca3af !important;
  font-weight: 400 !important;
}

.rank-8 {
  background: #ffffff !important;
  color: #d1d5db !important;
  font-weight: 400 !important;
}

/* Method name styling */
.interactive-table td:first-child {
  font-weight: 600;
  color: #1e293b;
  background: #f8fafc !important;
}

.interactive-table td:first-child strong {
  color: #667eea;
}

/* Six column table specific styles */
.six-column th {
  font-size: 0.85rem;
  padding: 0.8rem 0.6rem;
}

.six-column td {
  padding: 0.6rem;
  font-size: 0.85rem;
  text-align: center;
}

.six-column td:first-child {
  text-align: left;
  font-weight: 600;
}

/* Sort indicator animation */
@keyframes sortIndicator {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Enhanced table header tooltip */
.interactive-table th {
  position: relative;
}

.interactive-table th[title]:hover::before {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 5px;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Specific styling for long benchmark names */
.interactive-table th:nth-child(3), /* Where2Approach */
.interactive-table th:nth-child(4), /* PACO-LVIS, Where2Fit, etc */
.interactive-table th:nth-child(5)  /* RoboRefit, Where2Go, etc */ {
  font-size: 0.75rem;
  letter-spacing: -0.3px;
  padding: 0.7rem 0.4rem;
}

/* Additional compression for very long names */
.interactive-table th[title*="Where2Approach"],
.interactive-table th[title*="PACO-LVIS"],
.interactive-table th[title*="RoboRefit"] {
  font-size: 0.7rem;
  letter-spacing: -0.4px;
}

/* Special handling for long model names in first column */
.interactive-table td:first-child strong {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.interactive-table td:first-child {
  font-size: 0.8rem;
  letter-spacing: -0.1px;
}

/* Specific styling for very long model names */
.interactive-table td.long-model-name {
  font-size: 0.75rem !important;
  letter-spacing: -0.3px;
  padding: 0.7rem 0.8rem;
  word-spacing: -1px;
}

.interactive-table td.long-model-name strong {
  font-size: 0.75rem !important;
  letter-spacing: -0.4px;
  font-weight: 600;
}

/* Ultra-compact table style for mobile */
@media (max-width: 600px) {
  .interactive-table {
    font-size: 0.7rem;
  }
  
  .interactive-table th,
  .interactive-table td {
    padding: 0.4rem 0.3rem;
  }
  
  .interactive-table th {
    font-size: 0.65rem;
    line-height: 1.1;
    letter-spacing: -0.3px;
  }
  
  .interactive-table th:nth-child(3),
  .interactive-table th:nth-child(4),
  .interactive-table th:nth-child(5) {
    font-size: 0.6rem;
    letter-spacing: -0.4px;
  }
}

/* Additional optimization for very narrow screens */
@media (max-width: 480px) {
  .interactive-table th {
    font-size: 0.55rem;
    padding: 0.3rem 0.2rem;
    line-height: 1;
  }
  
  .interactive-table td {
    font-size: 0.6rem;
    padding: 0.3rem 0.2rem;
  }
  
  .interactive-table th:first-child,
  .interactive-table td:first-child {
    min-width: 80px;
    max-width: 100px;
    font-size: 0.65rem;
    padding-left: 0.4rem;
  }
  
  .interactive-table td:first-child {
    font-size: 0.6rem;
    letter-spacing: -0.3px;
  }
  
  .interactive-table td:first-child strong {
    font-size: 0.6rem;
    letter-spacing: -0.4px;
  }
  
  .interactive-table td.long-model-name {
    font-size: 0.55rem !important;
    letter-spacing: -0.5px;
    padding: 0.3rem 0.3rem;
  }
  
  .interactive-table td.long-model-name strong {
    font-size: 0.55rem !important;
    letter-spacing: -0.6px;
  }
}

.sort-indicator-animate::after {
  animation: sortIndicator 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .innovations-grid {
    grid-template-columns: 1fr;
  }
  
  .intro-main {
    padding: 1rem;
    font-size: 1rem;
    text-align: justify;
    text-justify: inter-word;
  }
  
  .key-innovations-title {
    font-size: 1.2rem;
  }
  
  .interactive-table th,
  .interactive-table td {
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
  }
  
  .interactive-table th::after {
    right: 5px;
  }
  
  .six-column th,
  .six-column td {
    padding: 0.4rem 0.3rem;
    font-size: 0.75rem;
  }
}
