/* OmniSafetyBench Custom Styles */

/* Global Styles */
.omnibench {
  font-family: 'Google Sans', sans-serif;
  font-weight: bold;
  background: linear-gradient(45deg, #e74c3c, #c0392b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Reduce paragraph spacing and increase font size */
.content p {
  margin-bottom: 0.75rem !important;
  font-size: 1.1rem !important;
  line-height: 1.6 !important;
}

.content p:last-child {
  margin-bottom: 0 !important;
}

.content ul {
  margin-bottom: 0.75rem !important;
  font-size: 1.1rem !important;
}

.content li {
  margin-bottom: 0.25rem !important;
  line-height: 1.6 !important;
}

/* Reduce section spacing */
.section {
  padding: 2rem 1.5rem !important;
}

/* Text alignment for content */
.content.has-text-left {
  text-align: left !important;
}

.content.has-text-left p {
  text-align: left !important;
}

.mmmu {
  font-family: 'Google Sans', sans-serif;
  font-weight: bold;
  background: linear-gradient(45deg, #e74c3c, #c0392b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mmmu-logo {
  width: 1em;
  vertical-align: middle;
  margin-right: 0.2em;
}

/* Navigation */
.navbar {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.publication-title {
  margin-bottom: 1rem;
}

.publication-subtitle {
  color: #6c757d;
  margin-bottom: 2rem;
}

/* Author Sections */
.publication-authors {
  margin-bottom: 1rem;
}

.author-block {
  margin-right: 0.5rem;
}

/* Buttons */
.button.is-dark {
  background-color: #343a40;
  border-color: #343a40;
  transition: all 0.3s ease;
}

.button.is-dark:hover {
  background-color: #e74c3c;
  border-color: #e74c3c;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Safety-themed boxes */
.box {
  border-radius: 8px;
  margin-bottom: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.box:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Leaderboard */

.table-wrapper {
  overflow: visible;
  background: white;
  width: 100%;
}

#safety-table {
  width: 100%;
  background: white;
  border-collapse: collapse;
  font-size: 14px;
  font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  overflow: hidden;
  table-layout: auto;
}

#safety-table th {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  padding: 10px 6px;
  text-align: center;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: background-color 0.3s ease;
  white-space: nowrap;
  font-size: 13px;
}

#safety-table th:hover {
  background: linear-gradient(135deg, #c0392b, #a93226);
}

#safety-table th.sortable:after {
  content: ' ↕';
  opacity: 0.5;
}

#safety-table td {
  padding: 10px 6px;
  text-align: center;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
  font-weight: 600;
  vertical-align: middle;
}

#safety-table tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

#safety-table tbody tr:hover {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.08), rgba(231, 76, 60, 0.04));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Model type styling */
.open_source_olm {
  border-left: 4px solid #28a745;
}

.proprietary_olm {
  border-left: 4px solid #007bff;
}

/* Score styling */
.score {
  font-weight: 700;
  font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.overall-score {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.15), rgba(231, 76, 60, 0.05));
  font-weight: 800;
  font-size: 17px;
  border: 2px solid rgba(231, 76, 60, 0.3);
  border-radius: 6px;
}

.model-name {
  font-weight: 700;
  text-align: left !important;
  padding-left: 16px;
  font-size: 16px;
  color: #2c3e50;
  letter-spacing: 0.3px;
}

.model-type {
  font-size: 13px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1px;
  color: #5a6c7d;
}

.shortest-plank {
  font-size: 14px;
  text-align: center!important;
  max-width: 250px;
  word-wrap: break-word;
  font-weight: 500;
  color: #6c757d;
  line-height: 1.3;
  white-space: normal;
}

/* Labels */
.model-labels-container {
  margin: 1rem 0;
  text-align: center;
}

.leaderboard-label {
  display: inline-block;
  padding: 4px 12px;
  margin: 0 8px 8px 0;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.leaderboard-label.open_source_olm {
  background-color: #28a745;
  color: white;
}

.leaderboard-label.proprietary_olm {
  background-color: #007bff;
  color: white;
}

/* Test description */
.test-desc {
  font-style: italic;
  color: #6c757d;
  text-align: center;
  margin-top: 1rem;
  font-size: 14px;
}

/* Responsive design */
@media (max-width: 768px) {
  #safety-table {
    font-size: 12px;
  }
  
  #safety-table th,
  #safety-table td {
    padding: 6px 4px;
  }
  
  .shortest-plank {
    max-width: 120px;
    font-size: 10px;
  }
  
  .model-name {
    font-size: 12px;
  }
}

/* Animated gradient backgrounds */
@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.hero.is-light {
  background: linear-gradient(-45deg, #f8f9fa, #e9ecef, #dee2e6, #ced4da);
  background-size: 400% 400%;
  animation: gradient 15s ease infinite;
}

/* Icon styling */
.fas.fa-shield-alt,
.fas.fa-shield-check {
  margin-right: 0.5rem;
}

/* Table container styling */
.leaderboard-container {
  margin: 2rem 0;
  border-radius: 12px;
  overflow: visible;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 100%;
}

/* Loading animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(231, 76, 60, 0.3);
  border-radius: 50%;
  border-top-color: #e74c3c;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Hover effects for interactive elements */
.clickable {
  cursor: pointer;
  user-select: none;
}

.clickable:hover {
  opacity: 0.8;
}

/* Safety score color coding */
.score[data-score="high"] {
  color: #28a745;
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.15), rgba(40, 167, 69, 0.05));
  border: 1px solid rgba(40, 167, 69, 0.3);
  border-radius: 6px;
  padding: 4px 8px;
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.score[data-score="medium"] {
  color: #f39c12;
  background: linear-gradient(135deg, rgba(243, 156, 18, 0.15), rgba(243, 156, 18, 0.05));
  border: 1px solid rgba(243, 156, 18, 0.3);
  border-radius: 6px;
  padding: 4px 8px;
  box-shadow: 0 2px 4px rgba(243, 156, 18, 0.2);
}

.score[data-score="low"] {
  color: #dc3545;
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.15), rgba(220, 53, 69, 0.05));
  border: 1px solid rgba(220, 53, 69, 0.3);
  border-radius: 6px;
  padding: 4px 8px;
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

/* Sort indicators */
#safety-table th.sort-asc:after {
  content: ' ↑';
  color: #fff;
  font-weight: bold;
}

#safety-table th.sort-desc:after {
  content: ' ↓';
  color: #fff;
  font-weight: bold;
}

/* Performance highlighting */
.best-performer {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.05));
  border-left: 4px solid #28a745;
}

.worst-performer {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
  border-left: 4px solid #dc3545;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeIn 0.6s ease-out;
}

/* Image styling */
.center {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Citation container with horizontal scroll */
.citation-container {
  overflow-x: auto;
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  border-left: 4px solid #e74c3c;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.citation-container pre {
  margin: 0;
  white-space: pre;
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.6;
  color: #2c3e50;
}

.citation-container::-webkit-scrollbar {
  height: 8px;
}

.citation-container::-webkit-scrollbar-track {
  background: #e9ecef;
  border-radius: 4px;
}

.citation-container::-webkit-scrollbar-thumb {
  background: #e74c3c;
  border-radius: 4px;
}

.citation-container::-webkit-scrollbar-thumb:hover {
  background: #c0392b;
}

/* Tooltip styles */
.tooltip {
  position: absolute;
  background-color: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 1000;
  max-width: 250px;
  word-wrap: break-word;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tooltip:before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

/* Metric Cards Styling */
.metric-card {
  border-radius: 16px;
  padding: 2rem 1.5rem;
  margin: 0.5rem 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 2px solid transparent;
  height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Different background colors for each card type */
.metric-card-danger {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.08), rgba(231, 76, 60, 0.04));
  border: 1px solid rgba(231, 76, 60, 0.2);
}

.metric-card-info {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.08), rgba(52, 152, 219, 0.04));
  border: 1px solid rgba(52, 152, 219, 0.2);
}

.metric-card-success {
  background: linear-gradient(135deg, rgba(39, 174, 96, 0.08), rgba(39, 174, 96, 0.04));
  border: 1px solid rgba(39, 174, 96, 0.2);
}

.metric-card-purple {
  background: linear-gradient(135deg, rgba(155, 89, 182, 0.08), rgba(155, 89, 182, 0.04));
  border: 1px solid rgba(155, 89, 182, 0.2);
}

.metric-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.15);
}

.metric-card:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  transition: all 0.3s ease;
}

.metric-card-danger:before {
  background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.metric-card-info:before {
  background: linear-gradient(90deg, #3498db, #2980b9);
}

.metric-card-success:before {
  background: linear-gradient(90deg, #27ae60, #229954);
}

.metric-card-purple:before {
  background: linear-gradient(90deg, #9b59b6, #8e44ad);
}

.metric-card:hover:before {
  height: 6px;
}

.metric-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-card-danger .metric-icon {
  color: #e74c3c;
}

.metric-card-info .metric-icon {
  color: #3498db;
}

.metric-card-success .metric-icon {
  color: #27ae60;
}

.metric-card-purple .metric-icon {
  color: #9b59b6;
}

.metric-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #2c3e50;
  letter-spacing: 0.5px;
}

.metric-subtitle {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #7f8c8d;
  letter-spacing: 0.3px;
}

.metric-description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #5a6c7d;
  flex-grow: 1;
  display: flex;
  align-items: center;
  text-align: center;
}

/* Metric Cards Grid Layout */
.columns.is-multiline .column.is-half {
  display: flex;
  align-items: stretch;
}

.columns.is-multiline .column.is-half .metric-card {
  width: 100%;
  margin: 0.75rem;
}

/* Force proper 2x2 grid on larger screens */
@media (min-width: 769px) {
  .columns.is-multiline .column.is-half {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* New Metrics Grid Layout */
.metrics-grid {
  font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.metric-item {
  padding: 1.5rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(248, 249, 250, 0.8), rgba(248, 249, 250, 0.4));
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.metric-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  border-color: rgba(231, 76, 60, 0.2);
}

.metric-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.4;
  color: #2c3e50;
}

.metric-desc {
  font-size: 1rem;
  line-height: 1.6;
  color: #5a6c7d;
  margin-bottom: 0;
  text-align: justify;
}

.formula-container {
  margin: 1.5rem 0 1rem 0;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.05), rgba(231, 76, 60, 0.02));
  border-left: 4px solid #e74c3c;
  border-radius: 8px;
  text-align: center;
}

.formula-container .MathJax {
  font-size: 1.1em !important;
}

/* Responsive design for new metrics layout */
@media (max-width: 768px) {
  .metrics-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  
  .metric-item {
    padding: 1.25rem;
  }
  
  .metric-name {
    font-size: 1.2rem;
  }
  
  .metric-desc {
    font-size: 0.95rem;
  }
  
  .formula-container {
    padding: 1.25rem;
    margin: 1rem 0;
  }
}
