/**
 * @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;
  gap: var(--fd-space-1);
  padding: var(--fd-space-3);
  background-color: var(--fd-muted);
  border-radius: var(--fd-radius-lg);
}

/* 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;
  gap: var(--fd-space-2);
  margin: 0;
  font-size: var(--fd-text-xs);
  font-weight: var(--fd-font-weight-medium);
  color: var(--fd-muted-foreground);
  text-transform: uppercase;
  letter-spacing: var(--fd-letter-spacing-wide);
}

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

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

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

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

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

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

.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);
}
