/* ===========================
   MODEL DETAILS PAGE STYLES
   =========================== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 40px;
  width: 100%;
}

/* ===========================
   BREADCRUMB
   =========================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 0;
  font-size: 14px;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
  opacity: 0.5;
}

.breadcrumb span {
  color: var(--text);
  font-weight: 500;
}

/* ===========================
   MODEL HERO
   =========================== */
.model-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 32px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 24px;
}

.model-hero-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.model-hero-icon-container {
  width: 64px;
  height: -webkit-fill-available;
  display: flex;
  align-items: top;
  justify-content: center;
}
.model-hero-icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.model-hero-icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.model-hero-info h1 {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.model-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}

.meta-badge.creator {
  background: #f1f5f9;
  color: var(--text-secondary);
}

.meta-badge.provider {
  background: #eff6ff;
  color: #1d4ed8;
}

.meta-badge.open-weight {
  background: #dcfce7;
  color: #166534;
}

.model-hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.version-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.snapshot-select {
  appearance: none;
  background: #fff;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 36px 8px 12px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'SF Mono', Monaco, monospace;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 180px;
}

.snapshot-select:hover {
  border-color: var(--border-strong);
}

.snapshot-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(230, 115, 0, 0.1);
}

/* ===========================
   MODEL DESCRIPTION
   =========================== */
.model-short-description {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-line;
  margin-top: 0;
}

.model-description {
  padding: 20px 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 24px;
}

.model-description p {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-line;
}

/* ===========================
   DETAIL CARDS
   =========================== */
.model-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.card-header svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.card-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.card-subtitle {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.pricing-card .card-subtitle {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===========================
   PRICING CARD
   =========================== */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
}

.price-block {
  background: #fff;
  padding: 24px;
}

.price-block.full-width {
  grid-column: 1 / -1;
}

.price-block-header {
  margin-bottom: 16px;
}

.price-direction {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.price-direction.input {
  background: #dbeafe;
  color: #1e40af;
}

.price-direction.output {
  background: #fce7f3;
  color: #9d174d;
}

.price-direction.image {
  background: #fef3c7;
  color: #92400e;
}

.price-direction.video {
  background: #e0e7ff;
  color: #3730a3;
}

.price-block-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.price-block-content.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.price-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.price-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.price-item.simple {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.price-type {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.price-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.price-nested {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

.price-nested-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nested-label {
  font-size: 12px;
  color: var(--muted);
}

.nested-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.no-data {
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}

/* ===========================
   CONTEXT CARD
   =========================== */
.context-card .card-header {
  border-bottom: none;
  background: #fff;
}

.context-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 24px 24px;
}

.big-number {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.unit {
  font-size: 16px;
  color: var(--muted);
  font-weight: 500;
}

/* ===========================
   CAPABILITIES CARD
   =========================== */
.capabilities-grid {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.capability-section h3 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.capability-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.capability-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: #f1f5f9;
  color: var(--text);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}

.capability-tag.feature {
  background: #eff6ff;
  color: #1d4ed8;
}

.capability-tag.tool {
  background: #fef3c7;
  color: #92400e;
}

/* ===========================
   NO DATA CARD
   =========================== */
.no-data-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
}

.no-data-card svg {
  width: 48px;
  height: 48px;
  color: var(--muted);
  margin-bottom: 16px;
  opacity: 0.5;
}

.no-data-card p {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
  .page {
    padding: 0 16px 32px;
  }

  .model-hero {
    flex-direction: column;
    padding: 24px;
    gap: 20px;
  }

  .model-hero-left {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .model-hero-icon {
    width: 56px;
    height: 56px;
  }

  .model-hero-icon img {
    width: 40px;
    height: 40px;
  }

  .model-hero-info h1 {
    font-size: 24px;
  }

  .model-hero-right {
    align-items: flex-start;
    width: 100%;
  }

  .snapshot-select {
    width: 100%;
    min-height: 44px;
    padding: 12px 16px;
    font-size: 14px;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .price-block-header {
    padding: 12px 16px;
  }

  .price-block-content {
    padding: 16px;
  }

  .big-number {
    font-size: 36px;
  }
}

@media (max-width: 520px) {
  .page {
    padding: 0 12px 24px;
  }

  .model-hero {
    padding: 20px;
  }

  .model-hero-info h1 {
    font-size: 22px;
  }

  .card-header {
    padding: 16px 20px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .card-header h2 {
    font-size: 15px;
  }

  .card-subtitle {
    margin-left: 0;
    margin-top: 4px;
    width: 100%;
    text-align: left;
  }

  .pricing-card .card-subtitle {
    width: auto;
    margin-left: auto;
    margin-top: 0;
  }

  .price-block {
    padding: 16px;
  }

  .capabilities-grid {
    padding: 16px;
  }

  .big-number {
    font-size: 32px;
  }

  .model-details {
    gap: 16px;
  }

  .detail-card {
    margin-bottom: 16px;
  }
}

/* ===========================
   MB CERTIFIED BADGE
   =========================== */
.mb-certified-wrapper {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  cursor: help;
  vertical-align: middle;
}

.mb-certified-badge {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}

.model-hero-info h1 {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .mb-certified-wrapper {
    margin-left: 6px;
  }
  
  .mb-certified-badge {
    width: 16px;
    height: 16px;
  }
}
