/**
 * @file
 * FlowDrop Detail Grid Component Styles
 *
 * Provides styling for key-value detail displays.
 */

.fd-detail-grid {
  display: grid;
  gap: var(--fd-space-4);
  margin: 0;
  padding: 0;
}

/* Column configurations */
.fd-detail-grid--columns-auto {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.fd-detail-grid--columns-1 {
  grid-template-columns: 1fr;
}

.fd-detail-grid--columns-2 {
  grid-template-columns: repeat(2, 1fr);
}

.fd-detail-grid--columns-3 {
  grid-template-columns: repeat(3, 1fr);
}

.fd-detail-grid--columns-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Responsive columns */
@media (max-width: 768px) {
  .fd-detail-grid--columns-3,
  .fd-detail-grid--columns-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .fd-detail-grid--columns-2,
  .fd-detail-grid--columns-3,
  .fd-detail-grid--columns-4 {
    grid-template-columns: 1fr;
  }
}

/* ========================================================================
 * ITEM
 * ======================================================================== */

.fd-detail-grid__item {
  display: flex;
  flex-direction: column;
  padding: var(--fd-space-3);
  border-radius: var(--fd-radius-lg);
  background-color: var(--fd-muted);
  gap: var(--fd-space-1);
}

/* Column span modifiers */
.fd-detail-grid__item--span-2 {
  grid-column: span 2;
}

.fd-detail-grid__item--span-full {
  grid-column: 1 / -1;
}

@media (max-width: 480px) {
  .fd-detail-grid__item--span-2 {
    grid-column: span 1;
  }
}

/* ========================================================================
 * LABEL
 * ======================================================================== */

.fd-detail-grid__label {
  display: flex;
  align-items: center;
  margin: 0;
  letter-spacing: var(--fd-letter-spacing-wide);
  text-transform: uppercase;
  color: var(--fd-muted-foreground);
  font-size: var(--fd-text-xs);
  font-weight: var(--fd-font-weight-medium);
  gap: var(--fd-space-2);
}

.fd-detail-grid__icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
}

.fd-detail-grid__icon svg {
  width: 100%;
  height: 100%;
}

/* ========================================================================
 * VALUE
 * ======================================================================== */

.fd-detail-grid__value {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--fd-foreground);
  font-size: var(--fd-text-sm);
  font-weight: var(--fd-font-weight-medium);
  line-height: var(--fd-line-height-normal);
}

.fd-detail-grid__value--mono {
  font-family: var(--fd-font-family-mono);
  font-size: var(--fd-text-xs);
}

.fd-detail-grid__link {
  text-decoration: none;
  color: var(--fd-primary-hover);
}

.fd-detail-grid__link:hover {
  text-decoration: underline;
}

/* ========================================================================
 * VARIANT STYLES
 * ======================================================================== */

.fd-detail-grid__item--success {
  background-color: var(--fd-success-muted);
}

.fd-detail-grid__item--success .fd-detail-grid__label {
  color: var(--fd-success-hover);
}

.fd-detail-grid__item--success .fd-detail-grid__value {
  color: var(--fd-success-hover);
}

.fd-detail-grid__item--warning {
  background-color: var(--fd-warning-muted);
}

.fd-detail-grid__item--warning .fd-detail-grid__label {
  color: var(--fd-warning-hover);
}

.fd-detail-grid__item--warning .fd-detail-grid__value {
  color: var(--fd-warning-hover);
}

.fd-detail-grid__item--error {
  background-color: var(--fd-error-muted);
}

.fd-detail-grid__item--error .fd-detail-grid__label {
  color: var(--fd-error-hover);
}

.fd-detail-grid__item--error .fd-detail-grid__value {
  color: var(--fd-error-hover);
}

.fd-detail-grid__item--info {
  background-color: var(--fd-info-muted);
}

.fd-detail-grid__item--info .fd-detail-grid__label {
  color: var(--fd-info);
}

.fd-detail-grid__item--info .fd-detail-grid__value {
  color: var(--fd-primary-hover);
}
