/* Modern card and table styling for model pages */
/* Comprehensive RTL support for multi-language model cards */
/* Model description styling */
.model-description {
  font-style: italic;
  color: #444;
  margin: 15px 0 20px;
  line-height: 1.6;
  max-width: 90%;
}

[data-theme="dark"] .model-description {
  color: #b0b0b0;
}

/* General styling */
.badge {
  display: inline-block;
  padding: 0.35em 0.9em;
  font-size: 0.85em;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.4rem;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}
.badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.badge-success {
  background-color: #e3fcef;
  color: #0d6a33;
  border: 1px solid #a3e9c0;
}
.badge-secondary {
  background-color: #f0f2f5;
  color: #495057;
  border: 1px solid #dbe0e5;
}

[data-theme="dark"] .badge {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .badge:hover {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}
[data-theme="dark"] .badge-success {
  background-color: #0d3a20;
  color: #7ce0a9;
  border: 1px solid #1a5c33;
}
[data-theme="dark"] .badge-secondary {
  background-color: #2a2d33;
  color: #b0b5bc;
  border: 1px solid #3a3f45;
}

/* Metadata section */
.model-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin: 24px 0;
  padding: 20px;
  background-color: #f9fafb;
  border-radius: 10px;
  border: 1px solid #eaecef;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}
.metadata-item {
  display: flex;
  align-items: center;
  font-size: 0.95em;
  color: #333;
}
.metadata-icon {
  margin-right: 10px;
  font-size: 1.2em;
  color: #555;
}

/* RTL support for metadata icons */
html[dir="rtl"] .metadata-icon {
  margin-right: 0;
  margin-left: 10px;
}

[data-theme="dark"] .model-metadata {
  background-color: #161b22;
  border: 1px solid #282626;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
[data-theme="dark"] .metadata-item {
  color: #d0d0d0;
}
[data-theme="dark"] .metadata-icon {
  color: #a0a0a0;
}

/* Card styling - Enhanced for better visual appeal */
.spec-card,
.feature-card {
  border: 1px solid #e0e1e2;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  background-color: #ffffff;
  max-width: 100%;
}
.spec-card:hover,
.feature-card:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.spec-card {
  border-left: 4px solid #3498db;
}
.feature-card {
  border-left: 4px solid #2ecc71;
}

/* RTL support for card borders */
html[dir="rtl"] .spec-card {
  border-left: none;
  border-right: 4px solid #3498db;
}
html[dir="rtl"] .feature-card {
  border-left: none;
  border-right: 4px solid #2ecc71;
}
.card-header {
  background: linear-gradient(to right, #f9fafb, #ffffff);
  padding: 18px 22px;
  font-weight: 600;
  font-size: 1.15em;
  border-bottom: 1px solid #e0e1e2;
  color: #1a1a1a;
  display: flex;
  align-items: center;
}
.spec-card .card-header {
  color: #2980b9;
}
.spec-card .card-header::before {
  content: "📊 ";
  margin-right: 8px;
}
.feature-card .card-header {
  color: #27ae60;
}
.feature-card .card-header::before {
  content: "✨ ";
  margin-right: 8px;
}

/* RTL support for card header icons */
html[dir="rtl"] .spec-card .card-header::before,
html[dir="rtl"] .feature-card .card-header::before {
  margin-right: 0;
  margin-left: 8px;
}
.card-body {
  padding: 0;
  background-color: #ffffff;
}

[data-theme="dark"] .spec-card,
[data-theme="dark"] .feature-card {
background-color: #161b22;
border: 1px solid #282626;
box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .spec-card:hover,
[data-theme="dark"] .feature-card:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .spec-card {
  border-left: 4px solid #2980b9;
}
html[dir="rtl"][data-theme="dark"] .spec-card {
  border-left: none;
  border-right: 4px solid #2980b9;
}
[data-theme="dark"] .feature-card {
  border-left: 4px solid #27ae60;
}
html[dir="rtl"][data-theme="dark"] .feature-card {
  border-left: none;
  border-right: 4px solid #27ae60;
}
[data-theme="dark"] .card-header {
background: linear-gradient(to right, #1a2029, #161b22);
border-bottom: 1px solid #282626;
color: #e0e0e0;
}

/* Fix for RTL dark mode card header */
html[dir="rtl"][data-theme="dark"] .card-header {
background: linear-gradient(to left, #1a2029, #161b22);
}
[data-theme="dark"] .spec-card .card-header {
  color: #5dade2;
}
[data-theme="dark"] .feature-card .card-header {
  color: #5ee894;
}
[data-theme="dark"] .card-body {
background-color: #161b22;
}

/* Table styling */
.card-body table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
.card-body th,
.card-body td {
  text-align: left;
  padding: 16px 22px;
  border-bottom: 1px solid #f1f1f2;
}

/* RTL support for table text alignment */
html[dir="rtl"] .card-body th,
html[dir="rtl"] .card-body td {
  text-align: right;
  font-size: 0.95em;
  line-height: 1.5;
}
.card-body th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #444;
  position: sticky;
  top: 0;
  z-index: 1;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}
.card-body tr:last-child td {
  border-bottom: none;
}
.card-body td strong {
  font-weight: 600;
  color: #333;
  display: block;
  margin-bottom: 4px;
}
.card-body td:first-child {
  width: 35%;
  background-color: #fafbfc;
  font-weight: 500;
}

/* RTL support for table cells */
html[dir="rtl"] .card-body td:first-child {
  background-color: #fafbfc;
}
html[dir="rtl"] .card-body td:last-child {
  background-color: #ffffff;
}
html[dir="rtl"][data-theme="dark"] .card-body td:last-child {
background-color: #161b22;
}

/* Add vertical spacing between rows in dark mode for better readability */
[data-theme="dark"] .card-body tr {
border-bottom: 1px solid #30363d;
}

/* Improve dark mode table cell padding for better readability */
[data-theme="dark"] .card-body td,
[data-theme="dark"] .card-body th {
padding: 16px 22px;
}
.card-body td:last-child {
  color: #444;
  font-weight: 500;
  padding-left: 24px;
}
.card-body em {
  color: #777;
  font-style: italic;
  display: inline-block;
  margin-top: 4px;
}

[data-theme="dark"] .card-body th,
[data-theme="dark"] .card-body td {
border-bottom: 1px solid #30363d;
}
[data-theme="dark"] .card-body th {
background-color: #0d1117;
color: #e6edf3;
font-weight: 600;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .card-body td strong {
color: #e6edf3;
font-weight: 600;
}
[data-theme="dark"] .card-body td:first-child {
background-color: #0d1117;
font-weight: 500;
}
[data-theme="dark"] .card-body td:last-child {
color: #c9d1d9;
}
/* RTL support for dark mode table cells - Fixed */
html[dir="rtl"][data-theme="dark"] .card-body td:first-child {
background-color: #0d1117;
}

[data-theme="dark"] .card-body em {
color: #8b949e;
}

/* Table row hover effect */
.card-body tbody tr:hover {
  background-color: #f7f9fc;
}
.card-body tbody tr:hover td:first-child {
  background-color: #f0f4f8;
}

/* RTL support for table hover */
html[dir="rtl"] .card-body tbody tr:hover td:first-child {
  background-color: #f0f4f8;
}
html[dir="rtl"] .card-body tbody tr:hover td:last-child {
  background-color: #f7f9fc;
}

[data-theme="dark"] .card-body tbody tr:hover {
background-color: #161b22;
}
[data-theme="dark"] .card-body tbody tr:hover td:first-child {
background-color: #0d1117;
border-right: 2px solid #1f6feb;
}

/* RTL support for dark mode table hover */
html[dir="rtl"][data-theme="dark"] .card-body tbody tr:hover td:first-child {
background-color: #0d1117;
border-left: 2px solid #1f6feb;
border-right: none;
}
html[dir="rtl"][data-theme="dark"] .card-body tbody tr:hover td:last-child {
background-color: #161b22;
}

/* Yes/No icons styling - Enhanced */
.card-body td span.icon {
  margin-right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  width: 24px;
  height: 24px;
}

/* RTL support for icons */
html[dir="rtl"] .card-body td span.icon {
  margin-right: 0;
  margin-left: 8px;
}
.card-body td span.yes {
  color: #27ae60;
}
.card-body td span.no {
  color: #e74c3c;
}
.support-text {
  font-weight: 500;
  margin-left: 4px;
}

/* RTL support for support text */
html[dir="rtl"] .support-text {
  margin-left: 0;
  margin-right: 4px;
}

[data-theme="dark"] .card-body td span.yes {
  color: #5ee894;
}
[data-theme="dark"] .card-body td span.no {
  color: #ff6b6b;
}

/* Responsive adjustments - Enhanced for better mobile experience */
@media (max-width: 768px) {
  .card-body th,
  .card-body td {
    padding: 12px 16px;
  }
  .card-body td:first-child {
    width: 40%;
  }
  .card-header {
    padding: 16px 18px;
  }
  .metadata-item {
    flex-basis: 100%;
  }
  .model-metadata {
    flex-direction: column;
    gap: 12px;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .card-body table {
    table-layout: auto;
  }
  .card-body td:first-child {
    width: 45%;
  }
  .card-body td,
  .card-body th {
    padding: 10px 12px;
  }
}

/* Provider/Owner link styling */
.provider-owner-link {
  color: #2980b9;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  border-bottom: 1px solid transparent;
}

.provider-owner-link:hover {
  color: #3498db;
  border-bottom: 1px solid #3498db;
}

/* Dark mode support for provider/owner links */
[data-theme="dark"] .provider-owner-link {
  color: #5dade2;
}

[data-theme="dark"] .provider-owner-link:hover {
  color: #7fb3d5;
  border-bottom: 1px solid #7fb3d5;
}

/* Additional RTL support - Enhanced */
html[dir="rtl"] .card-header {
  background: linear-gradient(to left, #f9fafb, #ffffff);
}

/* Fix for provider/owner links in RTL mode */
html[dir="rtl"] .provider-owner-link {
  display: inline-block;
}
