@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-component="modal"][data-slot="overlay"] {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.2s ease;

  @media (prefers-color-scheme: dark) {
    background-color: rgba(0, 0, 0, 0.7);
  }

  [data-slot="content"] {
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    padding: var(--space-6);
    min-width: 400px;
    max-width: 90vw;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.2s ease;

    @media (max-width: 30rem) {
      min-width: 300px;
      padding: var(--space-4);
    }

    @media (prefers-color-scheme: dark) {
      box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    }

    button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: var(--space-3) var(--space-4);
      border: 1px solid var(--color-border);
      border-radius: var(--border-radius-sm);
      background-color: var(--color-bg);
      color: var(--color-text);
      font-size: var(--font-size-sm);
      font-family: var(--font-sans);
      font-weight: 500;
      line-height: 1;
      cursor: pointer;
      transition: all 0.15s ease;

      &:hover:not(:disabled) {
        background-color: var(--color-surface-hover);
        border-color: var(--color-accent);
      }

      &:active:not(:disabled) {
        transform: translateY(1px);
      }

      &:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
      }

      &[data-color="primary"] {
        background-color: var(--color-primary);
        border-color: var(--color-primary);
        color: var(--color-primary-text);

        &:hover:not(:disabled) {
          background-color: var(--color-primary-hover);
          border-color: var(--color-primary-hover);
        }
      }

      &[data-color="ghost"] {
        background-color: transparent;
        border-color: transparent;
        color: var(--color-text-muted);

        &:hover:not(:disabled) {
          background-color: var(--color-surface-hover);
          border-color: var(--color-border);
          color: var(--color-text);
        }
      }
    }
  }

  [data-slot="title"] {
    margin: 0 0 var(--space-4) 0;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text);
    text-align: center;
  }

  [data-slot="content"][data-variant="black"] {
    background-color: #000;
    border-color: rgba(255, 255, 255, 0.17);
    color: rgba(255, 255, 255, 0.92);
    font-family: var(--font-mono);

    [data-slot="title"] {
      color: rgba(255, 255, 255, 0.92);
      font-family: var(--font-mono);
    }
  }
}
